mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Rename FoldedGraph -> DSInfo to be consistent with other passes
delete some dead methods git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -38,8 +38,8 @@ namespace PA {
|
|||||||
|
|
||||||
DSGraph *GlobalsGraph;
|
DSGraph *GlobalsGraph;
|
||||||
|
|
||||||
// FoldedGraphsMap, one graph for each function
|
// DSInfo - one graph for each function.
|
||||||
hash_map<const Function*, DSGraph*> FoldedGraphsMap;
|
hash_map<const Function*, DSGraph*> DSInfo;
|
||||||
|
|
||||||
/// ActualCallees - The actual functions callable from indirect call sites.
|
/// ActualCallees - The actual functions callable from indirect call sites.
|
||||||
///
|
///
|
||||||
@@ -70,9 +70,8 @@ namespace PA {
|
|||||||
/// callees also have the same folded graph as the CBU graph.
|
/// callees also have the same folded graph as the CBU graph.
|
||||||
///
|
///
|
||||||
DSGraph &getDSGraph(const Function &F) const {
|
DSGraph &getDSGraph(const Function &F) const {
|
||||||
hash_map<const Function*, DSGraph*>::const_iterator I =
|
hash_map<const Function*, DSGraph*>::const_iterator I = DSInfo.find(&F);
|
||||||
FoldedGraphsMap.find(const_cast<Function*>(&F));
|
assert(I != DSInfo.end() && "No graph computed for that function!");
|
||||||
assert(I != FoldedGraphsMap.end() && "No folded graph for function!");
|
|
||||||
return *I->second;
|
return *I->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,19 +123,6 @@ namespace PA {
|
|||||||
void processGraph(DSGraph &FG, Function &F);
|
void processGraph(DSGraph &FG, Function &F);
|
||||||
|
|
||||||
DSGraph &getOrCreateGraph(Function &F);
|
DSGraph &getOrCreateGraph(Function &F);
|
||||||
|
|
||||||
bool hasFoldedGraph(const Function& F) const {
|
|
||||||
hash_map<const Function*, DSGraph*>::const_iterator I =
|
|
||||||
FoldedGraphsMap.find(const_cast<Function*>(&F));
|
|
||||||
return (I != FoldedGraphsMap.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
DSGraph* getOrCreateLeaderGraph(const Function& leader) {
|
|
||||||
DSGraph*& leaderGraph = FoldedGraphsMap[&leader];
|
|
||||||
if (leaderGraph == NULL)
|
|
||||||
leaderGraph = new DSGraph(CBU->getGlobalsGraph().getTargetData());
|
|
||||||
return leaderGraph;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // end PA namespace
|
}; // end PA namespace
|
||||||
|
@@ -210,7 +210,7 @@ void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
|
|||||||
for (std::set<Function*>::const_iterator EqI = EqClass.begin(),
|
for (std::set<Function*>::const_iterator EqI = EqClass.begin(),
|
||||||
EqEnd = EqClass.end(); EqI != EqEnd; ++EqI) {
|
EqEnd = EqClass.end(); EqI != EqEnd; ++EqI) {
|
||||||
Function* F = *EqI;
|
Function* F = *EqI;
|
||||||
DSGraph*& FG = FoldedGraphsMap[F];
|
DSGraph*& FG = DSInfo[F];
|
||||||
|
|
||||||
if (F == LF || FG == mergedG)
|
if (F == LF || FG == mergedG)
|
||||||
continue;
|
continue;
|
||||||
@@ -253,7 +253,7 @@ void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
|
|||||||
|
|
||||||
DSGraph &PA::EquivClassGraphs::getOrCreateGraph(Function &F) {
|
DSGraph &PA::EquivClassGraphs::getOrCreateGraph(Function &F) {
|
||||||
// Has the graph already been created?
|
// Has the graph already been created?
|
||||||
DSGraph *&Graph = FoldedGraphsMap[&F];
|
DSGraph *&Graph = DSInfo[&F];
|
||||||
if (Graph) return *Graph;
|
if (Graph) return *Graph;
|
||||||
|
|
||||||
DSGraph &CBUGraph = CBU->getDSGraph(F);
|
DSGraph &CBUGraph = CBU->getDSGraph(F);
|
||||||
@@ -263,11 +263,11 @@ DSGraph &PA::EquivClassGraphs::getOrCreateGraph(Function &F) {
|
|||||||
Graph->setGlobalsGraph(&getGlobalsGraph());
|
Graph->setGlobalsGraph(&getGlobalsGraph());
|
||||||
Graph->setPrintAuxCalls();
|
Graph->setPrintAuxCalls();
|
||||||
|
|
||||||
// Make sure to update the FoldedGraphsMap map for all functions in the graph!
|
// Make sure to update the DSInfo map for all functions in the graph!
|
||||||
for (DSGraph::ReturnNodesTy::iterator I = Graph->getReturnNodes().begin();
|
for (DSGraph::ReturnNodesTy::iterator I = Graph->getReturnNodes().begin();
|
||||||
I != Graph->getReturnNodes().end(); ++I)
|
I != Graph->getReturnNodes().end(); ++I)
|
||||||
if (I->first != &F) {
|
if (I->first != &F) {
|
||||||
DSGraph*& FG = FoldedGraphsMap[I->first];
|
DSGraph *&FG = DSInfo[I->first];
|
||||||
assert(FG == NULL || FG == &CBU->getDSGraph(*I->first) &&
|
assert(FG == NULL || FG == &CBU->getDSGraph(*I->first) &&
|
||||||
"Merging function in SCC twice?");
|
"Merging function in SCC twice?");
|
||||||
FG = Graph;
|
FG = Graph;
|
||||||
|
Reference in New Issue
Block a user