[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 13 15:54:14 PDT 2002


Changes in directory llvm/lib/Transforms/Utils:

Linker.cpp updated: 1.32 -> 1.33

---
Log message:

  - 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.


---
Diffs of the changes:

Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.32 llvm/lib/Transforms/Utils/Linker.cpp:1.33
--- llvm/lib/Transforms/Utils/Linker.cpp:1.32	Mon Sep 23 13:14:15 2002
+++ llvm/lib/Transforms/Utils/Linker.cpp	Sun Oct 13 15:53:12 2002
@@ -323,14 +323,13 @@
   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...





More information about the llvm-commits mailing list