[llvm-commits] [poolalloc] r119401 - /poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Tue Nov 16 14:49:16 PST 2010
Author: aggarwa4
Date: Tue Nov 16 16:49:16 2010
New Revision: 119401
URL: http://llvm.org/viewvc/llvm-project?rev=119401&view=rev
Log:
Use a set instead of list to keep track of DSGraphs.
Modified:
poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=119401&r1=119400&r2=119401&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original)
+++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Tue Nov 16 16:49:16 2010
@@ -43,11 +43,11 @@
init(&getAnalysis<CompleteBUDataStructures>(), false, true, false, true);
//make a list of all the DSGraphs
- std::list<DSGraph *>graphList;
+ std::set<DSGraph *>graphList;
for(Module::iterator F = M.begin(); F != M.end(); ++F)
{
if(!(F->isDeclaration()))
- graphList.push_back(getOrCreateGraph(F));
+ graphList.insert(getOrCreateGraph(F));
}
//update the EQ class from indirect calls
@@ -58,10 +58,10 @@
for(Module::iterator F = M.begin(); F != M.end(); ++F)
{
if(!(F->isDeclaration()))
- graphList.remove(getOrCreateGraph(F));
+ graphList.erase(getOrCreateGraph(F));
}
// free memory for the DSGraphs, no longer in use.
- for(std::list<DSGraph*>::iterator i = graphList.begin(),e = graphList.end();
+ for(std::set<DSGraph*>::iterator i = graphList.begin(),e = graphList.end();
i!=e;i++) {
delete (*i);
}
More information about the llvm-commits
mailing list