aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/DataStructure/DataStructure.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-30 09:07:51 +0000
committerChris Lattner <sabre@nondot.org>2002-03-30 09:07:51 +0000
commit9a691dbc8241ccf7779062124ba3a3ba728b313f (patch)
tree7f2c68e5b272345c3c8d550f7cf41d60ab17607c /include/llvm/Analysis/DataStructure/DataStructure.h
parent5cddb2f0f8708a6bfeeeb4e49ba5cae1879dc3bb (diff)
Add accessors and a method to get all the outgoing links for ALL nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DataStructure.h')
-rw-r--r--include/llvm/Analysis/DataStructure/DataStructure.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h
index 379ccfa913..64cd3fc566 100644
--- a/include/llvm/Analysis/DataStructure/DataStructure.h
+++ b/include/llvm/Analysis/DataStructure/DataStructure.h
@@ -131,6 +131,10 @@ public:
assert(i < getNumLinks() && "Field links access out of range...");
return FieldLinks[i];
}
+ const PointerValSet &getLink(unsigned i) const {
+ assert(i < getNumLinks() && "Field links access out of range...");
+ return FieldLinks[i];
+ }
// addReferrer - Keep the referrer set up to date...
void addReferrer(PointerValSet *PVS) { Referrers.push_back(PVS); }
@@ -146,6 +150,18 @@ public:
const Type *getType() const { return Ty; }
+ // getNumOutgoingLinks - Return the number of outgoing links, which is usually
+ // the number of normal links, but for call nodes it also includes their
+ // arguments.
+ //
+ virtual unsigned getNumOutgoingLinks() const { return getNumLinks(); }
+ virtual PointerValSet &getOutgoingLink(unsigned Link) {
+ return getLink(Link);
+ }
+ virtual const PointerValSet &getOutgoingLink(unsigned Link) const {
+ return getLink(Link);
+ }
+
void print(std::ostream &O) const;
virtual std::string getCaption() const = 0;
@@ -258,6 +274,22 @@ public:
ArgLinks.clear();
}
+ // getNumOutgoingLinks - Return the number of outgoing links, which is usually
+ // the number of normal links, but for call nodes it also includes their
+ // arguments.
+ //
+ virtual unsigned getNumOutgoingLinks() const {
+ return getNumLinks() + getNumArgs();
+ }
+ virtual PointerValSet &getOutgoingLink(unsigned Link) {
+ if (Link < getNumLinks()) return getLink(Link);
+ return getArgValues(Link-getNumLinks());
+ }
+ virtual const PointerValSet &getOutgoingLink(unsigned Link) const {
+ if (Link < getNumLinks()) return getLink(Link);
+ return getArgValues(Link-getNumLinks());
+ }
+
// isEquivalentTo - Return true if the nodes should be merged...
virtual bool isEquivalentTo(DSNode *Node) const;
@@ -393,6 +425,7 @@ public:
//
std::map<Value*, PointerValSet> &getValueMap() { return ValueMap; }
+ const PointerValSet &getRetNodes() const { return RetNode; }
void printFunction(std::ostream &O, const char *Label) const;