[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Mangler.cpp Module.cpp Verifier.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 14 20:55:03 PST 2005
Changes in directory llvm/lib/VMCore:
AsmWriter.cpp updated: 1.173 -> 1.174
Mangler.cpp updated: 1.15 -> 1.16
Module.cpp updated: 1.59 -> 1.60
Verifier.cpp updated: 1.127 -> 1.128
---
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: (+10 -10)
AsmWriter.cpp | 12 ++++++------
Mangler.cpp | 2 +-
Module.cpp | 2 +-
Verifier.cpp | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.173 llvm/lib/VMCore/AsmWriter.cpp:1.174
--- llvm/lib/VMCore/AsmWriter.cpp:1.173 Wed Mar 2 17:17:31 2005
+++ llvm/lib/VMCore/AsmWriter.cpp Mon Mar 14 22:54:21 2005
@@ -801,7 +801,7 @@
// 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 @@
// 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::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 @@
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 @@
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: llvm/lib/VMCore/Mangler.cpp
diff -u llvm/lib/VMCore/Mangler.cpp:1.15 llvm/lib/VMCore/Mangler.cpp:1.16
--- llvm/lib/VMCore/Mangler.cpp:1.15 Wed Sep 1 17:55:37 2004
+++ llvm/lib/VMCore/Mangler.cpp Mon Mar 14 22:54:21 2005
@@ -121,6 +121,6 @@
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: llvm/lib/VMCore/Module.cpp
diff -u llvm/lib/VMCore/Module.cpp:1.59 llvm/lib/VMCore/Module.cpp:1.60
--- llvm/lib/VMCore/Module.cpp:1.59 Sat Jan 29 18:08:49 2005
+++ llvm/lib/VMCore/Module.cpp Mon Mar 14 22:54:21 2005
@@ -286,7 +286,7 @@
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: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.127 llvm/lib/VMCore/Verifier.cpp:1.128
--- llvm/lib/VMCore/Verifier.cpp:1.127 Mon Feb 28 13:27:42 2005
+++ llvm/lib/VMCore/Verifier.cpp Mon Mar 14 22:54:21 2005
@@ -127,7 +127,7 @@
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 @@
// 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));
More information about the llvm-commits
mailing list