diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-06 06:15:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-06 06:15:43 +0000 |
commit | 0741275a3bf30622dd1d2b0024408b522f7e2ad4 (patch) | |
tree | ba4f695aa00e86e765eec6c11d636103720cb45a /include/llvm/Analysis | |
parent | 76f73d1da3c23240050426d7eb51dc19f4484d61 (diff) | |
download | external_llvm-0741275a3bf30622dd1d2b0024408b522f7e2ad4.zip external_llvm-0741275a3bf30622dd1d2b0024408b522f7e2ad4.tar.gz external_llvm-0741275a3bf30622dd1d2b0024408b522f7e2ad4.tar.bz2 |
Various random cleanups, add two accessors to DomTreeNode: getDFSNumIn/getDFSNumOut
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 0ee71b1..7c7c567 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -76,17 +76,23 @@ public: const_iterator begin() const { return Children.begin(); } const_iterator end() const { return Children.end(); } - inline BasicBlock *getBlock() const { return TheBB; } - inline DomTreeNode *getIDom() const { return IDom; } - inline const std::vector<DomTreeNode*> &getChildren() const { return Children; } + BasicBlock *getBlock() const { return TheBB; } + DomTreeNode *getIDom() const { return IDom; } + const std::vector<DomTreeNode*> &getChildren() const { return Children; } - inline DomTreeNode(BasicBlock *BB, DomTreeNode *iDom) + DomTreeNode(BasicBlock *BB, DomTreeNode *iDom) : TheBB(BB), IDom(iDom), DFSNumIn(-1), DFSNumOut(-1) { } - inline DomTreeNode *addChild(DomTreeNode *C) { Children.push_back(C); return C; } + DomTreeNode *addChild(DomTreeNode *C) { Children.push_back(C); return C; } void setIDom(DomTreeNode *NewIDom); + + /// getDFSNumIn/getDFSNumOut - These are an internal implementation detail, do + /// not call them. + unsigned getDFSNumIn() const { return DFSNumIn; } + unsigned getDFSNumOut() const { return DFSNumOut; } private: - // Return true if this node is dominated by other. Use this only if DFS info is valid. + // Return true if this node is dominated by other. Use this only if DFS info + // is valid. bool DominatedBy(const DomTreeNode *other) const { return this->DFSNumIn >= other->DFSNumIn && this->DFSNumOut <= other->DFSNumOut; @@ -118,7 +124,7 @@ protected: std::vector<BasicBlock*> Bucket; - InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){} + InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0) {} }; DenseMap<BasicBlock*, BasicBlock*> IDoms; @@ -416,9 +422,8 @@ public: AU.addRequired<DominatorTree>(); } - /// splitBlock - /// BB is split and now it has one successor. Update dominace frontier to - /// reflect this change. + /// splitBlock - BB is split and now it has one successor. Update dominance + /// frontier to reflect this change. void splitBlock(BasicBlock *BB); private: |