Changes to compile with GCC 2.96

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@745 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-10-13 06:25:03 +00:00
parent a0d7f9dbb7
commit c5a22ce2b9

View File

@ -126,33 +126,36 @@ public:
// DominatorTree - Calculate the immediate dominator tree for a method.
//
class DominatorTree : public DominatorBase {
class Node;
class Node2;
public:
typedef Node2 Node;
private:
map<const BasicBlock*, Node*> Nodes;
void calculate(const DominatorSet &DS);
typedef map<const BasicBlock*, Node*> NodeMapType;
public:
class Node : public vector<Node*> {
class Node2 : public vector<Node*> {
friend class DominatorTree;
const BasicBlock *TheNode;
Node * const IDom;
Node2 * const IDom;
public:
inline const BasicBlock *getNode() const { return TheNode; }
inline Node *getIDom() const { return IDom; }
inline Node2 *getIDom() const { return IDom; }
inline const vector<Node*> &getChildren() const { return *this; }
// dominates - Returns true iff this dominates N. Note that this is not a
// constant time operation!
inline bool dominates(const Node *N) const {
const Node *IDom;
inline bool dominates(const Node2 *N) const {
const Node2 *IDom;
while ((IDom = N->getIDom()) != 0 && IDom != this)
N = IDom; // Walk up the tree
return IDom != 0;
}
private:
inline Node(const BasicBlock *node, Node *iDom)
inline Node2(const BasicBlock *node, Node *iDom)
: TheNode(node), IDom(iDom) {}
inline Node *addChild(Node *C) { push_back(C); return C; }
inline Node2 *addChild(Node *C) { push_back(C); return C; }
};
public:
@ -177,6 +180,7 @@ public:
// DominanceFrontier - Calculate the dominance frontiers for a method.
//
class DominanceFrontier : public DominatorBase {
public:
typedef set<const BasicBlock*> DomSetType; // Dom set for a bb
typedef map<const BasicBlock *, DomSetType> DomSetMapType; // Map of dom sets
private: