This mega patch converts us from using Function::a{iterator|begin|end} to
authorChris Lattner <sabre@nondot.org>
Tue, 15 Mar 2005 04:54:21 +0000 (04:54 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 Mar 2005 04:54:21 +0000 (04:54 +0000)
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8

65 files changed:
lib/Analysis/AliasAnalysisEvaluator.cpp
lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/DataStructure/DataStructureOpt.cpp
lib/Analysis/DataStructure/EquivClassGraphs.cpp
lib/Analysis/DataStructure/Local.cpp
lib/Analysis/DataStructure/Steensgaard.cpp
lib/Analysis/IPA/Andersens.cpp
lib/Analysis/IPA/FindUsedTypes.cpp
lib/Analysis/IPA/GlobalsModRef.cpp
lib/AsmParser/llvmAsmParser.y
lib/Bytecode/Reader/Reader.cpp
lib/Bytecode/Reader/ReaderWrappers.cpp
lib/Bytecode/Writer/SlotCalculator.cpp
lib/Bytecode/Writer/Writer.cpp
lib/CodeGen/IntrinsicLowering.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/Linker/LinkArchives.cpp
lib/Linker/LinkModules.cpp
lib/Target/Alpha/AlphaAsmPrinter.cpp
lib/Target/Alpha/AlphaISelPattern.cpp
lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp
lib/Target/PowerPC/PPC32ISelSimple.cpp
lib/Target/PowerPC/PPC64ISelSimple.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/Sparc/SparcV8ISelSimple.cpp
lib/Target/SparcV8/SparcV8AsmPrinter.cpp
lib/Target/SparcV8/SparcV8ISelSimple.cpp
lib/Target/SparcV9/InternalGlobalMapper.cpp
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/SparcV9AsmPrinter.cpp
lib/Target/SparcV9/SparcV9RegInfo.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86ISelPattern.cpp
lib/Target/X86/X86ISelSimple.cpp
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/IPO/ExtractFunction.cpp
lib/Transforms/IPO/FunctionResolution.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/IPO/IPConstantPropagation.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/StripSymbols.cpp
lib/Transforms/Instrumentation/ProfilingUtils.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/Scalar/CorrelatedExprs.cpp
lib/Transforms/Scalar/GCSE.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/Utils/CloneFunction.cpp
lib/Transforms/Utils/CloneModule.cpp
lib/Transforms/Utils/CodeExtractor.cpp
lib/Transforms/Utils/InlineFunction.cpp
lib/VMCore/AsmWriter.cpp
lib/VMCore/Mangler.cpp
lib/VMCore/Module.cpp
lib/VMCore/Verifier.cpp

index bf979635eea6e7a4f0d329e06ab5fffcc542c901..7c8ccb6c62f818ed0655a29dad362e636f13e31f 100644 (file)
@@ -102,7 +102,7 @@ bool AAEval::runOnFunction(Function &F) {
   std::set<Value *> Pointers;
   std::set<CallSite> CallSites;
 
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
     if (isa<PointerType>(I->getType()))    // Add all pointer arguments
       Pointers.insert(I);
 
index a94e083da3f7e1ac8b0dff5fae8dae6b8eba4fb4..ac2abb308b92ca53cc21757afe16b7fef44029d1 100644 (file)
@@ -1270,7 +1270,7 @@ static bool PathExistsToClonedNode(const DSCallSite &CS,
 void DSGraph::getFunctionArgumentsForCall(Function *F,
                                        std::vector<DSNodeHandle> &Args) const {
   Args.push_back(getReturnNodeFor(*F));
-  for (Function::aiterator AI = F->abegin(), E = F->aend(); AI != E; ++AI)
+  for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI)
     if (isPointerType(AI->getType())) {
       Args.push_back(getNodeForValue(AI));
       assert(!Args.back().isNull() && "Pointer argument w/o scalarmap entry!?");
@@ -1405,7 +1405,7 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F,
 DSCallSite DSGraph::getCallSiteForArguments(Function &F) const {
   std::vector<DSNodeHandle> Args;
 
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
     if (isPointerType(I->getType()))
       Args.push_back(getNodeForValue(I));
 
@@ -1482,7 +1482,7 @@ void DSGraph::markIncompleteNodes(unsigned Flags) {
     for (ReturnNodesTy::iterator FI = ReturnNodes.begin(), E =ReturnNodes.end();
          FI != E; ++FI) {
       Function &F = *FI->first;
-      for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+      for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
         if (isPointerType(I->getType()))
           markIncompleteNode(getNodeForValue(I).getNode());
       markIncompleteNode(FI->second.getNode());
@@ -2038,7 +2038,7 @@ void DSGraph::AssertGraphOK() const {
          E = ReturnNodes.end();
        RI != E; ++RI) {
     Function &F = *RI->first;
-    for (Function::aiterator AI = F.abegin(); AI != F.aend(); ++AI)
+    for (Function::arg_iterator AI = F.arg_begin(); AI != F.arg_end(); ++AI)
       if (isPointerType(AI->getType()))
         assert(!getNodeForValue(AI).isNull() &&
                "Pointer argument must be in the scalar map!");
index 1d8373a01df5ff778ea6d41eab8069992b42aa39..c75784b9647d0edafe3239b2fa4ba6003fd0b275 100644 (file)
@@ -59,7 +59,7 @@ bool DSOpt::OptimizeGlobals(Module &M) {
   const DSGraph::ScalarMapTy &SM = GG.getScalarMap();
   bool Changed = false;
 
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (!I->isExternal()) { // Loop over all of the non-external globals...
       // Look up the node corresponding to this global, if it exists.
       DSNode *GNode = 0;
index 4ada4dcca5e65000e8c05ade5962134e891a992e..ef1e01aae4b736fcfc9c800b32a7c4b0c96b82cd 100644 (file)
@@ -215,7 +215,7 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
       // Record the argument nodes for use in merging later below.
       std::vector<DSNodeHandle> ArgNodes;  
 
-      for (Function::aiterator AI1 = LF->abegin(); AI1 != LF->aend(); ++AI1)
+      for (Function::arg_iterator AI1 = LF->arg_begin(); AI1 != LF->arg_end(); ++AI1)
         if (DS::isPointerType(AI1->getType()))
           ArgNodes.push_back(MergedG.getNodeForValue(AI1));
       
@@ -254,7 +254,7 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
 
         // Merge the function arguments with all argument nodes found so far.
         // If there are extra function args, add them to the vector of argNodes
-        Function::aiterator AI2 = F->abegin(), AI2end = F->aend();
+        Function::arg_iterator AI2 = F->arg_begin(), AI2end = F->arg_end();
         for (unsigned arg=0, numArgs = ArgNodes.size();
              arg != numArgs && AI2 != AI2end; ++AI2, ++arg)
           if (DS::isPointerType(AI2->getType()))
index 20f45a7b27d44c003592ff00e50b977d307e6a32..e2e40f76d2a993227dc27414107d2a6ef9bbdbcc 100644 (file)
@@ -82,7 +82,7 @@ namespace {
         FunctionCalls(&fc) {
 
       // Create scalar nodes for all pointer arguments...
-      for (Function::aiterator I = f.abegin(), E = f.aend(); I != E; ++I)
+      for (Function::arg_iterator I = f.arg_begin(), E = f.arg_end(); I != E; ++I)
         if (isPointerType(I->getType()))
           getValueDest(*I);
 
@@ -1076,7 +1076,7 @@ bool LocalDataStructures::runOnModule(Module &M) {
     GraphBuilder GGB(*GlobalsGraph);
     
     // Add initializers for all of the globals to the globals graph...
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
       if (!I->isExternal())
         GGB.mergeInGlobalInitializer(I);
   }
index eee9b0b6f9663ab0e3040db47b97ad482f93f030..dd07ee6f8249aefc63816d430f8eb99a567c78d0 100644 (file)
@@ -94,7 +94,7 @@ void Steens::ResolveFunctionCall(Function *F, const DSCallSite &Call,
 
   // Loop over all pointer arguments, resolving them to their provided pointers
   unsigned PtrArgIdx = 0;
-  for (Function::aiterator AI = F->abegin(), AE = F->aend();
+  for (Function::arg_iterator AI = F->arg_begin(), AE = F->arg_end();
        AI != AE && PtrArgIdx < Call.getNumPtrArgs(); ++AI) {
     DSGraph::ScalarMapTy::iterator I = ValMap.find(AI);
     if (I != ValMap.end())    // If its a pointer argument...
index b8553e6743967dbed62fd6737b4ffda75805124a..12d4cf5d4cd78424b1ca2c290af1d6bde4d6fb21 100644 (file)
@@ -433,7 +433,7 @@ void Andersens::IdentifyObjects(Module &M) {
   ++NumObjects;
 
   // Add all the globals first.
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
     ObjectNodes[I] = NumObjects++;
     ValueNodes[I] = NumObjects++;
   }
@@ -449,7 +449,7 @@ void Andersens::IdentifyObjects(Module &M) {
       VarargNodes[F] = NumObjects++;
 
     // Add nodes for all of the incoming pointer arguments.
-    for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+    for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
       if (isa<PointerType>(I->getType()))
         ValueNodes[I] = NumObjects++;
 
@@ -550,7 +550,7 @@ void Andersens::AddGlobalInitializerConstraints(Node *N, Constant *C) {
 }
 
 void Andersens::AddConstraintsForNonInternalLinkage(Function *F) {
-  for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     if (isa<PointerType>(I->getType()))
       // If this is an argument of an externally accessible function, the
       // incoming pointer might point to anything.
@@ -571,7 +571,7 @@ void Andersens::CollectConstraints(Module &M) {
   GraphNodes[NullPtr].addPointerTo(&GraphNodes[NullObject]);
 
   // Next, add any constraints on global variables and their initializers.
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
     // Associate the address of the global object as pointing to the memory for
     // the global: &G = <G memory>
     Node *Object = getObject(I);
@@ -599,7 +599,7 @@ void Andersens::CollectConstraints(Module &M) {
       getVarargNode(F)->setValue(F);
 
     // Set up incoming argument nodes.
-    for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+    for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
       if (isa<PointerType>(I->getType()))
         getNodeValue(*I);
 
@@ -620,7 +620,7 @@ void Andersens::CollectConstraints(Module &M) {
 
       // Any pointers that are passed into the function have the universal set
       // stored into them.
-      for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+      for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
         if (isa<PointerType>(I->getType())) {
           // Pointers passed into external functions could have anything stored
           // through them.
@@ -772,7 +772,7 @@ void Andersens::AddConstraintsForCall(CallSite CS, Function *F) {
                                      getReturnNode(F)));
   }
   
-  Function::aiterator AI = F->abegin(), AE = F->aend();
+  Function::arg_iterator AI = F->arg_begin(), AE = F->arg_end();
   CallSite::arg_iterator ArgI = CS.arg_begin(), ArgE = CS.arg_end();
   for (; AI != AE && ArgI != ArgE; ++AI, ++ArgI)
     if (isa<PointerType>(AI->getType())) {
index cb6b05ca4ec6758618dc4f7e1d78445db3ba45aa..e37a40ac663f0916b5cf8c49fc42300d4ef125f6 100644 (file)
@@ -62,7 +62,7 @@ bool FindUsedTypes::runOnModule(Module &m) {
   UsedTypes.clear();  // reset if run multiple times...
 
   // Loop over global variables, incorporating their types
-  for (Module::const_giterator I = m.gbegin(), E = m.gend(); I != E; ++I) {
+  for (Module::const_global_iterator I = m.global_begin(), E = m.global_end(); I != E; ++I) {
     IncorporateType(I->getType());
     if (I->hasInitializer())
       IncorporateValue(I->getInitializer());
index 4a97a8f037465d6cd55434b2587de745436230d5..6bf2698988aaa263604611f58574b18c047694d4 100644 (file)
@@ -159,7 +159,7 @@ void GlobalsModRef::AnalyzeGlobals(Module &M) {
       Readers.clear(); Writers.clear();
     }
 
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInternalLinkage()) {
       if (!AnalyzeUsesOfGlobal(I, Readers, Writers)) {
         // Remember that we are tracking this global, and the mod/ref fns
index 9da63641b212fc8e715c3978f3513761757782ed..eb79350eed7c2f7f765fb60d86fb1e22aa4fce44 100644 (file)
@@ -759,7 +759,7 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
   // Check to see if they called va_start but not va_arg..
   if (!ObsoleteVarArgs)
     if (Function *F = Result->getNamedFunction("llvm.va_start"))
-      if (F->asize() == 1) {
+      if (F->arg_size() == 1) {
         std::cerr << "WARNING: this file uses obsolete features.  "
                   << "Assemble and disassemble to update it.\n";
         ObsoleteVarArgs = true;
@@ -769,7 +769,7 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
     // If the user is making use of obsolete varargs intrinsics, adjust them for
     // the user.
     if (Function *F = Result->getNamedFunction("llvm.va_start")) {
-      assert(F->asize() == 1 && "Obsolete va_start takes 1 argument!");
+      assert(F->arg_size() == 1 && "Obsolete va_start takes 1 argument!");
 
       const Type *RetTy = F->getFunctionType()->getParamType(0);
       RetTy = cast<PointerType>(RetTy)->getElementType();
@@ -785,7 +785,7 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
     }
     
     if (Function *F = Result->getNamedFunction("llvm.va_end")) {
-      assert(F->asize() == 1 && "Obsolete va_end takes 1 argument!");
+      assert(F->arg_size() == 1 && "Obsolete va_end takes 1 argument!");
       const Type *ArgTy = F->getFunctionType()->getParamType(0);
       ArgTy = cast<PointerType>(ArgTy)->getElementType();
       Function *NF = Result->getOrInsertFunction("llvm.va_end", Type::VoidTy,
@@ -801,7 +801,7 @@ Module *llvm::RunVMAsmParser(const std::string &Filename, FILE *F) {
     }
 
     if (Function *F = Result->getNamedFunction("llvm.va_copy")) {
-      assert(F->asize() == 2 && "Obsolete va_copy takes 2 argument!");
+      assert(F->arg_size() == 2 && "Obsolete va_copy takes 2 argument!");
       const Type *ArgTy = F->getFunctionType()->getParamType(0);
       ArgTy = cast<PointerType>(ArgTy)->getElementType();
       Function *NF = Result->getOrInsertFunction("llvm.va_copy", ArgTy,
@@ -1623,7 +1623,7 @@ FunctionHeaderH : TypesV Name '(' ArgList ')' {
     
     // Make sure to strip off any argument names so we can't get conflicts.
     if (Fn->isExternal())
-      for (Function::aiterator AI = Fn->abegin(), AE = Fn->aend();
+      for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
            AI != AE; ++AI)
         AI->setName("");
 
@@ -1643,7 +1643,7 @@ FunctionHeaderH : TypesV Name '(' ArgList ')' {
       delete $4->back().first;
       $4->pop_back();  // Delete the last entry
     }
-    Function::aiterator ArgIt = Fn->abegin();
+    Function::arg_iterator ArgIt = Fn->arg_begin();
     for (std::vector<std::pair<PATypeHolder*, char*> >::iterator I =$4->begin();
          I != $4->end(); ++I, ++ArgIt) {
       delete I->first;                          // Delete the typeholder...
index 7eede0e1d4ddd005e88e15aab75de2bdf2231c58..974a3263aa9376f4eb19f12c383065689568f027 100644 (file)
@@ -536,7 +536,7 @@ unsigned BytecodeReader::insertValue(Value *Val, unsigned type,
 /// Insert the arguments of a function as new values in the reader.
 void BytecodeReader::insertArguments(Function* F) {
   const FunctionType *FT = F->getFunctionType();
-  Function::aiterator AI = F->abegin();
+  Function::arg_iterator AI = F->arg_begin();
   for (FunctionType::param_iterator It = FT->param_begin();
        It != FT->param_end(); ++It, ++AI)
     insertValue(AI, getTypeSlot(AI->getType()), FunctionValues);
index 449bf863816cdf19aa3126d58338751ed1794884..086409edc89c496b3ec63ced64d182f84fc8ecb1 100644 (file)
@@ -171,7 +171,7 @@ static ModuleProvider *CheckVarargs(ModuleProvider *MP) {
   // If the user is making use of obsolete varargs intrinsics, adjust them for
   // the user.
   if (Function *F = M->getNamedFunction("llvm.va_start")) {
-    assert(F->asize() == 1 && "Obsolete va_start takes 1 argument!");
+    assert(F->arg_size() == 1 && "Obsolete va_start takes 1 argument!");
         
     const Type *RetTy = F->getFunctionType()->getParamType(0);
     RetTy = cast<PointerType>(RetTy)->getElementType();
@@ -187,7 +187,7 @@ static ModuleProvider *CheckVarargs(ModuleProvider *MP) {
   }
 
   if (Function *F = M->getNamedFunction("llvm.va_end")) {
-    assert(F->asize() == 1 && "Obsolete va_end takes 1 argument!");
+    assert(F->arg_size() == 1 && "Obsolete va_end takes 1 argument!");
     const Type *ArgTy = F->getFunctionType()->getParamType(0);
     ArgTy = cast<PointerType>(ArgTy)->getElementType();
     Function *NF = M->getOrInsertFunction("llvm.va_end", Type::VoidTy,
@@ -203,7 +203,7 @@ static ModuleProvider *CheckVarargs(ModuleProvider *MP) {
   }
       
   if (Function *F = M->getNamedFunction("llvm.va_copy")) {
-    assert(F->asize() == 2 && "Obsolete va_copy takes 2 argument!");
+    assert(F->arg_size() == 2 && "Obsolete va_copy takes 2 argument!");
     const Type *ArgTy = F->getFunctionType()->getParamType(0);
     ArgTy = cast<PointerType>(ArgTy)->getElementType();
     Function *NF = M->getOrInsertFunction("llvm.va_copy", ArgTy,
@@ -330,7 +330,7 @@ bool llvm::GetBytecodeDependentLibraries(const std::string &fname,
 
 static void getSymbols(Module*M, std::vector<std::string>& symbols) {
   // Loop over global variables
-  for (Module::giterator GI = M->gbegin(), GE=M->gend(); GI != GE; ++GI)
+  for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI)
     if (!GI->isExternal() && !GI->hasInternalLinkage())
       if (!GI->getName().empty())
         symbols.push_back(GI->getName());
index 4a95c7b80f9f2017ce1ec1c7345fc710814a4b9b..d1af03eae47184633ba644c167943c9f524c8cde 100644 (file)
@@ -121,7 +121,7 @@ void SlotCalculator::processModule() {
 
   // Add all of the global variables to the value table...
   //
-  for (Module::const_giterator I = TheModule->gbegin(), E = TheModule->gend();
+  for (Module::const_global_iterator I = TheModule->global_begin(), E = TheModule->global_end();
        I != E; ++I)
     getOrCreateSlot(I);
 
@@ -134,7 +134,7 @@ void SlotCalculator::processModule() {
 
   // Add all of the module level constants used as initializers
   //
-  for (Module::const_giterator I = TheModule->gbegin(), E = TheModule->gend();
+  for (Module::const_global_iterator I = TheModule->global_begin(), E = TheModule->global_end();
        I != E; ++I)
     if (I->hasInitializer())
       getOrCreateSlot(I->getInitializer());
@@ -285,7 +285,7 @@ void SlotCalculator::incorporateFunction(const Function *F) {
   ModuleTypeLevel = Types.size();
 
   // Iterate over function arguments, adding them to the value table...
-  for(Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for(Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     getOrCreateSlot(I);
 
   if ( !ModuleContainsAllFunctionConstants ) {
@@ -461,7 +461,7 @@ void SlotCalculator::buildCompactionTable(const Function *F) {
   }
 
   // Next, include any types used by function arguments.
-  for (Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     getOrCreateCompactionTableSlot(I->getType());
 
   // Next, find all of the types and values that are referred to by the
index 9862391b3acff16158c327bf1c8b92fb0becc75a..dcee8be32091be2403652ac6093b85c322c13469 100644 (file)
@@ -894,7 +894,7 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
   BytecodeBlock ModuleInfoBlock(BytecodeFormat::ModuleGlobalInfoBlockID, *this);
   
   // Output the types for the global variables in the module...
-  for (Module::const_giterator I = M->gbegin(), End = M->gend(); I != End;++I) {
+  for (Module::const_global_iterator I = M->global_begin(), End = M->global_end(); I != End;++I) {
     int Slot = Table.getSlot(I->getType());
     assert(Slot != -1 && "Module global vars is broken!");
 
index 0fe49ecedc3d1cc14ef233fe0af9ef6c9c9da6ef..3633f966f90f695c35aee2d62dc1c96db75cf3ba 100644 (file)
@@ -87,28 +87,28 @@ void DefaultIntrinsicLowering::AddPrototypes(Module &M) {
       switch (I->getIntrinsicID()) {
       default: break;
       case Intrinsic::setjmp:
-        EnsureFunctionExists(M, "setjmp", I->abegin(), I->aend(), Type::IntTy);
+        EnsureFunctionExists(M, "setjmp", I->arg_begin(), I->arg_end(), Type::IntTy);
         break;
       case Intrinsic::longjmp:
-        EnsureFunctionExists(M, "longjmp", I->abegin(), I->aend(),Type::VoidTy);
+        EnsureFunctionExists(M, "longjmp", I->arg_begin(), I->arg_end(),Type::VoidTy);
         break;
       case Intrinsic::siglongjmp:
-        EnsureFunctionExists(M, "abort", I->aend(), I->aend(), Type::VoidTy);
+        EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(), Type::VoidTy);
         break;
       case Intrinsic::memcpy:
-        EnsureFunctionExists(M, "memcpy", I->abegin(), --I->aend(),
-                             I->abegin()->getType());
+        EnsureFunctionExists(M, "memcpy", I->arg_begin(), --I->arg_end(),
+                             I->arg_begin()->getType());
         break;
       case Intrinsic::memmove:
-        EnsureFunctionExists(M, "memmove", I->abegin(), --I->aend(),
-                             I->abegin()->getType());
+        EnsureFunctionExists(M, "memmove", I->arg_begin(), --I->arg_end(),
+                             I->arg_begin()->getType());
         break;
       case Intrinsic::memset:
-        EnsureFunctionExists(M, "memset", I->abegin(), --I->aend(),
-                             I->abegin()->getType());
+        EnsureFunctionExists(M, "memset", I->arg_begin(), --I->arg_end(),
+                             I->arg_begin()->getType());
         break;
       case Intrinsic::isunordered:
-        EnsureFunctionExists(M, "isunordered", I->abegin(), I->aend(), Type::BoolTy);
+        EnsureFunctionExists(M, "isunordered", I->arg_begin(), I->arg_end(), Type::BoolTy);
         break;
       }
 
index 565a342ef41ae2083d0ce2e098719c1037563f89..48574da388e57d9f95b47bb4c37ad3e41704270e 100644 (file)
@@ -128,7 +128,7 @@ FunctionLoweringInfo::FunctionLoweringInfo(TargetLowering &tli,
   // Initialize the mapping of values to registers.  This is only set up for
   // instruction values that are used outside of the block that defines
   // them.
-  for (Function::aiterator AI = Fn.abegin(), E = Fn.aend(); AI != E; ++AI)
+  for (Function::arg_iterator AI = Fn.arg_begin(), E = Fn.arg_end(); AI != E; ++AI)
     InitializeRegForValue(AI);
 
   Function::iterator BB = Fn.begin(), E = Fn.end();
@@ -881,7 +881,7 @@ LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL,
     // anything special.
     if (OldRoot != SDL.DAG.getRoot()) {
       unsigned a = 0;
-      for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI,++a)
+      for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI,++a)
         if (!AI->use_empty()) {
           SDL.setValue(AI, Args[a]);
           SDOperand Copy = 
@@ -892,7 +892,7 @@ LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL,
       // Otherwise, if any argument is only accessed in a single basic block,
       // emit that argument only to that basic block.
       unsigned a = 0;
-      for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI,++a)
+      for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI,++a)
         if (!AI->use_empty()) {
           if (BasicBlock *BBU = IsOnlyUsedInOneBasicBlock(AI)) {
             FuncInfo.BlockLocalArguments.insert(std::make_pair(BBU,
index f594827a8ead871c1df89d2187c927603cef04b2..05134019aa441a42b2b1040b7fd00370f83ddd16 100644 (file)
@@ -494,7 +494,7 @@ void ExecutionEngine::emitGlobals() {
   
   // Loop over all of the global variables in the program, allocating the memory
   // to hold them.
-  for (Module::const_giterator I = getModule().gbegin(), E = getModule().gend();
+  for (Module::const_global_iterator I = getModule().global_begin(), E = getModule().global_end();
        I != E; ++I)
     if (!I->isExternal()) {
       // Get the type of the global...
@@ -518,7 +518,7 @@ void ExecutionEngine::emitGlobals() {
   
   // Now that all of the globals are set up in memory, loop through them all and
   // initialize their contents.
-  for (Module::const_giterator I = getModule().gbegin(), E = getModule().gend();
+  for (Module::const_global_iterator I = getModule().global_begin(), E = getModule().global_end();
        I != E; ++I)
     if (!I->isExternal())
       EmitGlobalVariable(I);
index 9037ab64103d41498bed4a9c91d74b8914c2f90f..ff356796f3a27b166fc2590c734c1d587345e1bb 100644 (file)
@@ -1065,13 +1065,13 @@ void Interpreter::callFunction(Function *F,
   StackFrame.CurInst   = StackFrame.CurBB->begin();
 
   // Run through the function arguments and initialize their values...
-  assert((ArgVals.size() == F->asize() ||
-         (ArgVals.size() > F->asize() && F->getFunctionType()->isVarArg())) &&
+  assert((ArgVals.size() == F->arg_size() ||
+         (ArgVals.size() > F->arg_size() && F->getFunctionType()->isVarArg())) &&
          "Invalid number of values passed to function invocation!");
 
   // Handle non-varargs arguments...
   unsigned i = 0;
-  for (Function::aiterator AI = F->abegin(), E = F->aend(); AI != E; ++AI, ++i)
+  for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI, ++i)
     SetValue(AI, ArgVals[i], StackFrame);
 
   // Handle varargs arguments...
index 99f3a1b60d28497fcb3d6a7d3a50d85da48789f5..fcd2cf8b999900f3de34986b1346cd22aa7b12ee 100644 (file)
@@ -33,7 +33,7 @@ GetAllDefinedSymbols(Module *M, std::set<std::string> &DefinedSymbols) {
   for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
     if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage())
       DefinedSymbols.insert(I->getName());
-  for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+  for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
     if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage())
       DefinedSymbols.insert(I->getName());
 }
@@ -62,7 +62,7 @@ GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
       else if (!I->hasInternalLinkage())
         DefinedSymbols.insert(I->getName());
     }
-  for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+  for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
     if (I->hasName()) {
       if (I->isExternal())
         UndefinedSymbols.insert(I->getName());
index 0d65ddd1dd9564c6e71d326fe746cc99a7d349b7..627a38cd0f4fc20346826379589bf12ac70d8f08 100644 (file)
@@ -425,7 +425,7 @@ static bool LinkGlobals(Module *Dest, Module *Src,
   SymbolTable *ST = (SymbolTable*)&Dest->getSymbolTable();
   
   // Loop over all of the globals in the src module, mapping them over as we go
-  for (Module::giterator I = Src->gbegin(), E = Src->gend(); I != E; ++I) {
+  for (Module::global_iterator I = Src->global_begin(), E = Src->global_end(); I != E; ++I) {
     GlobalVariable *SGV = I;
     GlobalVariable *DGV = 0;
     // Check to see if may have to link the global.
@@ -533,7 +533,7 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src,
                             std::string *Err) {
 
   // Loop over all of the globals in the src module, mapping them over as we go
-  for (Module::const_giterator I = Src->gbegin(), E = Src->gend(); I != E; ++I){
+  for (Module::const_global_iterator I = Src->global_begin(), E = Src->global_end(); I != E; ++I){
     const GlobalVariable *SGV = I;
 
     if (SGV->hasInitializer()) {      // Only process initialized GV's
@@ -656,8 +656,8 @@ static bool LinkFunctionBody(Function *Dest, Function *Src,
   assert(Src && Dest && Dest->isExternal() && !Src->isExternal());
 
   // Go through and convert function arguments over, remembering the mapping.
-  Function::aiterator DI = Dest->abegin();
-  for (Function::aiterator I = Src->abegin(), E = Src->aend();
+  Function::arg_iterator DI = Dest->arg_begin();
+  for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
        I != E; ++I, ++DI) {
     DI->setName(I->getName());  // Copy the name information over...
 
@@ -681,7 +681,7 @@ static bool LinkFunctionBody(Function *Dest, Function *Src,
           *OI = RemapOperand(*OI, GlobalMap);
 
   // There is no need to map the arguments anymore.
-  for (Function::aiterator I = Src->abegin(), E = Src->aend(); I != E; ++I)
+  for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end(); I != E; ++I)
     GlobalMap.erase(I);
 
   return false;
@@ -854,7 +854,7 @@ Linker::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) {
   // it's functionality here.
   std::map<std::string, GlobalValue*> GlobalsByName;
 
-  for (Module::giterator I = Dest->gbegin(), E = Dest->gend(); I != E; ++I) {
+  for (Module::global_iterator I = Dest->global_begin(), E = Dest->global_end(); I != E; ++I) {
     // Add all of the appending globals already in the Dest module to
     // AppendingVars.
     if (I->hasAppendingLinkage())
index 8031d1747f955bc16bc29c84a1a6bdae7c1e6367..500f8b1ff56b4b2169a23625eec78a48e9fbf67a 100644 (file)
@@ -241,7 +241,7 @@ bool AlphaAsmPrinter::doFinalization(Module &M) {
   const TargetData &TD = TM.getTargetData();
   std::string CurSection;
   
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
       O << "\n\n";
       std::string name = Mang->getValueName(I);
index 5db6afe87d94a143422c997892fa52f1afb3227d..99bb9b9963f993488057a4390adbda10980c381d 100644 (file)
@@ -146,7 +146,7 @@ AlphaTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG)
 
   int count = 0;
 
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
   {
     SDOperand newroot, argt;
     if (count  < 6) {
index 111468f023752ae3201656aeff9257a2983460db..d010509bbb5130e4407001ef71dabd3befb7e5b8 100644 (file)
@@ -851,9 +851,9 @@ bool CWriter::doInitialization(Module &M) {
   printModuleTypes(M.getSymbolTable());
 
   // Global variable declarations...
-  if (!M.gempty()) {
+  if (!M.global_empty()) {
     Out << "\n/* External Global Variable Declarations */\n";
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
       if (I->hasExternalLinkage()) {
         Out << "extern ";
         printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
@@ -878,9 +878,9 @@ bool CWriter::doInitialization(Module &M) {
   }
 
   // Output the global variable declarations
-  if (!M.gempty()) {
+  if (!M.global_empty()) {
     Out << "\n\n/* Global Variable Declarations */\n";
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
       if (!I->isExternal()) {
         if (I->hasInternalLinkage())
           Out << "static ";
@@ -897,9 +897,9 @@ bool CWriter::doInitialization(Module &M) {
   }
 
   // Output the global variable definitions and contents...
-  if (!M.gempty()) {
+  if (!M.global_empty()) {
     Out << "\n\n/* Global Variable Definitions and Initialization */\n";
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
       if (!I->isExternal()) {
         if (I->hasInternalLinkage())
           Out << "static ";
@@ -1075,12 +1075,12 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
   FunctionInnards << Mang->getValueName(F) << '(';
     
   if (!F->isExternal()) {
-    if (!F->aempty()) {
+    if (!F->arg_empty()) {
       std::string ArgName;
-      if (F->abegin()->hasName() || !Prototype)
-        ArgName = Mang->getValueName(F->abegin());
-      printType(FunctionInnards, F->afront().getType(), ArgName);
-      for (Function::const_aiterator I = ++F->abegin(), E = F->aend();
+      if (F->arg_begin()->hasName() || !Prototype)
+        ArgName = Mang->getValueName(F->arg_begin());
+      printType(FunctionInnards, F->arg_front().getType(), ArgName);
+      for (Function::const_arg_iterator I = ++F->arg_begin(), E = F->arg_end();
            I != E; ++I) {
         FunctionInnards << ", ";
         if (I->hasName() || !Prototype)
@@ -1466,13 +1466,13 @@ void CWriter::visitCallInst(CallInst &I) {
         
         Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
         // Output the last argument to the enclosing function...
-        if (I.getParent()->getParent()->aempty()) {
+        if (I.getParent()->getParent()->arg_empty()) {
           std::cerr << "The C backend does not currently support zero "
                     << "argument varargs functions, such as '"
                     << I.getParent()->getParent()->getName() << "'!\n";
           abort();
         }
-        writeOperand(&I.getParent()->getParent()->aback());
+        writeOperand(&I.getParent()->getParent()->arg_back());
         Out << ')';
         return;
       case Intrinsic::vaend:
index 111468f023752ae3201656aeff9257a2983460db..d010509bbb5130e4407001ef71dabd3befb7e5b8 100644 (file)
@@ -851,9 +851,9 @@ bool CWriter::doInitialization(Module &M) {
   printModuleTypes(M.getSymbolTable());
 
   // Global variable declarations...
-  if (!M.gempty()) {
+  if (!M.global_empty()) {
     Out << "\n/* External Global Variable Declarations */\n";
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
       if (I->hasExternalLinkage()) {
         Out << "extern ";
         printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
@@ -878,9 +878,9 @@ bool CWriter::doInitialization(Module &M) {
   }
 
   // Output the global variable declarations
-  if (!M.gempty()) {
+  if (!M.global_empty()) {
     Out << "\n\n/* Global Variable Declarations */\n";
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
       if (!I->isExternal()) {
         if (I->hasInternalLinkage())
           Out << "static ";
@@ -897,9 +897,9 @@ bool CWriter::doInitialization(Module &M) {
   }
 
   // Output the global variable definitions and contents...
-  if (!M.gempty()) {
+  if (!M.global_empty()) {
     Out << "\n\n/* Global Variable Definitions and Initialization */\n";
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
       if (!I->isExternal()) {
         if (I->hasInternalLinkage())
           Out << "static ";
@@ -1075,12 +1075,12 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
   FunctionInnards << Mang->getValueName(F) << '(';
     
   if (!F->isExternal()) {
-    if (!F->aempty()) {
+    if (!F->arg_empty()) {
       std::string ArgName;
-      if (F->abegin()->hasName() || !Prototype)
-        ArgName = Mang->getValueName(F->abegin());
-      printType(FunctionInnards, F->afront().getType(), ArgName);
-      for (Function::const_aiterator I = ++F->abegin(), E = F->aend();
+      if (F->arg_begin()->hasName() || !Prototype)
+        ArgName = Mang->getValueName(F->arg_begin());
+      printType(FunctionInnards, F->arg_front().getType(), ArgName);
+      for (Function::const_arg_iterator I = ++F->arg_begin(), E = F->arg_end();
            I != E; ++I) {
         FunctionInnards << ", ";
         if (I->hasName() || !Prototype)
@@ -1466,13 +1466,13 @@ void CWriter::visitCallInst(CallInst &I) {
         
         Out << "va_start(*(va_list*)&" << Mang->getValueName(&I) << ", ";
         // Output the last argument to the enclosing function...
-        if (I.getParent()->getParent()->aempty()) {
+        if (I.getParent()->getParent()->arg_empty()) {
           std::cerr << "The C backend does not currently support zero "
                     << "argument varargs functions, such as '"
                     << I.getParent()->getParent()->getName() << "'!\n";
           abort();
         }
-        writeOperand(&I.getParent()->getParent()->aback());
+        writeOperand(&I.getParent()->getParent()->arg_back());
         Out << ')';
         return;
       case Intrinsic::vaend:
index 38e51abf03ff62ba10728145bea1fb4726aa9b86..e68d6c5419ce56fb9b90932982dd684ab88ab58d 100644 (file)
@@ -734,7 +734,7 @@ void PPC32ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
     
   MachineFrameInfo *MFI = F->getFrameInfo();
  
-  for (Function::aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
+  for (Function::arg_iterator I = Fn.arg_begin(), E = Fn.arg_end(); I != E; ++I) {
     bool ArgLive = !I->use_empty();
     unsigned Reg = ArgLive ? getReg(*I) : 0;
     int FI;          // Frame object index
index a4d545b21a217d84fde5d95ccdda99e7deb14f06..9fe3422383854f83120f5aaf2fc7a9174bbfb527 100644 (file)
@@ -590,7 +590,7 @@ void PPC64ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
     
   MachineFrameInfo *MFI = F->getFrameInfo();
  
-  for (Function::aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
+  for (Function::arg_iterator I = Fn.arg_begin(), E = Fn.arg_end(); I != E; ++I) {
     bool ArgLive = !I->use_empty();
     unsigned Reg = ArgLive ? getReg(*I) : 0;
     int FI;          // Frame object index
index 48eddb9527a0ccd332627fc8bad7c91e4ccf2f02..a50a437893bcb06efd84105926fb6f1c09631550 100644 (file)
@@ -459,7 +459,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
   std::string CurSection;
 
   // Print out module-level global variables here.
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
       O << '\n';
       std::string name = Mang->getValueName(I);
@@ -646,7 +646,7 @@ bool AIXAsmPrinter::doInitialization(Module &M) {
     << "\t.csect .text[PR]\n";
 
   // Print out module-level global variables
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
     if (!I->hasInitializer())
       continue;
  
@@ -664,8 +664,8 @@ bool AIXAsmPrinter::doInitialization(Module &M) {
   }
 
   // Output labels for globals
-  if (M.gbegin() != M.gend()) O << "\t.toc\n";
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+  if (M.global_begin() != M.global_end()) O << "\t.toc\n";
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
     const GlobalVariable *GV = I;
     // Do not output labels for unused variables
     if (GV->isExternal() && GV->use_begin() == GV->use_end())
@@ -687,7 +687,7 @@ bool AIXAsmPrinter::doInitialization(Module &M) {
 bool AIXAsmPrinter::doFinalization(Module &M) {
   const TargetData &TD = TM.getTargetData();
   // Print out module-level global variables
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
     if (I->hasInitializer() || I->hasExternalLinkage())
       continue;
 
index 432aa2c59498c2bafc74e1b0387f8e3087b64510..71210536e79a0c5c57eaca4706dd53eccf477639 100644 (file)
@@ -580,7 +580,7 @@ bool V8Printer::doFinalization(Module &M) {
   std::string CurSection;
 
   // Print out module-level global variables here.
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
       O << "\n\n";
       std::string name = Mang->getValueName(I);
index 9de3a888e7c0d92964ceac3d3746e5a24ddab154..633236883da8edb4c33af2cdf5e57efa3825ad53 100644 (file)
@@ -335,7 +335,7 @@ void V8ISel::LoadArgumentsToVirtualRegs (Function *LF) {
 
   // Add IMPLICIT_DEFs of input regs.
   unsigned ArgNo = 0;
-  for (Function::aiterator I = LF->abegin(), E = LF->aend();
+  for (Function::arg_iterator I = LF->arg_begin(), E = LF->arg_end();
        I != E && ArgNo < 6; ++I, ++ArgNo) {
     switch (getClassB(I->getType())) {
     case cByte:
@@ -382,7 +382,7 @@ void V8ISel::LoadArgumentsToVirtualRegs (Function *LF) {
   }
 
   // Copy args out of their incoming hard regs or stack slots into virtual regs.
-  for (Function::aiterator I = LF->abegin(), E = LF->aend(); I != E; ++I) {
+  for (Function::arg_iterator I = LF->arg_begin(), E = LF->arg_end(); I != E; ++I) {
     Argument &A = *I;
     unsigned ArgReg = getReg (A);
     if (getClassB (A.getType ()) < cLong) {
index 432aa2c59498c2bafc74e1b0387f8e3087b64510..71210536e79a0c5c57eaca4706dd53eccf477639 100644 (file)
@@ -580,7 +580,7 @@ bool V8Printer::doFinalization(Module &M) {
   std::string CurSection;
 
   // Print out module-level global variables here.
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
       O << "\n\n";
       std::string name = Mang->getValueName(I);
index 9de3a888e7c0d92964ceac3d3746e5a24ddab154..633236883da8edb4c33af2cdf5e57efa3825ad53 100644 (file)
@@ -335,7 +335,7 @@ void V8ISel::LoadArgumentsToVirtualRegs (Function *LF) {
 
   // Add IMPLICIT_DEFs of input regs.
   unsigned ArgNo = 0;
-  for (Function::aiterator I = LF->abegin(), E = LF->aend();
+  for (Function::arg_iterator I = LF->arg_begin(), E = LF->arg_end();
        I != E && ArgNo < 6; ++I, ++ArgNo) {
     switch (getClassB(I->getType())) {
     case cByte:
@@ -382,7 +382,7 @@ void V8ISel::LoadArgumentsToVirtualRegs (Function *LF) {
   }
 
   // Copy args out of their incoming hard regs or stack slots into virtual regs.
-  for (Function::aiterator I = LF->abegin(), E = LF->aend(); I != E; ++I) {
+  for (Function::arg_iterator I = LF->arg_begin(), E = LF->arg_end(); I != E; ++I) {
     Argument &A = *I;
     unsigned ArgReg = getReg (A);
     if (getClassB (A.getType ()) < cLong) {
index 8df3dc390a4644e3898f6bfdb6657f97f0060a90..280c836f338c47a3c85a0aa5b8e61566c7f1a778 100644 (file)
@@ -52,7 +52,7 @@ bool InternalGlobalMapper::runOnModule(Module &M) {
   GVVectorTy gvvector;
 
   // Populate the vector with internal global values and their names.
-  for (Module::giterator i = M.gbegin (), e = M.gend (); i != e; ++i)
+  for (Module::global_iterator i = M.global_begin (), e = M.global_end (); i != e; ++i)
     maybeAddInternalValueToVector (gvvector, *i);
   // Add an extra global for _llvm_internalGlobals itself (null,
   // because it's not internal)
index 190e0c57af6d92a8474aaee4c85d8885bf212357..6da3e0f524e6542d27815f1d642d54f9595767b3 100644 (file)
@@ -150,7 +150,7 @@ void LiveRangeInfo::constructLiveRanges() {
 
   // first find the live ranges for all incoming args of the function since
   // those LRs start from the start of the function
-  for (Function::const_aiterator AI = Meth->abegin(); AI != Meth->aend(); ++AI)
+  for (Function::const_arg_iterator AI = Meth->arg_begin(); AI != Meth->arg_end(); ++AI)
     createNewLiveRange(AI, /*isCC*/ false);
 
   // Now suggest hardware registers for these function args 
index 6a1710ef544daaa409d5aab5aa93a4bb18599b5c..adb7d284af4a07729e39f97040866a3372b2d37c 100644 (file)
@@ -317,7 +317,7 @@ void PhyRegAlloc::addInterferencesForArgs() {
   // get the InSet of root BB
   const ValueSet &InSet = LVI->getInSetOfBB(&Fn->front());  
 
-  for (Function::const_aiterator AI = Fn->abegin(); AI != Fn->aend(); ++AI) {
+  for (Function::const_arg_iterator AI = Fn->arg_begin(); AI != Fn->arg_end(); ++AI) {
     // add interferences between args and LVars at start 
     addInterference(AI, &InSet, false);
     
@@ -1148,7 +1148,7 @@ void PhyRegAlloc::saveState () {
   std::vector<AllocInfo> &state = FnAllocState[Fn];
   unsigned ArgNum = 0;
   // Arguments encoded as instruction # -1
-  for (Function::const_aiterator i=Fn->abegin (), e=Fn->aend (); i != e; ++i) {
+  for (Function::const_arg_iterator i=Fn->arg_begin (), e=Fn->arg_end (); i != e; ++i) {
     const Argument *Arg = &*i;
     saveStateForValue (state, Arg, -1, ArgNum);
     ++ArgNum;
index d6c401a3e6a869f4e41d9e5631663c640b6d12eb..c410a4baf7d08f98025579c38be989ce74e035ff 100644 (file)
@@ -768,7 +768,7 @@ void SparcV9AsmPrinter::printGlobalVariable(const GlobalVariable* GV) {
 
 void SparcV9AsmPrinter::emitGlobals(const Module &M) {
   // Output global variables...
-  for (Module::const_giterator GI = M.gbegin(), GE = M.gend(); GI != GE; ++GI)
+  for (Module::const_global_iterator GI = M.global_begin(), GE = M.global_end(); GI != GE; ++GI)
     if (! GI->isExternal()) {
       assert(GI->hasInitializer());
       if (GI->isConstant())
index 948276b102fd1157737303e98834feec117a108d..8a827187aee650e9936a9046d0811a622d9d9367 100644 (file)
@@ -374,7 +374,7 @@ void SparcV9RegInfo::suggestRegs4MethodArgs(const Function *Meth,
   // Count the arguments, *ignoring* whether they are int or FP args.
   // Use this common arg numbering to pick the right int or fp register.
   unsigned argNo=0;
-  for(Function::const_aiterator I = Meth->abegin(), E = Meth->aend();
+  for(Function::const_arg_iterator I = Meth->arg_begin(), E = Meth->arg_end();
       I != E; ++I, ++argNo) {
     LiveRange *LR = LRI.getLiveRangeForValue(I);
     assert(LR && "No live range found for method arg");
@@ -410,7 +410,7 @@ void SparcV9RegInfo::colorMethodArgs(const Function *Meth,
   // for each argument
   // for each argument.  count INT and FP arguments separately.
   unsigned argNo=0, intArgNo=0, fpArgNo=0;
-  for(Function::const_aiterator I = Meth->abegin(), E = Meth->aend();
+  for(Function::const_arg_iterator I = Meth->arg_begin(), E = Meth->arg_end();
       I != E; ++I, ++argNo) {
     // get the LR of arg
     LiveRange *LR = LRI.getLiveRangeForValue(I);
index c7926320badc35c95d02a7898d509ad9975a18a1..24e92ed30532e9df65888727a2a34f77cc66954c 100644 (file)
@@ -123,7 +123,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
   std::string CurSection;
 
   // Print out module-level global variables here.
-  for (Module::const_giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (I->hasInitializer()) {   // External global require no code
       O << "\n\n";
       std::string name = Mang->getValueName(I);
index e673bb5038859a50fecbcd77c003107ad5a70fe3..9b68ad8b02d15c5e79a84d2a6204bec8ea0fa529 100644 (file)
@@ -117,7 +117,7 @@ X86TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
   MachineFrameInfo *MFI = MF.getFrameInfo();
   
   unsigned ArgOffset = 0;   // Frame mechanisms handle retaddr slot
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I) {
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
     MVT::ValueType ObjectVT = getValueType(I->getType());
     unsigned ArgIncrement = 4;
     unsigned ObjSize;
index 9c9dac30c5bb4fc07bd005b109a52d708888e0b5..a40658946fc809570258a292fb13ee6be0c5e7ef 100644 (file)
@@ -618,7 +618,7 @@ void X86ISel::LoadArgumentsToVirtualRegs(Function &Fn) {
   unsigned ArgOffset = 0;   // Frame mechanisms handle retaddr slot
   MachineFrameInfo *MFI = F->getFrameInfo();
 
-  for (Function::aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
+  for (Function::arg_iterator I = Fn.arg_begin(), E = Fn.arg_end(); I != E; ++I) {
     bool ArgLive = !I->use_empty();
     unsigned Reg = ArgLive ? getReg(*I) : 0;
     int FI;          // Frame object index
index a582f3b0185ba3ecb0a90fb077bbc306b26f133d..87a8f02601776e4e92b76510ac36300b9ac7baab 100644 (file)
@@ -106,7 +106,7 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
 
   // First check: see if there are any pointer arguments!  If not, quick exit.
   std::vector<Argument*> PointerArgs;
-  for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     if (isa<PointerType>(I->getType()))
       PointerArgs.push_back(I);
   if (PointerArgs.empty()) return false;
@@ -163,7 +163,7 @@ static bool IsAlwaysValidPointer(Value *V) {
 static bool AllCalleesPassInValidPointerForArgument(Argument *Arg) {
   Function *Callee = Arg->getParent();
 
-  unsigned ArgNo = std::distance(Callee->abegin(), Function::aiterator(Arg));
+  unsigned ArgNo = std::distance(Callee->arg_begin(), Function::arg_iterator(Arg));
 
   // Look at all call sites of the function.  At this pointer we know we only
   // have direct callees.
@@ -347,7 +347,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
   // what the new GEP/Load instructions we are inserting look like.
   std::map<std::vector<Value*>, LoadInst*> OriginalLoads;
 
-  for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     if (!ArgsToPromote.count(I)) {
       Params.push_back(I->getType());
     } else if (I->use_empty()) {
@@ -411,7 +411,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
     // Loop over the operands, inserting GEP and loads in the caller as
     // appropriate.
     CallSite::arg_iterator AI = CS.arg_begin();
-    for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I, ++AI)
+    for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I, ++AI)
       if (!ArgsToPromote.count(I))
         Args.push_back(*AI);          // Unmodified argument
       else if (!I->use_empty()) {
@@ -470,7 +470,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
   // Loop over the argument list, transfering uses of the old arguments over to
   // the new arguments, also transfering over the names as well.
   //
-  for (Function::aiterator I = F->abegin(), E = F->aend(), I2 = NF->abegin();
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(), I2 = NF->arg_begin();
        I != E; ++I)
     if (!ArgsToPromote.count(I)) {
       // If this is an unmodified argument, move the name and users over to the
@@ -502,7 +502,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
           std::vector<Value*> Operands(GEP->op_begin()+1, GEP->op_end());
 
           unsigned ArgNo = 0;
-          Function::aiterator TheArg = I2;
+          Function::arg_iterator TheArg = I2;
           for (ScalarizeTable::iterator It = ArgIndices.begin();
                *It != Operands; ++It, ++TheArg) {
             assert(It != ArgIndices.end() && "GEP not handled??");
@@ -539,7 +539,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
 
   // Notify the alias analysis implementation that we inserted a new argument.
   if (ExtraArgHack)
-    AA.copyValue(Constant::getNullValue(Type::IntTy), NF->abegin());
+    AA.copyValue(Constant::getNullValue(Type::IntTy), NF->arg_begin());
 
 
   // Tell the alias analysis that the old function is about to disappear.
index 27e1955ab284a7752790067d93ada23a4703b5c6..0140228b63a33a3e630270da59a2992264d707ca 100644 (file)
@@ -56,7 +56,7 @@ bool ConstantMerge::runOnModule(Module &M) {
     // because doing so may cause initializers of other globals to be rewritten,
     // invalidating the Constant* pointers in CMap.
     //
-    for (Module::giterator GV = M.gbegin(), E = M.gend(); GV != E; ++GV)
+    for (Module::global_iterator GV = M.global_begin(), E = M.global_end(); GV != E; ++GV)
       // Only process constants with initializers
       if (GV->isConstant() && GV->hasInitializer()) {
         Constant *Init = GV->getInitializer();
index e4b7a3ee6120137b792709c12e0abade6efdc73c..e226dc3311626b523a8b2ee89001866dba375ead 100644 (file)
@@ -210,7 +210,7 @@ void DAE::SurveyFunction(Function &F) {
 
   if (FunctionIntrinsicallyLive) {
     DEBUG(std::cerr << "  Intrinsically live fn: " << F.getName() << "\n");
-    for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI)
+    for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI)
       LiveArguments.insert(AI);
     LiveRetVal.insert(&F);
     return;
@@ -230,7 +230,7 @@ void DAE::SurveyFunction(Function &F) {
   // if there are any arguments we assume that are dead.
   //
   bool AnyMaybeLiveArgs = false;
-  for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI)
+  for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI)
     switch (getArgumentLiveness(*AI)) {
     case Live:
       DEBUG(std::cerr << "    Arg live by use: " << AI->getName() << "\n");
@@ -284,7 +284,7 @@ bool DAE::isMaybeLiveArgumentNowLive(Argument *Arg) {
     // Loop over all of the arguments (because Arg may be passed into the call
     // multiple times) and check to see if any are now alive...
     CallSite::arg_iterator CSAI = CS.arg_begin();
-    for (Function::aiterator AI = Callee->abegin(), E = Callee->aend();
+    for (Function::arg_iterator AI = Callee->arg_begin(), E = Callee->arg_end();
          AI != E; ++AI, ++CSAI)
       // If this is the argument we are looking for, check to see if it's alive
       if (*CSAI == Arg && LiveArguments.count(AI))
@@ -309,7 +309,7 @@ void DAE::MarkArgumentLive(Argument *Arg) {
   // passed in to provide a value for this argument live as necessary.
   //
   Function *Fn = Arg->getParent();
-  unsigned ArgNo = std::distance(Fn->abegin(), Function::aiterator(Arg));
+  unsigned ArgNo = std::distance(Fn->arg_begin(), Function::arg_iterator(Arg));
 
   std::multimap<Function*, CallSite>::iterator I = CallSites.lower_bound(Fn);
   for (; I != CallSites.end() && I->first == Fn; ++I) {
@@ -373,7 +373,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
   const FunctionType *FTy = F->getFunctionType();
   std::vector<const Type*> Params;
 
-  for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     if (!DeadArguments.count(I))
       Params.push_back(I->getType());
 
@@ -410,7 +410,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
 
     // Loop over the operands, deleting dead ones...
     CallSite::arg_iterator AI = CS.arg_begin();
-    for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I, ++AI)
+    for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I, ++AI)
       if (!DeadArguments.count(I))      // Remove operands for dead arguments
         Args.push_back(*AI);
 
@@ -455,7 +455,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
   // the new arguments, also transfering over the names as well.  While we're at
   // it, remove the dead arguments from the DeadArguments list.
   //
-  for (Function::aiterator I = F->abegin(), E = F->aend(), I2 = NF->abegin();
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(), I2 = NF->arg_begin();
        I != E; ++I)
     if (!DeadArguments.count(I)) {
       // If this is a live argument, move the name and users over to the new
@@ -519,7 +519,7 @@ bool DAE::runOnModule(Module &M) {
       // live, then the return value of the called instruction is now live.
       //
       CallSite::arg_iterator AI = CS.arg_begin();  // ActualIterator
-      for (Function::aiterator FI = Callee->abegin(), E = Callee->aend();
+      for (Function::arg_iterator FI = Callee->arg_begin(), E = Callee->arg_end();
            FI != E; ++AI, ++FI) {
         // If this argument is another call...
         CallSite ArgCS = CallSite::get(*AI);
index 1b92fd1df8de9c0cf80c3af0e1a038bef81f18a3..482964e86f2c62fd7482340566111bff40cc47e8 100644 (file)
@@ -52,7 +52,7 @@ namespace {
       Named->setLinkage(GlobalValue::ExternalLinkage);
 
       // Mark all global variables internal
-      for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+      for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
         if (!I->isExternal()) {
           I->setInitializer(0);  // Make all variables external
           I->setLinkage(GlobalValue::ExternalLinkage);
index 090755b25cc0b0c77170f83e4c2c0040d4228878..dba44a0dc15674318b86bf4db42d9b61f7de1e29 100644 (file)
@@ -311,7 +311,7 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
       Globals[F->getName()].push_back(F);
   }
 
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ) {
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) {
     GlobalVariable *GV = I++;
     if (GV->use_empty() && GV->isExternal()) {
       M.getGlobalList().erase(GV);
@@ -343,7 +343,7 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
       ++I;
     }
 
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; )
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; )
     if (I->isExternal() && I->use_empty()) {
       GlobalVariable *GV = I;
       ++I;
index cdf994aeb48226fb25e576f99efd5c6fb2bd0052..b7fa5dc7b9edbea0cc19198048aca8c13ef4f57b 100644 (file)
@@ -60,7 +60,7 @@ bool GlobalDCE::runOnModule(Module &M) {
       GlobalIsNeeded(I);
   }
 
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) {
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) {
     Changed |= RemoveUnusedGlobalValue(*I);
     // Externally visible & appending globals are needed, if they have an
     // initializer.
@@ -76,7 +76,7 @@ bool GlobalDCE::runOnModule(Module &M) {
 
   // The first pass is to drop initializers of global variables which are dead.
   std::vector<GlobalVariable*> DeadGlobalVars;   // Keep track of dead globals
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     if (!AliveGlobals.count(I)) {
       DeadGlobalVars.push_back(I);         // Keep track of dead globals
       I->setInitializer(0);
index 754adc3949d51a403f1289b5e2f46b96f0e3d309..7b6f649a0acc09912e0337bc1436a0b5008845e8 100644 (file)
@@ -51,7 +51,7 @@ namespace {
     bool runOnModule(Module &M);
 
   private:
-    bool ProcessInternalGlobal(GlobalVariable *GV, Module::giterator &GVI);
+    bool ProcessInternalGlobal(GlobalVariable *GV, Module::global_iterator &GVI);
   };
 
   RegisterOpt<GlobalOpt> X("globalopt", "Global Variable Optimizer");
@@ -792,7 +792,7 @@ static bool ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Instruction *V,
 // OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge
 // that only one value (besides its initializer) is ever stored to the global.
 static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
-                                     Module::giterator &GVI, TargetData &TD) {
+                                     Module::global_iterator &GVI, TargetData &TD) {
   if (CastInst *CI = dyn_cast<CastInst>(StoredOnceVal))
     StoredOnceVal = CI->getOperand(0);
   else if (GetElementPtrInst *GEPI =dyn_cast<GetElementPtrInst>(StoredOnceVal)){
@@ -915,7 +915,7 @@ static void ShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
 /// ProcessInternalGlobal - Analyze the specified global variable and optimize
 /// it if possible.  If we make a change, return true.
 bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
-                                      Module::giterator &GVI) {
+                                      Module::global_iterator &GVI) {
   std::set<PHINode*> PHIUsers;
   GlobalStatus GS;
   PHIUsers.clear();
@@ -1063,7 +1063,7 @@ bool GlobalOpt::runOnModule(Module &M) {
   LocalChange = true;
   while (LocalChange) {
     LocalChange = false;
-    for (Module::giterator GVI = M.gbegin(), E = M.gend(); GVI != E;) {
+    for (Module::global_iterator GVI = M.global_begin(), E = M.global_end(); GVI != E;) {
       GlobalVariable *GV = GVI++;
       if (!GV->isConstant() && GV->hasInternalLinkage() &&
           GV->hasInitializer())
index 65d507798b77d6614270cdcc99e9da8712605384..16839edff78b13016773ff8f4b6b4fd0b9de1463 100644 (file)
@@ -69,10 +69,10 @@ bool IPCP::runOnModule(Module &M) {
 /// constant in for an argument, propagate that constant in as the argument.
 ///
 bool IPCP::PropagateConstantsIntoArguments(Function &F) {
-  if (F.aempty() || F.use_empty()) return false;  // No arguments?  Early exit.
+  if (F.arg_empty() || F.use_empty()) return false;  // No arguments?  Early exit.
 
   std::vector<std::pair<Constant*, bool> > ArgumentConstants;
-  ArgumentConstants.resize(F.asize());
+  ArgumentConstants.resize(F.arg_size());
 
   unsigned NumNonconstant = 0;
 
@@ -87,7 +87,7 @@ bool IPCP::PropagateConstantsIntoArguments(Function &F) {
       
       // Check out all of the potentially constant arguments
       CallSite::arg_iterator AI = CS.arg_begin();
-      Function::aiterator Arg = F.abegin();
+      Function::arg_iterator Arg = F.arg_begin();
       for (unsigned i = 0, e = ArgumentConstants.size(); i != e;
            ++i, ++AI, ++Arg) {
         if (*AI == &F) return false;  // Passes the function into itself
@@ -115,7 +115,7 @@ bool IPCP::PropagateConstantsIntoArguments(Function &F) {
 
   // If we got to this point, there is a constant argument!
   assert(NumNonconstant != ArgumentConstants.size());
-  Function::aiterator AI = F.abegin();
+  Function::arg_iterator AI = F.arg_begin();
   bool MadeChange = false;
   for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI)
     // Do we have a constant argument!?
index 5916f10402f3a2ab36852e2e2c204ed62b349ce0..4355c6c4a19faa95fa3823a7ae9d76c8a3f1fff6 100644 (file)
@@ -167,7 +167,7 @@ void FunctionInfo::analyzeFunction(Function *F) {
 
   // Check out all of the arguments to the function, figuring out how much
   // code can be eliminated if one of the arguments is a constant.
-  for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     ArgumentWeights.push_back(ArgInfo(CountCodeReductionForConstant(I),
                                       CountCodeReductionForAlloca(I)));
 }
index 5e436aa215900fb01e48b894712bc694bdfe0171..5a254fa687f308a18fc2341dcd5c1b8d99ed3e50 100644 (file)
@@ -93,7 +93,7 @@ namespace {
         }
 
       // Mark all global variables with initializers as internal as well...
-      for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+      for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
         if (!I->isExternal() && !I->hasInternalLinkage() &&
             !ExternalNames.count(I->getName())) {
           // Special case handling of the global ctor and dtor list.  When we
index 03ea55b41487f6fc4bdff45174a36fd0aca787e9..80fe394f61502955f2a08e2fd71adf0ef6995dc9 100644 (file)
@@ -75,7 +75,7 @@ bool StripSymbols::runOnModule(Module &M) {
   // If we're not just stripping debug info, strip all symbols from the
   // functions and the names from any internal globals.
   if (!OnlyDebugInfo) {
-    for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+    for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
       if (I->hasInternalLinkage())
         I->setName("");     // Internal symbols can't participate in linkage
 
index 1c0c4ada32fa8899cc770c8706e983af8980affb..5ce01427164c89d6f9d41b929ed46c9f56fc4fa9 100644 (file)
@@ -55,11 +55,11 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName,
   Instruction *InitCall = new CallInst(InitFn, Args, "newargc", InsertPos);
 
   // If argc or argv are not available in main, just pass null values in.
-  Function::aiterator AI;
-  switch (MainFn->asize()) {
+  Function::arg_iterator AI;
+  switch (MainFn->arg_size()) {
   default:
   case 2:
-    AI = MainFn->abegin(); ++AI;
+    AI = MainFn->arg_begin(); ++AI;
     if (AI->getType() != ArgVTy) {
       InitCall->setOperand(2, new CastInst(AI, ArgVTy, "argv.cast", InitCall));
     } else {
@@ -67,7 +67,7 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName,
     }
 
   case 1:
-    AI = MainFn->abegin();
+    AI = MainFn->arg_begin();
     // If the program looked at argc, have it look at the return value of the
     // init call instead.
     if (AI->getType() != Type::IntTy) {
index f645f1b451b0e2851102561174a3ee7df58e85cf..5be8637a20b8ddd0ddd5d1ebccb6e490f0444aae 100644 (file)
@@ -367,7 +367,7 @@ static inline void InsertCodeToShowFunctionEntry(Function &F, Function *Printf,
 
   // Now print all the incoming arguments
   unsigned ArgNo = 0;
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I, ++ArgNo){
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I, ++ArgNo){
     InsertVerbosePrintInst(I, &BB, InsertPos,
                            "  Arg #" + utostr(ArgNo) + ": ", Printf,
                            HashPtrToSeqNum);
index 6f115067941a13f9e0a665d347a513f8d0c50f76..da8c500e21017837c0b44d2bca052efb90cda96c 100644 (file)
@@ -757,7 +757,7 @@ void CEE::BuildRankMap(Function &F) {
   unsigned Rank = 1;  // Skip rank zero.
 
   // Number the arguments...
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
     RankMap[I] = Rank++;
 
   // Number the instructions in reverse post order...
index 533a9e8b23c96df449b324a4ccb8a4b63bfdb5ce..dbabe2686b5c636cd020ee2d85e5d09a98474114 100644 (file)
@@ -73,7 +73,7 @@ bool GCSE::runOnFunction(Function &F) {
   // Check for value numbers of arguments.  If the value numbering
   // implementation can prove that an incoming argument is a constant or global
   // value address, substitute it, making the argument dead.
-  for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI)
+  for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI)
     if (!AI->use_empty()) {
       VN.getEqualNumberNodes(AI, EqualValues);
       if (!EqualValues.empty()) {
index c74cf51ccc4df6c602dcfb4caef40f6fb1c30c7b..1972b9d5c33879fc03dbd9fb90acaed582efb065 100644 (file)
@@ -66,7 +66,7 @@ void Reassociate::BuildRankMap(Function &F) {
   unsigned i = 2;
 
   // Assign distinct ranks to function arguments
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I)
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
     ValueRankMap[I] = ++i;
 
   ReversePostOrderTraversal<Function*> RPOT(&F);
index c769b549916162707e7f0bb86768f89cbc36e793..cc0541284305fdf58237a397d51063a9162d488b 100644 (file)
@@ -865,7 +865,7 @@ void SCCPSolver::visitCallSite(CallSite CS) {
       MarkBlockExecutable(F->begin());
 
     CallSite::arg_iterator CAI = CS.arg_begin();
-    for (Function::aiterator AI = F->abegin(), E = F->aend();
+    for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
          AI != E; ++AI, ++CAI) {
       LatticeVal &IV = ValueState[AI];
       if (!IV.isOverdefined())
@@ -1044,7 +1044,7 @@ bool SCCP::runOnFunction(Function &F) {
 
   // Mark all arguments to the function as being overdefined.
   hash_map<Value*, LatticeVal> &Values = Solver.getValueMapping();
-  for (Function::aiterator AI = F.abegin(), E = F.aend(); AI != E; ++AI)
+  for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; ++AI)
     Values[AI].markOverdefined();
 
   // Solve for constants.
@@ -1173,7 +1173,7 @@ bool IPSCCP::runOnModule(Module &M) {
     if (!F->hasInternalLinkage() || AddressIsTaken(F)) {
       if (!F->isExternal())
         Solver.MarkBlockExecutable(F->begin());
-      for (Function::aiterator AI = F->abegin(), E = F->aend(); AI != E; ++AI)
+      for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI)
         Values[AI].markOverdefined();
     } else {
       Solver.AddTrackedFunction(F);
@@ -1182,7 +1182,7 @@ bool IPSCCP::runOnModule(Module &M) {
   // Loop over global variables.  We inform the solver about any internal global
   // variables that do not have their 'addresses taken'.  If they don't have
   // their addresses taken, we can propagate constants through them.
-  for (Module::giterator G = M.gbegin(), E = M.gend(); G != E; ++G)
+  for (Module::global_iterator G = M.global_begin(), E = M.global_end(); G != E; ++G)
     if (!G->isConstant() && G->hasInternalLinkage() && !AddressIsTaken(G))
       Solver.TrackValueOfGlobalVariable(G);
 
@@ -1204,7 +1204,7 @@ bool IPSCCP::runOnModule(Module &M) {
   //
   std::set<BasicBlock*> &ExecutableBBs = Solver.getExecutableBlocks();
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
-    for (Function::aiterator AI = F->abegin(), E = F->aend(); AI != E; ++AI)
+    for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI)
       if (!AI->use_empty()) {
         LatticeVal &IV = Values[AI];
         if (IV.isConstant() || IV.isUndefined()) {
index 758628ca64cd15cdac64c358cb377d47680d3597..bf098eb59b0cc71f0fc428479d7eb584630be4d4 100644 (file)
@@ -161,7 +161,7 @@ static bool isDynamicConstant(Value *V, CallInst *CI) {
     // Figure out which argument number this is...
     unsigned ArgNo = 0;
     Function *F = CI->getParent()->getParent();
-    for (Function::aiterator AI = F->abegin(); &*AI != Arg; ++AI)
+    for (Function::arg_iterator AI = F->arg_begin(); &*AI != Arg; ++AI)
       ++ArgNo;
     
     // If we are passing this argument into call as the corresponding
@@ -298,7 +298,7 @@ bool TailCallElim::ProcessReturningBlock(ReturnInst *Ret, BasicBlock *&OldEntry,
     // For now, we initialize each PHI to only have the real arguments
     // which are passed in.
     Instruction *InsertPos = OldEntry->begin();
-    for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I) {
+    for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) {
       PHINode *PN = new PHINode(I->getType(), I->getName()+".tr", InsertPos);
       I->replaceAllUsesWith(PN); // Everyone use the PHI node now!
       PN->addIncoming(I, NewEntry);
index 9bd8bf135fe50c88be77b810875564bd766d6857..6440851b9de3037f2ff76b77f52b0b86868c9b65 100644 (file)
@@ -49,7 +49,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
   assert(NameSuffix && "NameSuffix cannot be null!");
   
 #ifndef NDEBUG
-  for (Function::const_aiterator I = OldFunc->abegin(), E = OldFunc->aend();
+  for (Function::const_arg_iterator I = OldFunc->arg_begin(), E = OldFunc->arg_end();
        I != E; ++I)
     assert(ValueMap.count(I) && "No mapping from source argument specified!");
 #endif
@@ -95,7 +95,7 @@ Function *llvm::CloneFunction(const Function *F,
   // The user might be deleting arguments to the function by specifying them in
   // the ValueMap.  If so, we need to not add the arguments to the arg ty vector
   //
-  for (Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     if (ValueMap.count(I) == 0)  // Haven't mapped the argument to anything yet?
       ArgTypes.push_back(I->getType());
 
@@ -107,8 +107,8 @@ Function *llvm::CloneFunction(const Function *F,
   Function *NewF = new Function(FTy, F->getLinkage(), F->getName());
   
   // Loop over the arguments, copying the names of the mapped arguments over...
-  Function::aiterator DestI = NewF->abegin();
-  for (Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  Function::arg_iterator DestI = NewF->arg_begin();
+  for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     if (ValueMap.count(I) == 0) {   // Is this argument preserved?
       DestI->setName(I->getName()); // Copy the name over...
       ValueMap[I] = DestI++;        // Add mapping to ValueMap
index d98848aa7c251aa9f775ab3d4d6b813bbea86d9a..66e005e82caf05eafa2628dfbc14727b30fc1566 100644 (file)
@@ -47,7 +47,7 @@ Module *llvm::CloneModule(const Module *M) {
   // new module.  Here we add them to the ValueMap and to the new Module.  We
   // don't worry about attributes or initializers, they will come later.
   //
-  for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
     ValueMap[I] = new GlobalVariable(I->getType()->getElementType(), false,
                                      GlobalValue::ExternalLinkage, 0,
                                      I->getName(), New);
@@ -61,7 +61,7 @@ Module *llvm::CloneModule(const Module *M) {
   // have been created, loop through and copy the global variable referrers
   // over...  We also set the attributes on the global now.
   //
-  for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
+  for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) {
     GlobalVariable *GV = cast<GlobalVariable>(ValueMap[I]);
     if (I->hasInitializer())
       GV->setInitializer(cast<Constant>(MapValue(I->getInitializer(),
@@ -74,8 +74,8 @@ Module *llvm::CloneModule(const Module *M) {
   for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
     Function *F = cast<Function>(ValueMap[I]);
     if (!I->isExternal()) {
-      Function::aiterator DestI = F->abegin();
-      for (Function::const_aiterator J = I->abegin(); J != I->aend(); ++J) {
+      Function::arg_iterator DestI = F->arg_begin();
+      for (Function::const_arg_iterator J = I->arg_begin(); J != I->arg_end(); ++J) {
         DestI->setName(J->getName());
         ValueMap[J] = DestI++;
       }
index 5a040010059ebb98bbca9c5b24852c01736e0d10..cf9cafb04ac87fa112e10bcb844081b559131258 100644 (file)
@@ -295,7 +295,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
   newFunction->getBasicBlockList().push_back(newRootNode);
 
   // Create an iterator to name all of the arguments we inserted.
-  Function::aiterator AI = newFunction->abegin();
+  Function::arg_iterator AI = newFunction->arg_begin();
 
   // Rewrite all users of the inputs in the extracted region to use the
   // arguments (or appropriate addressing into struct) instead.
@@ -322,7 +322,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
 
   // Set names for input and output arguments.
   if (!AggregateArgs) {
-    AI = newFunction->abegin();
+    AI = newFunction->arg_begin();
     for (unsigned i = 0, e = inputs.size(); i != e; ++i, ++AI)
       AI->setName(inputs[i]->getName());
     for (unsigned i = 0, e = outputs.size(); i != e; ++i, ++AI)
@@ -406,7 +406,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
                                 NumExitBlocks > 1 ? "targetBlock" : "");
   codeReplacer->getInstList().push_back(call);
 
-  Function::aiterator OutputArgBegin = newFunction->abegin();
+  Function::arg_iterator OutputArgBegin = newFunction->arg_begin();
   unsigned FirstOut = inputs.size();
   if (!AggregateArgs)
     std::advance(OutputArgBegin, inputs.size());
@@ -483,7 +483,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,
                              OldTarget);
 
           // Restore values just before we exit
-          Function::aiterator OAI = OutputArgBegin;
+          Function::arg_iterator OAI = OutputArgBegin;
           for (unsigned out = 0, e = outputs.size(); out != e; ++out) {
             // For an invoke, the normal destination is the only one that is
             // dominated by the result of the invocation
index 1384022be759724b0c3f29df8012066912672285..6bfdda230eb07eb4f9b51f3055418e472c7433b1 100644 (file)
@@ -60,13 +60,13 @@ bool llvm::InlineFunction(CallSite CS) {
   { // Scope to destroy ValueMap after cloning.
     // Calculate the vector of arguments to pass into the function cloner...
     std::map<const Value*, Value*> ValueMap;
-    assert(std::distance(CalledFunc->abegin(), CalledFunc->aend()) == 
+    assert(std::distance(CalledFunc->arg_begin(), CalledFunc->arg_end()) == 
            std::distance(CS.arg_begin(), CS.arg_end()) &&
            "No varargs calls can be inlined!");
     
     CallSite::arg_iterator AI = CS.arg_begin();
-    for (Function::const_aiterator I = CalledFunc->abegin(),
-           E = CalledFunc->aend(); I != E; ++I, ++AI)
+    for (Function::const_arg_iterator I = CalledFunc->arg_begin(),
+           E = CalledFunc->arg_end(); I != E; ++I, ++AI)
       ValueMap[I] = *AI;
     
     // Clone the entire body of the callee into the caller.  
index ea7a92ef36c3e8f3f99f02cb5fea04a3611819b5..3f72cfbb900fc402778befb918e3e7303d419082 100644 (file)
@@ -801,7 +801,7 @@ void AssemblyWriter::printModule(const Module *M) {
   // Loop over the symbol table, emitting all named constants.
   printSymbolTable(M->getSymbolTable());
   
-  for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
+  for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
     printGlobal(I);
 
   Out << "\nimplementation   ; Functions:\n";
@@ -926,7 +926,7 @@ void AssemblyWriter::printFunction(const Function *F) {
   // Loop over the arguments, printing them...
   const FunctionType *FT = F->getFunctionType();
 
-  for(Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for(Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     printArgument(I);
 
   // Finish printing arguments...
@@ -956,7 +956,7 @@ void AssemblyWriter::printFunction(const Function *F) {
 ///
 void AssemblyWriter::printArgument(const Argument *Arg) {
   // Insert commas as we go... the first arg doesn't get a comma
-  if (Arg != &Arg->getParent()->afront()) Out << ", ";
+  if (Arg != &Arg->getParent()->arg_front()) Out << ", ";
 
   // Output type...
   printType(Arg->getType());
@@ -1361,7 +1361,7 @@ void SlotMachine::processModule() {
   SC_DEBUG("begin processModule!\n");
 
   // Add all of the global variables to the value table...
-  for (Module::const_giterator I = TheModule->gbegin(), E = TheModule->gend();
+  for (Module::const_global_iterator I = TheModule->global_begin(), E = TheModule->global_end();
        I != E; ++I)
     createSlot(I);
 
@@ -1379,8 +1379,8 @@ void SlotMachine::processFunction() {
   SC_DEBUG("begin processFunction!\n");
 
   // Add all the function arguments
-  for(Function::const_aiterator AI = TheFunction->abegin(), 
-      AE = TheFunction->aend(); AI != AE; ++AI)
+  for(Function::const_arg_iterator AI = TheFunction->arg_begin(), 
+      AE = TheFunction->arg_end(); AI != AE; ++AI)
     createSlot(AI);
 
   SC_DEBUG("Inserting Instructions:\n");
index 69bbe261fa50f22d32cbdb5db0e8b087379c789d..14830cb8f820bd39c636947250af99eabc45769b 100644 (file)
@@ -121,6 +121,6 @@ Mangler::Mangler(Module &m, const char *prefix)
   std::map<std::string, GlobalValue*> Names;
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     InsertName(I, Names);
-  for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+  for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
     InsertName(I, Names);
 }
index 0c005494e15d8732e7a1765e02b7cdd5650e8160..f9b8ca1277f7ed8f5c15899a620cfd59bc426f5e 100644 (file)
@@ -286,7 +286,7 @@ void Module::dropAllReferences() {
   for(Module::iterator I = begin(), E = end(); I != E; ++I)
     I->dropAllReferences();
 
-  for(Module::giterator I = gbegin(), E = gend(); I != E; ++I)
+  for(Module::global_iterator I = global_begin(), E = global_end(); I != E; ++I)
     I->dropAllReferences();
 }
 
index 1649b72058fd759cd6a272c2667dd9c5c800a341..89fd98081fa54387363792ca53fbd0e007de95a1 100644 (file)
@@ -127,7 +127,7 @@ namespace {  // Anonymous namespace for class
         if (I->isExternal()) visitFunction(*I);
       }
 
-      for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+      for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
         visitGlobalVariable(*I);
 
       // If the module is broken, abort at this time.
@@ -307,7 +307,7 @@ void Verifier::visitFunction(Function &F) {
 
   // Check that the argument values match the function type for this function...
   unsigned i = 0;
-  for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I, ++i) {
+  for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I, ++i) {
     Assert2(I->getType() == FT->getParamType(i),
             "Argument value does not match function argument type!",
             I, FT->getParamType(i));