summaryrefslogtreecommitdiff
path: root/lib/Linker
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-13 20:57:00 +0000
committerChris Lattner <sabre@nondot.org>2002-10-13 20:57:00 +0000
commit69da5cf26143e4542d4bf8c78ffac6d079efe5c9 (patch)
tree22a05be14b5a74d3bbd2f1dcb8a07d91f4238177 /lib/Linker
parent0b16ae209a1d0876a7ea6800bb567d925443cba3 (diff)
downloadllvm-69da5cf26143e4542d4bf8c78ffac6d079efe5c9.tar.gz
llvm-69da5cf26143e4542d4bf8c78ffac6d079efe5c9.tar.bz2
llvm-69da5cf26143e4542d4bf8c78ffac6d079efe5c9.tar.xz
- Change Function's so that their argument list is populated when they are
constructed. Before, external functions would have an empty argument list, now a Function ALWAYS has a populated argument list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 6753f51657..8fe9113d82 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -323,14 +323,13 @@ static bool LinkFunctionBody(Function *Dest, const Function *Src,
map<const Value*, Value*> LocalMap; // Map for function local values
// Go through and convert function arguments over...
+ Function::aiterator DI = Dest->abegin();
for (Function::const_aiterator I = Src->abegin(), E = Src->aend();
- I != E; ++I) {
- // Create the new function argument and add to the dest function...
- Argument *DFA = new Argument(I->getType(), I->getName());
- Dest->getArgumentList().push_back(DFA);
+ I != E; ++I, ++DI) {
+ DI->setName(I->getName()); // Copy the name information over...
// Add a mapping to our local map
- LocalMap.insert(std::make_pair(I, DFA));
+ LocalMap.insert(std::make_pair(I, DI));
}
// Loop over all of the basic blocks, copying the instructions over...