mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Add initial support for a globals graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4656 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -501,14 +501,14 @@ Function &DSCallSite::getCaller() const {
|
||||
// DSGraph Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
DSGraph::DSGraph(const DSGraph &G) : Func(G.Func) {
|
||||
DSGraph::DSGraph(const DSGraph &G) : Func(G.Func), GlobalsGraph(0) {
|
||||
std::map<const DSNode*, DSNodeHandle> NodeMap;
|
||||
RetNode = cloneInto(G, ScalarMap, NodeMap);
|
||||
}
|
||||
|
||||
DSGraph::DSGraph(const DSGraph &G,
|
||||
std::map<const DSNode*, DSNodeHandle> &NodeMap)
|
||||
: Func(G.Func) {
|
||||
: Func(G.Func), GlobalsGraph(0) {
|
||||
RetNode = cloneInto(G, ScalarMap, NodeMap);
|
||||
}
|
||||
|
||||
@ -1056,28 +1056,6 @@ void DSGraph::maskNodeTypes(unsigned char Mask) {
|
||||
// GlobalDSGraph Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
GlobalDSGraph::GlobalDSGraph() : DSGraph(*(Function*)0, this) {
|
||||
}
|
||||
|
||||
GlobalDSGraph::~GlobalDSGraph() {
|
||||
assert(Referrers.size() == 0 &&
|
||||
"Deleting global graph while references from other graphs exist");
|
||||
}
|
||||
|
||||
void GlobalDSGraph::addReference(const DSGraph* referrer) {
|
||||
if (referrer != this)
|
||||
Referrers.insert(referrer);
|
||||
}
|
||||
|
||||
void GlobalDSGraph::removeReference(const DSGraph* referrer) {
|
||||
if (referrer != this) {
|
||||
assert(Referrers.find(referrer) != Referrers.end() && "This is very bad!");
|
||||
Referrers.erase(referrer);
|
||||
if (Referrers.size() == 0)
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Bits used in the next function
|
||||
static const char ExternalTypeBits = DSNode::GlobalNode | DSNode::HeapNode;
|
||||
|
Reference in New Issue
Block a user