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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/CorrelatedExprs.cpp b/lib/Transforms/Scalar/CorrelatedExprs.cpp
index 6f11506..da8c500 100644
--- a/lib/Transforms/Scalar/CorrelatedExprs.cpp
+++ b/lib/Transforms/Scalar/CorrelatedExprs.cpp
@@ -757,7 +757,7 @@
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...
diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp
index 533a9e8..dbabe26 100644
--- a/lib/Transforms/Scalar/GCSE.cpp
+++ b/lib/Transforms/Scalar/GCSE.cpp
@@ -73,7 +73,7 @@
// 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()) {
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index c74cf51..1972b9d 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -66,7 +66,7 @@
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);
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index c769b54..cc05412 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -865,7 +865,7 @@
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 @@
// 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 @@
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 @@
// 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 @@
//
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()) {
diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 758628c..bf098eb 100644
--- a/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -161,7 +161,7 @@
// 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 @@
// 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);