From c04f46567c3ebf64257d8f03e29d80a69606a6bc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 3 Jul 2008 23:13:02 +0000 Subject: Don't return std::vector by value, but pass it in by reference to be filled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53123 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineModuleInfo.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'include/llvm/CodeGen/MachineModuleInfo.h') diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 54654fda5b..a9567d2e25 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -1152,16 +1152,17 @@ public: /// getGlobalVariablesUsing - Return all of the GlobalVariables that use the /// named GlobalVariable. - std::vector - getGlobalVariablesUsing(Module &M, const std::string &RootName); + void getGlobalVariablesUsing(Module &M, const std::string &RootName, + std::vector &Result); /// getAnchoredDescriptors - Return a vector of anchored debug descriptors. /// - template std::vector getAnchoredDescriptors(Module &M) { + template + void getAnchoredDescriptors(Module &M, std::vector &AnchoredDescs) { T Desc; - std::vector Globals = - getGlobalVariablesUsing(M, Desc.getAnchorString()); - std::vector AnchoredDescs; + std::vector Globals; + getGlobalVariablesUsing(M, Desc.getAnchorString(), Globals); + for (unsigned i = 0, N = Globals.size(); i < N; ++i) { GlobalVariable *GV = Globals[i]; @@ -1171,8 +1172,6 @@ public: AnchoredDescs.push_back(cast(DR.Deserialize(GV))); } } - - return AnchoredDescs; } /// RecordRegionStart - Indicate the start of a region. -- cgit v1.2.3