[llvm-commits] CVS: llvm/lib/Transforms/IPO/MutateStructTypes.cpp

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


Changes in directory llvm/lib/Transforms/IPO:

MutateStructTypes.cpp updated: 1.31 -> 1.32

---
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/IPO/MutateStructTypes.cpp
diff -u llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.31 llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.32
--- llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.31	Tue Oct  1 17:38:36 2002
+++ llvm/lib/Transforms/IPO/MutateStructTypes.cpp	Sun Oct 13 15:53:11 2002
@@ -317,10 +317,10 @@
   Function *NewMeth = cast<Function>(GMI->second);
 
   // Okay, first order of business, create the arguments...
-  for (Function::aiterator I = m->abegin(), E = m->aend(); I != E; ++I) {
-    Argument *NFA = new Argument(ConvertType(I->getType()), I->getName());
-    NewMeth->getArgumentList().push_back(NFA);
-    LocalValueMap[I] = NFA; // Keep track of value mapping
+  for (Function::aiterator I = m->abegin(), E = m->aend(),
+         DI = NewMeth->abegin(); I != E; ++I, ++DI) {
+    DI->setName(I->getName());
+    LocalValueMap[I] = DI; // Keep track of value mapping
   }
 
 





More information about the llvm-commits mailing list