[llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp FindUsedTypes.cpp GlobalsModRef.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 14 20:55:03 PST 2005



Changes in directory llvm/lib/Analysis/IPA:

Andersens.cpp updated: 1.10 -> 1.11
FindUsedTypes.cpp updated: 1.30 -> 1.31
GlobalsModRef.cpp updated: 1.10 -> 1.11
---
Log message:

This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!



---
Diffs of the changes:  (+9 -9)

 Andersens.cpp     |   14 +++++++-------
 FindUsedTypes.cpp |    2 +-
 GlobalsModRef.cpp |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)


Index: llvm/lib/Analysis/IPA/Andersens.cpp
diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.10 llvm/lib/Analysis/IPA/Andersens.cpp:1.11
--- llvm/lib/Analysis/IPA/Andersens.cpp:1.10	Sat Jan  8 16:01:16 2005
+++ llvm/lib/Analysis/IPA/Andersens.cpp	Mon Mar 14 22:54:18 2005
@@ -433,7 +433,7 @@
   ++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 @@
       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::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 @@
   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 @@
       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 @@
 
       // 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 @@
                                      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: llvm/lib/Analysis/IPA/FindUsedTypes.cpp
diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.30 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.31
--- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.30	Sun Sep 19 23:45:09 2004
+++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp	Mon Mar 14 22:54:18 2005
@@ -62,7 +62,7 @@
   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: llvm/lib/Analysis/IPA/GlobalsModRef.cpp
diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.10 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.11
--- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.10	Fri Dec 17 11:12:24 2004
+++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp	Mon Mar 14 22:54:18 2005
@@ -159,7 +159,7 @@
       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






More information about the llvm-commits mailing list