"Number of graphs inlined");
}
-
// getDSGraphForCallSite - Return the common data structure graph for
// callees at the specified call site.
//
// Stack of functions used for Tarjan's SCC-finding algorithm.
std::vector<Function*> Stack;
- hash_map<Function*, unsigned> ValMap;
+ std::map<Function*, unsigned> ValMap;
unsigned NextID = 1;
if (Function *Main = M.getMainFunction()) {
}
-unsigned PA::EquivClassGraphs::processSCC(DSGraph &FG, Function& F,
+unsigned PA::EquivClassGraphs::processSCC(DSGraph &FG, Function &F,
std::vector<Function*> &Stack,
unsigned &NextID,
- hash_map<Function*,unsigned> &ValMap){
+ std::map<Function*,unsigned> &ValMap){
DEBUG(std::cerr << " ProcessSCC for function " << F.getName() << "\n");
- assert(!ValMap.count(&F) && "Shouldn't revisit functions!");
+ std::map<Function*, unsigned>::iterator It = ValMap.lower_bound(&F);
+ if (It != ValMap.end() && It->first == &F)
+ return It->second;
+
unsigned Min = NextID++, MyID = Min;
ValMap[&F] = Min;
Stack.push_back(&F);
DSGraph &CalleeG = getOrCreateGraph(*I->second);
// Have we visited the destination function yet?
- hash_map<Function*, unsigned>::iterator It = ValMap.find(I->second);
- unsigned M = (It == ValMap.end()) // No, visit it now.
- ? processSCC(CalleeG, *I->second, Stack, NextID, ValMap)
- : It->second; // Yes, get it's number.
-
+ std::map<Function*, unsigned>::iterator It = ValMap.find(I->second);
+ unsigned M = processSCC(CalleeG, *I->second, Stack, NextID, ValMap);
if (M < Min) Min = M;
}
}