summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-09 20:01:01 +0000
committerChris Lattner <sabre@nondot.org>2002-11-09 20:01:01 +0000
commite742f31e0ca75028b078a8f9c6419622c28dc9c5 (patch)
treea2216c0a619bdbca7d4defde812297d9eafd33d5 /llvm/lib/Analysis/DataStructure/DataStructure.cpp
parent5737a600d71bf3c927482961aca34aafa7342b69 (diff)
downloadbcm5719-llvm-e742f31e0ca75028b078a8f9c6419622c28dc9c5.tar.gz
bcm5719-llvm-e742f31e0ca75028b078a8f9c6419622c28dc9c5.zip
Add initial support for a globals graph
llvm-svn: 4656
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 6380a4967ee..584031bade3 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -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;
OpenPOWER on IntegriCloud