[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

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


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.36 -> 1.37

---
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/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.36 llvm/lib/Bytecode/Reader/Reader.cpp:1.37
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.36	Fri Sep 20 15:57:54 2002
+++ llvm/lib/Bytecode/Reader/Reader.cpp	Sun Oct 13 15:53:09 2002
@@ -270,14 +270,13 @@
   BCR_TRACE(2, "METHOD TYPE: " << MTy << "\n");
 
   const FunctionType::ParamTypes &Params = MTy->getParamTypes();
+  Function::aiterator AI = M->abegin();
   for (FunctionType::ParamTypes::const_iterator It = Params.begin();
-       It != Params.end(); ++It) {
-    Argument *FA = new Argument(*It);
-    if (insertValue(FA, Values) == -1) {
+       It != Params.end(); ++It, ++AI) {
+    if (insertValue(AI, Values) == -1) {
       Error = "Error reading method arguments!\n";
       delete M; return true; 
     }
-    M->getArgumentList().push_back(FA);
   }
 
   while (Buf < EndBuf) {
@@ -357,10 +356,6 @@
 
   // We don't need the placeholder anymore!
   delete FunctionPHolder;
-
-  // If the method is empty, we don't need the method argument entries...
-  if (M->isExternal())
-    M->getArgumentList().clear();
 
   ResolveReferencesToValue(M, MethSlot);
 





More information about the llvm-commits mailing list