mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
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
This commit is contained in:
parent
5cddb2f0f8
commit
9a691dbc82
@ -131,6 +131,10 @@ public:
|
|||||||
assert(i < getNumLinks() && "Field links access out of range...");
|
assert(i < getNumLinks() && "Field links access out of range...");
|
||||||
return FieldLinks[i];
|
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...
|
// addReferrer - Keep the referrer set up to date...
|
||||||
void addReferrer(PointerValSet *PVS) { Referrers.push_back(PVS); }
|
void addReferrer(PointerValSet *PVS) { Referrers.push_back(PVS); }
|
||||||
@ -146,6 +150,18 @@ public:
|
|||||||
|
|
||||||
const Type *getType() const { return Ty; }
|
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;
|
void print(std::ostream &O) const;
|
||||||
|
|
||||||
virtual std::string getCaption() const = 0;
|
virtual std::string getCaption() const = 0;
|
||||||
@ -258,6 +274,22 @@ public:
|
|||||||
ArgLinks.clear();
|
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...
|
// isEquivalentTo - Return true if the nodes should be merged...
|
||||||
virtual bool isEquivalentTo(DSNode *Node) const;
|
virtual bool isEquivalentTo(DSNode *Node) const;
|
||||||
|
|
||||||
@ -393,6 +425,7 @@ public:
|
|||||||
//
|
//
|
||||||
std::map<Value*, PointerValSet> &getValueMap() { return ValueMap; }
|
std::map<Value*, PointerValSet> &getValueMap() { return ValueMap; }
|
||||||
|
|
||||||
|
const PointerValSet &getRetNodes() const { return RetNode; }
|
||||||
|
|
||||||
|
|
||||||
void printFunction(std::ostream &O, const char *Label) const;
|
void printFunction(std::ostream &O, const char *Label) const;
|
||||||
|
@ -131,6 +131,10 @@ public:
|
|||||||
assert(i < getNumLinks() && "Field links access out of range...");
|
assert(i < getNumLinks() && "Field links access out of range...");
|
||||||
return FieldLinks[i];
|
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...
|
// addReferrer - Keep the referrer set up to date...
|
||||||
void addReferrer(PointerValSet *PVS) { Referrers.push_back(PVS); }
|
void addReferrer(PointerValSet *PVS) { Referrers.push_back(PVS); }
|
||||||
@ -146,6 +150,18 @@ public:
|
|||||||
|
|
||||||
const Type *getType() const { return Ty; }
|
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;
|
void print(std::ostream &O) const;
|
||||||
|
|
||||||
virtual std::string getCaption() const = 0;
|
virtual std::string getCaption() const = 0;
|
||||||
@ -258,6 +274,22 @@ public:
|
|||||||
ArgLinks.clear();
|
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...
|
// isEquivalentTo - Return true if the nodes should be merged...
|
||||||
virtual bool isEquivalentTo(DSNode *Node) const;
|
virtual bool isEquivalentTo(DSNode *Node) const;
|
||||||
|
|
||||||
@ -393,6 +425,7 @@ public:
|
|||||||
//
|
//
|
||||||
std::map<Value*, PointerValSet> &getValueMap() { return ValueMap; }
|
std::map<Value*, PointerValSet> &getValueMap() { return ValueMap; }
|
||||||
|
|
||||||
|
const PointerValSet &getRetNodes() const { return RetNode; }
|
||||||
|
|
||||||
|
|
||||||
void printFunction(std::ostream &O, const char *Label) const;
|
void printFunction(std::ostream &O, const char *Label) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user