MEGAPATCH checkin.

For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
diff --git a/llvm/lib/AsmParser/Parser.cpp b/llvm/lib/AsmParser/Parser.cpp
index 19632dd..7af3133 100644
--- a/llvm/lib/AsmParser/Parser.cpp
+++ b/llvm/lib/AsmParser/Parser.cpp
@@ -34,7 +34,7 @@
     fclose(F);
 
   if (Result) {  // Check to see that it is valid...
-    if (verifyModule(Result)) {
+    if (verifyModule(*Result)) {
       delete Result;
       throw ParseException(Filename, "Source file is not well formed LLVM!");
     }
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index de8d0e6..4b9f36f 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -45,8 +45,8 @@
 #define UR_OUT(X)
 #endif
 
-// This contains info used when building the body of a method.  It is destroyed
-// when the method is completed.
+// This contains info used when building the body of a function.  It is
+// destroyed when the function is completed.
 //
 typedef vector<Value *> ValueList;           // Numbered defs
 static void ResolveDefinitions(vector<ValueList> &LateResolvers,
@@ -68,9 +68,9 @@
   GlobalRefsType GlobalRefs;
 
   void ModuleDone() {
-    // If we could not resolve some methods at method compilation time (calls to
-    // methods before they are defined), resolve them now...  Types are resolved
-    // when the constant pool has been completely parsed.
+    // If we could not resolve some functions at function compilation time
+    // (calls to functions before they are defined), resolve them now...  Types
+    // are resolved when the constant pool has been completely parsed.
     //
     ResolveDefinitions(LateResolveValues);
 
@@ -88,7 +88,7 @@
       ThrowException(UndefinedReferences);
     }
 
-    Values.clear();         // Clear out method local definitions
+    Values.clear();         // Clear out function local definitions
     Types.clear();
     CurrentModule = 0;
   }
@@ -132,13 +132,13 @@
 } CurModule;
 
 static struct PerFunctionInfo {
-  Function *CurrentFunction;     // Pointer to current method being created
+  Function *CurrentFunction;     // Pointer to current function being created
 
   vector<ValueList> Values;      // Keep track of numbered definitions
   vector<ValueList> LateResolveValues;
   vector<PATypeHolder> Types;
   map<ValID, PATypeHolder> LateResolveTypes;
-  bool isDeclare;                // Is this method a forward declararation?
+  bool isDeclare;                // Is this function a forward declararation?
 
   inline PerFunctionInfo() {
     CurrentFunction = 0;
@@ -156,12 +156,12 @@
     // resolve the branches now...
     ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
 
-    Values.clear();         // Clear out method local definitions
+    Values.clear();         // Clear out function local definitions
     Types.clear();
     CurrentFunction = 0;
     isDeclare = false;
   }
-} CurMeth;  // Info for the current method...
+} CurMeth;  // Info for the current function...
 
 static bool inFunctionScope() { return CurMeth.CurrentFunction != 0; }
 
@@ -210,7 +210,7 @@
     Value *N = SymTab ? SymTab->lookup(Type::TypeTy, Name) : 0;
 
     if (N == 0) {
-      // Symbol table doesn't automatically chain yet... because the method
+      // Symbol table doesn't automatically chain yet... because the function
       // hasn't been added to the module...
       //
       SymTab = CurModule.CurrentModule->getSymbolTable();
@@ -741,7 +741,7 @@
 
 //===----------------------------------------------------------------------===//
 // Types includes all predefined types... except void, because it can only be
-// used in specific contexts (method returning void for example).  To have
+// used in specific contexts (function returning void for example).  To have
 // access to it, a user must explicitly use TypesV.
 //
 
@@ -810,7 +810,7 @@
     delete $1;
   };
 
-// TypeList - Used for struct declarations and as a basis for method type 
+// TypeList - Used for struct declarations and as a basis for function type 
 // declaration type lists
 //
 TypeListI : UpRTypes {
@@ -821,7 +821,7 @@
     ($$=$1)->push_back(*$3); delete $3;
   };
 
-// ArgTypeList - List of types for a method type declaration...
+// ArgTypeList - List of types for a function type declaration...
 ArgTypeListI : TypeListI
   | TypeListI ',' DOTDOTDOT {
     ($$=$1)->push_back(Type::VoidTy);
@@ -1011,7 +1011,7 @@
   CurModule.ModuleDone();
 };
 
-// FunctionList - A list of methods, preceeded by a constant pool.
+// FunctionList - A list of functions, preceeded by a constant pool.
 //
 FunctionList : FunctionList Function {
     $$ = $1;
@@ -1164,10 +1164,11 @@
       // Yes it is.  If this is the case, either we need to be a forward decl,
       // or it needs to be.
       if (!CurMeth.isDeclare && !M->isExternal())
-	ThrowException("Redefinition of method '" + FunctionName + "'!");      
+	ThrowException("Redefinition of function '" + FunctionName + "'!");
 
-      // If we found a preexisting method prototype, remove it from the module,
-      // so that we don't get spurious conflicts with global & local variables.
+      // If we found a preexisting function prototype, remove it from the
+      // module, so that we don't get spurious conflicts with global & local
+      // variables.
       //
       CurModule.CurrentModule->getFunctionList().remove(M);
     }
@@ -1182,10 +1183,8 @@
 
   CurMeth.FunctionStart(M);
 
-  // Add all of the arguments we parsed to the method...
+  // Add all of the arguments we parsed to the function...
   if ($5 && !CurMeth.isDeclare) {        // Is null if empty...
-    Function::ArgumentListType &ArgList = M->getArgumentList();
-
     for (list<pair<Argument*, char*> >::iterator I = $5->begin();
          I != $5->end(); ++I) {
       if (setValueName(I->first, I->second)) {  // Insert into symtab...
@@ -1193,7 +1192,7 @@
       }
       
       InsertValue(I->first);
-      ArgList.push_back(I->first);
+      M->getArgumentList().push_back(I->first);
     }
     delete $5;                     // We're now done with the argument list
   } else if ($5) {
@@ -1212,7 +1211,7 @@
 FunctionHeader : FunctionHeaderH BEGIN {
   $$ = CurMeth.CurrentFunction;
 
-  // Resolve circular types before we parse the body of the method.
+  // Resolve circular types before we parse the body of the function.
   ResolveTypes(CurMeth.LateResolveTypes);
 };
 
@@ -1275,10 +1274,10 @@
 
 
 BasicBlockList : BasicBlockList BasicBlock {
-    ($$ = $1)->getBasicBlocks().push_back($2);
+    ($$ = $1)->getBasicBlockList().push_back($2);
   }
-  | FunctionHeader BasicBlock { // Do not allow methods with 0 basic blocks   
-    ($$ = $1)->getBasicBlocks().push_back($2);
+  | FunctionHeader BasicBlock { // Do not allow functions with 0 basic blocks   
+    ($$ = $1)->getBasicBlockList().push_back($2);
   };
 
 
@@ -1358,7 +1357,7 @@
     }
     delete $2;
 
-    Value *V = getVal(PMTy, $3);   // Get the method we're calling...
+    Value *V = getVal(PMTy, $3);   // Get the function we're calling...
 
     BasicBlock *Normal = dyn_cast<BasicBlock>($8);
     BasicBlock *Except = dyn_cast<BasicBlock>($10);
@@ -1494,7 +1493,7 @@
     }
     delete $2;
 
-    Value *V = getVal(PMTy, $3);   // Get the method we're calling...
+    Value *V = getVal(PMTy, $3);   // Get the function we're calling...
 
     // Create the call node...
     if (!$5) {                                   // Has no arguments?