summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Linker.cpp
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
commit149376dee58bb1ab2139ddf2851405c038112cdf (patch)
tree217ce99d05c6c1a2a8b0bf27915f8648804645d7 /llvm/lib/Transforms/Utils/Linker.cpp
parent69ce8674b5edeb6a1c8290cb7eefcd44ab28f3a2 (diff)
downloadbcm5719-llvm-149376dee58bb1ab2139ddf2851405c038112cdf.tar.gz
bcm5719-llvm-149376dee58bb1ab2139ddf2851405c038112cdf.zip
- 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. llvm-svn: 4149
Diffstat (limited to 'llvm/lib/Transforms/Utils/Linker.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Linker.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp
index 6753f51657c..8fe9113d821 100644
--- a/llvm/lib/Transforms/Utils/Linker.cpp
+++ b/llvm/lib/Transforms/Utils/Linker.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...
OpenPOWER on IntegriCloud