diff options
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DataStructure.h')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 33 |
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; |