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
This commit is contained in:
Chris Lattner
2005-03-15 04:54:21 +00:00
parent 89cc2656ba
commit e4d5c441e0
65 changed files with 185 additions and 185 deletions

View File

@@ -433,7 +433,7 @@ void Andersens::IdentifyObjects(Module &M) {
++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 @@ void Andersens::IdentifyObjects(Module &M) {
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::AddGlobalInitializerConstraints(Node *N, Constant *C) {
}
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 @@ void Andersens::CollectConstraints(Module &M) {
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 @@ void Andersens::CollectConstraints(Module &M) {
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 @@ void Andersens::CollectConstraints(Module &M) {
// 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 @@ void Andersens::AddConstraintsForCall(CallSite CS, Function *F) {
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())) {

View File

@@ -62,7 +62,7 @@ bool FindUsedTypes::runOnModule(Module &m) {
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());

View File

@@ -159,7 +159,7 @@ void GlobalsModRef::AnalyzeGlobals(Module &M) {
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