aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-08 23:22:48 +0000
committerChris Lattner <sabre@nondot.org>2002-11-08 23:22:48 +0000
commit2c8b1f6fc68d814526a1d3ba52e1fdb681feae53 (patch)
tree8f12278cb7cc1efc895fc31d79bda71a53ce84a2
parent51c20e9a3a3f0f03775cca880d582d294b3f19e8 (diff)
Add new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4646 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/DSNode.h10
-rw-r--r--include/llvm/Analysis/DataStructure/DSNode.h10
2 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DSNode.h b/include/llvm/Analysis/DSNode.h
index 43d33bca04..729240f775 100644
--- a/include/llvm/Analysis/DSNode.h
+++ b/include/llvm/Analysis/DSNode.h
@@ -120,6 +120,8 @@ public:
assert(Index < Links.size() && "Link index is out of range!");
return Links[Index].getNode();
}
+
+ /// getLink - Return the link at the specified offset.
DSNodeHandle &getLink(unsigned Offset) {
assert((Offset & ((1 << DS::PointerShift)-1)) == 0 &&
"Pointer offset not aligned correctly!");
@@ -135,6 +137,10 @@ public:
return Links[Index];
}
+ /// getNumLinks - Return the number of links in a node...
+ ///
+ unsigned getNumLinks() const { return Links.size(); }
+
/// mergeTypeInfo - This method merges the specified type into the current
/// node at the specified offset. This may update the current node's type
/// record if this gives more information to the node, it may do nothing to
@@ -172,6 +178,10 @@ public:
Links[Index] = NH;
}
+ /// getPointerSize - Return the size of a pointer for the current target.
+ ///
+ unsigned getPointerSize() const { return DS::PointerSize; }
+
/// addEdgeTo - Add an edge from the current node to the specified node. This
/// can cause merging of nodes in the graph.
///
diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h
index 43d33bca04..729240f775 100644
--- a/include/llvm/Analysis/DataStructure/DSNode.h
+++ b/include/llvm/Analysis/DataStructure/DSNode.h
@@ -120,6 +120,8 @@ public:
assert(Index < Links.size() && "Link index is out of range!");
return Links[Index].getNode();
}
+
+ /// getLink - Return the link at the specified offset.
DSNodeHandle &getLink(unsigned Offset) {
assert((Offset & ((1 << DS::PointerShift)-1)) == 0 &&
"Pointer offset not aligned correctly!");
@@ -135,6 +137,10 @@ public:
return Links[Index];
}
+ /// getNumLinks - Return the number of links in a node...
+ ///
+ unsigned getNumLinks() const { return Links.size(); }
+
/// mergeTypeInfo - This method merges the specified type into the current
/// node at the specified offset. This may update the current node's type
/// record if this gives more information to the node, it may do nothing to
@@ -172,6 +178,10 @@ public:
Links[Index] = NH;
}
+ /// getPointerSize - Return the size of a pointer for the current target.
+ ///
+ unsigned getPointerSize() const { return DS::PointerSize; }
+
/// addEdgeTo - Add an edge from the current node to the specified node. This
/// can cause merging of nodes in the graph.
///