llvm.org GIT mirror llvm / fd4d897
Add new methods, update comments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7962 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
None //===- llvm/Analysis/Dominators.h - Dominator Info Calculation ---*- C++ -*--=//
0 //===- llvm/Analysis/Dominators.h - Dominator Info Calculation --*- C++ -*-===//
11 //
22 // This file defines the following classes:
33 // 1. DominatorSet: Calculates the [reverse] dominator set for a function
4545 //===----------------------------------------------------------------------===//
4646 //
4747 // DominatorSet - Maintain a set for every basic block in a
48 // function, that represents the blocks that dominate the block.
48 // function, that represents the blocks that dominate the block. If the block
49 // is unreachable in this function, the set will be empty. This cannot happen
50 // for reachable code, because every block dominates at least itself.
4951 //
5052 class DominatorSetBase : public DominatorBase {
5153 public:
7779 const_iterator I = find(BB);
7880 assert(I != end() && "BB not in function!");
7981 return I->second;
82 }
83
84 /// isReachable - Return true if the specified basicblock is reachable. If
85 /// the block is reachable, we have dominator set information for it.
86 bool isReachable(BasicBlock *BB) const {
87 return !getDominators(BB).empty();
8088 }
8189
8290 /// dominates - Return true if A dominates B.