[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp PoolAllocate.cpp TransformFunctionBody.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 14 20:46:47 PST 2005
Changes in directory llvm-poolalloc/lib/PoolAllocate:
PointerCompress.cpp updated: 1.56 -> 1.57
PoolAllocate.cpp updated: 1.110 -> 1.111
TransformFunctionBody.cpp updated: 1.39 -> 1.40
---
Log message:
switch from a* to arg_* and g* to global_* for argument/global var iterators
---
Diffs of the changes: (+17 -11)
PointerCompress.cpp | 11 ++++++-----
PoolAllocate.cpp | 15 ++++++++++-----
TransformFunctionBody.cpp | 2 +-
3 files changed, 17 insertions(+), 11 deletions(-)
Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.56 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.57
--- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.56 Mon Mar 14 19:00:30 2005
+++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Mon Mar 14 22:46:30 2005
@@ -973,7 +973,7 @@
unsigned NumPoolArgs = FI ? FI->ArgNodes.size() : 0;
for (unsigned i = 1, e = CI.getNumOperands(); i != e; ++i)
if (isa<PointerType>(CI.getOperand(i)->getType()) && i > NumPoolArgs) {
- Argument *FormalArg = next(FI->F.abegin(), i-1-NumPoolArgs);
+ Argument *FormalArg = next(FI->F.arg_begin(), i-1-NumPoolArgs);
DSGraph::computeNodeMapping(CG->getNodeForValue(FormalArg),
getMappedNodeHandle(CI.getOperand(i)),
@@ -1004,7 +1004,7 @@
std::vector<Value*> Operands;
Operands.reserve(CI.getNumOperands()-1);
- Function::aiterator AI = FI->F.abegin();
+ Function::arg_iterator AI = FI->F.arg_begin();
// Pass pool descriptors.
for (unsigned i = 1; i != NumPoolArgs+1; ++i)
@@ -1290,7 +1290,7 @@
for (unsigned i = 0; i != NumPoolArgs; ++i)
ParamTypes.push_back(FTy->getParamType(i));
- Function::aiterator AI = FI.F.abegin();
+ Function::arg_iterator AI = FI.F.arg_begin();
for (unsigned i = NumPoolArgs, e = FTy->getNumParams(); i != e; ++i, ++AI)
if (isa<PointerType>(FTy->getParamType(i)) &&
PoolsToCompress.count(CG.getNodeForValue(AI).getNode())) {
@@ -1327,8 +1327,9 @@
std::vector<std::pair<Value*,Value*> > RemappedArgs;
// Process arguments, setting up the ValueMap for them.
- Function::aiterator CI = Clone->abegin(); // Iterator over cloned fn args.
- for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I, ++CI) {
+ Function::arg_iterator CI = Clone->arg_begin();// Iterate over cloned fn args.
+ for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
+ I != E; ++I, ++CI) {
// Transfer the argument names over.
CI->setName(I->getName());
Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.110 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.111
--- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.110 Mon Mar 14 19:00:30 2005
+++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Mon Mar 14 22:46:30 2005
@@ -232,7 +232,8 @@
// Mark globals and incomplete nodes as live... (this handles arguments)
if (F.getName() != "main") {
// All DSNodes reachable from arguments must be passed in.
- 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) {
DSGraph::ScalarMapTy::iterator AI = G.getScalarMap().find(I);
if (AI != G.getScalarMap().end())
if (DSNode *N = AI->second.getNode())
@@ -320,7 +321,7 @@
// Set the rest of the new arguments names to be PDa<n> and add entries to the
// pool descriptors map
std::map<const DSNode*, Value*> &PoolDescriptors = FI.PoolDescriptors;
- Function::aiterator NI = New->abegin();
+ Function::arg_iterator NI = New->arg_begin();
for (unsigned i = 0, e = FI.ArgNodes.size(); i != e; ++i, ++NI) {
NI->setName("PDa");
@@ -330,7 +331,8 @@
// Map the existing arguments of the old function to the corresponding
// arguments of the new function, and copy over the names.
std::map<const Value*, Value*> ValueMap;
- for (Function::aiterator I = F.abegin(); NI != New->aend(); ++I, ++NI) {
+ for (Function::arg_iterator I = F.arg_begin();
+ NI != New->arg_end(); ++I, ++NI) {
ValueMap[I] = NI;
NI->setName(I->getName());
}
@@ -338,8 +340,11 @@
// Populate the value map with all of the globals in the program.
// FIXME: This should be unnecessary!
Module &M = *F.getParent();
- for (Module::iterator I = M.begin(), E=M.end(); I!=E; ++I) ValueMap[I] = I;
- for (Module::giterator I = M.gbegin(), E=M.gend(); I!=E; ++I) ValueMap[I] = I;
+ for (Module::iterator I = M.begin(), E=M.end(); I!=E; ++I)
+ ValueMap[I] = I;
+ for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E; ++I)
+ ValueMap[I] = I;
// Perform the cloning.
std::vector<ReturnInst*> Returns;
Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.39 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.40
--- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.39 Sat Mar 12 05:55:30 2005
+++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Mon Mar 14 22:46:30 2005
@@ -484,7 +484,7 @@
NewCallee = new CastInst(CS.getCalledValue(), PFTy, "tmp", TheCall);
}
- Function::aiterator FAI = CF->abegin(), E = CF->aend();
+ Function::arg_iterator FAI = CF->arg_begin(), E = CF->arg_end();
CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
for ( ; FAI != E && AI != AE; ++FAI, ++AI)
if (!isa<Constant>(*AI))
More information about the llvm-commits
mailing list