diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-15 04:54:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-15 04:54:21 +0000 |
commit | e4d5c441e04bdc00ccf1804744af670655123b07 (patch) | |
tree | be1bff1314e39651d7120d2d887b79b10dc2f24d /lib/Analysis | |
parent | 89cc2656ba070434dceeabe95cba0a95b988325b (diff) | |
download | external_llvm-e4d5c441e04bdc00ccf1804744af670655123b07.tar.gz external_llvm-e4d5c441e04bdc00ccf1804744af670655123b07.tar.bz2 external_llvm-e4d5c441e04bdc00ccf1804744af670655123b07.zip |
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
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/AliasAnalysisEvaluator.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/DataStructure.cpp | 8 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/DataStructureOpt.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/EquivClassGraphs.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/Local.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/Steensgaard.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/IPA/Andersens.cpp | 14 | ||||
-rw-r--r-- | lib/Analysis/IPA/FindUsedTypes.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 2 |
9 files changed, 20 insertions, 20 deletions
diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index bf979635ee..7c8ccb6c62 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -102,7 +102,7 @@ bool AAEval::runOnFunction(Function &F) { 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 a94e083da3..ac2abb308b 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -1270,7 +1270,7 @@ static bool PathExistsToClonedNode(const DSCallSite &CS, 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 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F, 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 @@ void DSGraph::markIncompleteNodes(unsigned Flags) { 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 @@ void DSGraph::AssertGraphOK() const { 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 1d8373a01d..c75784b964 100644 --- a/lib/Analysis/DataStructure/DataStructureOpt.cpp +++ b/lib/Analysis/DataStructure/DataStructureOpt.cpp @@ -59,7 +59,7 @@ bool DSOpt::OptimizeGlobals(Module &M) { 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 4ada4dcca5..ef1e01aae4 100644 --- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -215,7 +215,7 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) { // 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 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) { // 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 20f45a7b27..e2e40f76d2 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -82,7 +82,7 @@ namespace { 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 @@ bool LocalDataStructures::runOnModule(Module &M) { 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 eee9b0b6f9..dd07ee6f82 100644 --- a/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/lib/Analysis/DataStructure/Steensgaard.cpp @@ -94,7 +94,7 @@ void Steens::ResolveFunctionCall(Function *F, const DSCallSite &Call, // 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 b8553e6743..12d4cf5d4c 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -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())) { diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp index cb6b05ca4e..e37a40ac66 100644 --- a/lib/Analysis/IPA/FindUsedTypes.cpp +++ b/lib/Analysis/IPA/FindUsedTypes.cpp @@ -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()); diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 4a97a8f037..6bf2698988 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -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 |