mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-16 23:38:40 +00:00
* Nodes now keep track of any global variables in them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2879 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c314ac49d7
commit
f9ae4c5cb6
@ -37,6 +37,16 @@ void DSNode::removeReferrer(DSNodeHandle *H) {
|
|||||||
Referrers.erase(I.base()-1);
|
Referrers.erase(I.base()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// addGlobal - Add an entry for a global value to the Globals list. This also
|
||||||
|
// marks the node with the 'G' flag if it does not already have it.
|
||||||
|
//
|
||||||
|
void DSNode::addGlobal(GlobalValue *GV) {
|
||||||
|
assert(GV->getType()->getElementType() == Ty);
|
||||||
|
Globals.push_back(GV);
|
||||||
|
NodeType |= GlobalNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// addEdgeTo - Add an edge from the current node to the specified node. This
|
// addEdgeTo - Add an edge from the current node to the specified node. This
|
||||||
// can cause merging of nodes in the graph.
|
// can cause merging of nodes in the graph.
|
||||||
//
|
//
|
||||||
@ -74,8 +84,13 @@ void DSNode::mergeWith(DSNode *N) {
|
|||||||
N->Links[i] = 0; // Reduce unneccesary edges in graph. N is dead
|
N->Links[i] = 0; // Reduce unneccesary edges in graph. N is dead
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Merge the node types
|
||||||
NodeType |= N->NodeType;
|
NodeType |= N->NodeType;
|
||||||
N->NodeType = 0; // N is now a dead node.
|
N->NodeType = 0; // N is now a dead node.
|
||||||
|
|
||||||
|
// Merge the globals list...
|
||||||
|
Globals.insert(Globals.end(), N->Globals.begin(), N->Globals.end());
|
||||||
|
N->Globals.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user