aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/NodeImpl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-31 07:16:08 +0000
committerChris Lattner <sabre@nondot.org>2002-03-31 07:16:08 +0000
commitb28bf054834a2f41de7bda1bbadb54910440609d (patch)
tree343f304f297e227adae0f819cc2e8caaff0c1ddf /lib/Analysis/DataStructure/NodeImpl.cpp
parente6b552fd86294d3d76fc4eeb0b77472e035aec26 (diff)
* Move the isEquivalentTo implementations here. They can probably be put
someplace nicer in the file though. * Add new dump method for debugging git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/NodeImpl.cpp')
-rw-r--r--lib/Analysis/DataStructure/NodeImpl.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/NodeImpl.cpp b/lib/Analysis/DataStructure/NodeImpl.cpp
index b8fabf8a74..24fad04a4f 100644
--- a/lib/Analysis/DataStructure/NodeImpl.cpp
+++ b/lib/Analysis/DataStructure/NodeImpl.cpp
@@ -4,7 +4,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Analysis/DataStructure.h"
+#include "llvm/Analysis/DataStructureGraph.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
@@ -15,6 +15,42 @@
#include <algorithm>
#include <sstream>
+bool AllocDSNode::isEquivalentTo(DSNode *Node) const {
+ if (AllocDSNode *N = dyn_cast<AllocDSNode>(Node))
+ return getType() == Node->getType();
+// return N->Allocation == Allocation;
+ return false;
+}
+
+bool GlobalDSNode::isEquivalentTo(DSNode *Node) const {
+ if (GlobalDSNode *G = dyn_cast<GlobalDSNode>(Node))
+ return G->Val == Val;
+ return false;
+}
+
+bool CallDSNode::isEquivalentTo(DSNode *Node) const {
+ if (CallDSNode *C = dyn_cast<CallDSNode>(Node))
+ return /*C->CI == CI &&*/
+ C->CI->getCalledFunction() == CI->getCalledFunction() &&
+ C->ArgLinks == ArgLinks;
+ return false;
+}
+
+bool ArgDSNode::isEquivalentTo(DSNode *Node) const {
+ return false;
+}
+
+// NodesAreEquivalent - Check to see if the nodes are equivalent in all ways
+// except node type. Since we know N1 is a shadow node, N2 is allowed to be
+// any type.
+//
+bool ShadowDSNode::isEquivalentTo(DSNode *Node) const {
+ return !isCriticalNode(); // Must not be a critical node...
+}
+
+
+
+
//===----------------------------------------------------------------------===//
// DSNode Class Implementation
//
@@ -109,6 +145,8 @@ static string escapeLabel(const string &In) {
return Label;
}
+void DSNode::dump() const { print(cerr); }
+
void DSNode::print(std::ostream &O) const {
string Caption = escapeLabel(getCaption());