[llvm-commits] [poolalloc] r118184 - /poolalloc/trunk/lib/DSA/DSTest.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Wed Nov 3 11:16:50 PDT 2010
Author: aggarwa4
Date: Wed Nov 3 13:16:50 2010
New Revision: 118184
URL: http://llvm.org/viewvc/llvm-project?rev=118184&view=rev
Log:
More robust checking in case of SCCs
Modified:
poolalloc/trunk/lib/DSA/DSTest.cpp
Modified: poolalloc/trunk/lib/DSA/DSTest.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=118184&r1=118183&r2=118184&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSTest.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSTest.cpp Wed Nov 3 13:16:50 2010
@@ -558,16 +558,23 @@
std::string &func = *(I);
Function *caller = M->getFunction(func);
assert(caller && "Function not found in module");
- const DSCallGraph callgraph = DS->getCallGraph();
+ //const DSCallGraph callgraph = DS->getCallGraph();
+ (const_cast<DSCallGraph&>(callgraph)).dump();
++I;
while(I != E ){
std::string &func = *(I);
Function *callee = M->getFunction(func);
bool found = false;
+ // either the callee is found in the DSGraph
for(DSCallGraph::flat_iterator CI = callgraph.flat_callee_begin(caller); CI != callgraph.flat_callee_end(caller); CI ++) {
- if ( callee == *CI)
+ if (callee == *CI)
found = true;
//(*CI)->dump();
+ }
+ // or the callee is in the same SCC as the caller, and hence does not show up
+ for(DSCallGraph::scc_iterator sccii = callgraph.scc_begin(caller), sccee = callgraph.scc_end(caller); sccii != sccee; ++sccii) {
+ if(callee == *sccii)
+ found = true;
}
assert(found && "callee not in call graph");
++I;
More information about the llvm-commits
mailing list