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/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp
index bf97963..7c8ccb6 100644
--- a/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -102,7 +102,7 @@
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);
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index a94e083..ac2abb3 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -1270,7 +1270,7 @@
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 @@
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 @@
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 @@
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!");
diff --git a/lib/Analysis/DataStructure/DataStructureOpt.cpp b/lib/Analysis/DataStructure/DataStructureOpt.cpp
index 1d8373a..c75784b 100644
--- a/lib/Analysis/DataStructure/DataStructureOpt.cpp
+++ b/lib/Analysis/DataStructure/DataStructureOpt.cpp
@@ -59,7 +59,7 @@
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;
diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp
index 4ada4dc..ef1e01a 100644
--- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp
+++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp
@@ -215,7 +215,7 @@
// 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 @@
// 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()))
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 20f45a7..e2e40f7 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -82,7 +82,7 @@
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 @@
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);
}
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp
index eee9b0b..dd07ee6 100644
--- a/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -94,7 +94,7 @@
// 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...
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index b8553e6..12d4cf5 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -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())) {
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index cb6b05c..e37a40a 100644
--- a/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -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());
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index 4a97a8f..6bf2698 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -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
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 9da6364..eb79350 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -759,7 +759,7 @@
// 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 @@
// 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 @@
}
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 @@
}
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 @@
// 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 @@
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...
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 7eede0e..974a326 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -536,7 +536,7 @@
/// 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);
diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp
index 449bf86..086409e 100644
--- a/lib/Bytecode/Reader/ReaderWrappers.cpp
+++ b/lib/Bytecode/Reader/ReaderWrappers.cpp
@@ -171,7 +171,7 @@
// 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 @@
}
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 @@
}
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 @@
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());
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp
index 4a95c7b..d1af03e 100644
--- a/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/lib/Bytecode/Writer/SlotCalculator.cpp
@@ -121,7 +121,7 @@
// 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 @@
// 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 @@
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 @@
}
// 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
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index 9862391..dcee8be 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/lib/Bytecode/Writer/Writer.cpp
@@ -894,7 +894,7 @@
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!");
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index 0fe49ec..3633f96 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -87,28 +87,28 @@
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;
}
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 565a342..48574da 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -128,7 +128,7 @@
// 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 @@
// 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 @@
// 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,
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index f594827..0513401 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -494,7 +494,7 @@
// 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 @@
// 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);
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 9037ab6..ff35679 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -1065,13 +1065,13 @@
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...
diff --git a/lib/Linker/LinkArchives.cpp b/lib/Linker/LinkArchives.cpp
index 99f3a1b..fcd2cf8 100644
--- a/lib/Linker/LinkArchives.cpp
+++ b/lib/Linker/LinkArchives.cpp
@@ -33,7 +33,7 @@
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 @@
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());
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 0d65ddd..627a38c 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -425,7 +425,7 @@
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 @@
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 @@
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 @@
*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 @@
// 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())
diff --git a/lib/Target/Alpha/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AlphaAsmPrinter.cpp
index 8031d17..500f8b1 100644
--- a/lib/Target/Alpha/AlphaAsmPrinter.cpp
+++ b/lib/Target/Alpha/AlphaAsmPrinter.cpp
@@ -241,7 +241,7 @@
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);
diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp
index 5db6afe..99bb9b9 100644
--- a/lib/Target/Alpha/AlphaISelPattern.cpp
+++ b/lib/Target/Alpha/AlphaISelPattern.cpp
@@ -146,7 +146,7 @@
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) {
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 111468f..d010509 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -851,9 +851,9 @@
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 @@
}
// 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 @@
}
// 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 @@
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 @@
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:
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 111468f..d010509 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -851,9 +851,9 @@
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 @@
}
// 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 @@
}
// 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 @@
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 @@
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:
diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp
index 38e51ab..e68d6c5 100644
--- a/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -734,7 +734,7 @@
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
diff --git a/lib/Target/PowerPC/PPC64ISelSimple.cpp b/lib/Target/PowerPC/PPC64ISelSimple.cpp
index a4d545b..9fe3422 100644
--- a/lib/Target/PowerPC/PPC64ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC64ISelSimple.cpp
@@ -590,7 +590,7 @@
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
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 48eddb9..a50a437 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -459,7 +459,7 @@
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 @@
<< "\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 @@
}
// 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::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;
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp
index 432aa2c..7121053 100644
--- a/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/SparcAsmPrinter.cpp
@@ -580,7 +580,7 @@
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);
diff --git a/lib/Target/Sparc/SparcV8ISelSimple.cpp b/lib/Target/Sparc/SparcV8ISelSimple.cpp
index 9de3a88..6332368 100644
--- a/lib/Target/Sparc/SparcV8ISelSimple.cpp
+++ b/lib/Target/Sparc/SparcV8ISelSimple.cpp
@@ -335,7 +335,7 @@
// 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 @@
}
// 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) {
diff --git a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
index 432aa2c..7121053 100644
--- a/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
+++ b/lib/Target/SparcV8/SparcV8AsmPrinter.cpp
@@ -580,7 +580,7 @@
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);
diff --git a/lib/Target/SparcV8/SparcV8ISelSimple.cpp b/lib/Target/SparcV8/SparcV8ISelSimple.cpp
index 9de3a88..6332368 100644
--- a/lib/Target/SparcV8/SparcV8ISelSimple.cpp
+++ b/lib/Target/SparcV8/SparcV8ISelSimple.cpp
@@ -335,7 +335,7 @@
// 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 @@
}
// 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) {
diff --git a/lib/Target/SparcV9/InternalGlobalMapper.cpp b/lib/Target/SparcV9/InternalGlobalMapper.cpp
index 8df3dc3..280c836 100644
--- a/lib/Target/SparcV9/InternalGlobalMapper.cpp
+++ b/lib/Target/SparcV9/InternalGlobalMapper.cpp
@@ -52,7 +52,7 @@
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)
diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
index 190e0c5..6da3e0f 100644
--- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
+++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
@@ -150,7 +150,7 @@
// 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
diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
index 6a1710e..adb7d28 100644
--- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
+++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
@@ -317,7 +317,7 @@
// 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 @@
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;
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index d6c401a..c410a4b 100644
--- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -768,7 +768,7 @@
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())
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp
index 948276b..8a82718 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -374,7 +374,7 @@
// 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 @@
// 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);
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index c792632..24e92ed 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -123,7 +123,7 @@
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);
diff --git a/lib/Target/X86/X86ISelPattern.cpp b/lib/Target/X86/X86ISelPattern.cpp
index e673bb5..9b68ad8 100644
--- a/lib/Target/X86/X86ISelPattern.cpp
+++ b/lib/Target/X86/X86ISelPattern.cpp
@@ -117,7 +117,7 @@
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;
diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp
index 9c9dac3..a406589 100644
--- a/lib/Target/X86/X86ISelSimple.cpp
+++ b/lib/Target/X86/X86ISelSimple.cpp
@@ -618,7 +618,7 @@
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
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index a582f3b..87a8f02 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -106,7 +106,7 @@
// 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 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 @@
// 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 @@
// 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 @@
// 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 @@
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 @@
// 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.
diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp
index 27e1955..0140228 100644
--- a/lib/Transforms/IPO/ConstantMerge.cpp
+++ b/lib/Transforms/IPO/ConstantMerge.cpp
@@ -56,7 +56,7 @@
// 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();
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp
index e4b7a3e..e226dc3 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -210,7 +210,7 @@
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 @@
// 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 @@
// 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 @@
// 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 @@
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 @@
// 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 @@
// 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 @@
// 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);
diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp
index 1b92fd1..482964e 100644
--- a/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/lib/Transforms/IPO/ExtractFunction.cpp
@@ -52,7 +52,7 @@
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);
diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp
index 090755b..dba44a0 100644
--- a/lib/Transforms/IPO/FunctionResolution.cpp
+++ b/lib/Transforms/IPO/FunctionResolution.cpp
@@ -311,7 +311,7 @@
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 @@
++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;
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp
index cdf994a..b7fa5dc 100644
--- a/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/lib/Transforms/IPO/GlobalDCE.cpp
@@ -60,7 +60,7 @@
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 @@
// 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);
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 754adc3..7b6f649 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -51,7 +51,7 @@
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 @@
// 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 @@
/// 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 @@
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())
diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp
index 65d5077..16839ed 100644
--- a/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ b/lib/Transforms/IPO/IPConstantPropagation.cpp
@@ -69,10 +69,10 @@
/// 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 @@
// 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 @@
// 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!?
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index 5916f10..4355c6c 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -167,7 +167,7 @@
// 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)));
}
diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp
index 5e436aa..5a254fa 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -93,7 +93,7 @@
}
// 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
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp
index 03ea55b..80fe394 100644
--- a/lib/Transforms/IPO/StripSymbols.cpp
+++ b/lib/Transforms/IPO/StripSymbols.cpp
@@ -75,7 +75,7 @@
// 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
diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
index 1c0c4ad..5ce0142 100644
--- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp
+++ b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
@@ -55,11 +55,11 @@
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 @@
}
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) {
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index f645f1b..5be8637 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -367,7 +367,7 @@
// 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);
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);
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index 9bd8bf1..6440851 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -49,7 +49,7 @@
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 @@
// 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 *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
diff --git a/lib/Transforms/Utils/CloneModule.cpp b/lib/Transforms/Utils/CloneModule.cpp
index d98848a..66e005e 100644
--- a/lib/Transforms/Utils/CloneModule.cpp
+++ b/lib/Transforms/Utils/CloneModule.cpp
@@ -47,7 +47,7 @@
// 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 @@
// 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 @@
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++;
}
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index 5a04001..cf9cafb0 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -295,7 +295,7 @@
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 @@
// 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 @@
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 @@
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
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index 1384022..6bfdda2 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -60,13 +60,13 @@
{ // 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.
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index ea7a92e..3f72cfb 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -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");
diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp
index 69bbe26..14830cb 100644
--- a/lib/VMCore/Mangler.cpp
+++ b/lib/VMCore/Mangler.cpp
@@ -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);
}
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp
index 0c00549..f9b8ca1 100644
--- a/lib/VMCore/Module.cpp
+++ b/lib/VMCore/Module.cpp
@@ -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();
}
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 1649b72..89fd980 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -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));