diff options
author | Chris Lattner <sabre@nondot.org> | 2002-03-30 09:07:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-03-30 09:07:51 +0000 |
commit | 79f148ddbcc8cab75b5951f2a8245a60cd4b13f7 (patch) | |
tree | 2d29dc66c8fd0f1904ba04d2efa9128c75958636 | |
parent | 104dd00d746dd6a0366d78dac387b419b23626c1 (diff) | |
download | bcm5719-llvm-79f148ddbcc8cab75b5951f2a8245a60cd4b13f7.tar.gz bcm5719-llvm-79f148ddbcc8cab75b5951f2a8245a60cd4b13f7.zip |
Add accessors and a method to get all the outgoing links for ALL nodes
llvm-svn: 2055
-rw-r--r-- | llvm/include/llvm/Analysis/DataStructure.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/DataStructure.h b/llvm/include/llvm/Analysis/DataStructure.h index 379ccfa9136..64cd3fc566a 100644 --- a/llvm/include/llvm/Analysis/DataStructure.h +++ b/llvm/include/llvm/Analysis/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; |