projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix two fixmes: integrate with inlining, and document
[oota-llvm.git]
/
lib
/
Transforms
/
Utils
/
Linker.cpp
diff --git
a/lib/Transforms/Utils/Linker.cpp
b/lib/Transforms/Utils/Linker.cpp
index 6753f51657c78cb522e6fd64442755c939748ae7..8fe9113d8215907b9f90610069e3cd9e388974ef 100644
(file)
--- a/
lib/Transforms/Utils/Linker.cpp
+++ b/
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...
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();
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
// Add a mapping to our local map
- LocalMap.insert(std::make_pair(I, D
FA
));
+ LocalMap.insert(std::make_pair(I, D
I
));
}
// Loop over all of the basic blocks, copying the instructions over...
}
// Loop over all of the basic blocks, copying the instructions over...