LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MachinePostDominators.h
Go to the documentation of this file.
1 //=- llvm/CodeGen/MachineDominators.h ----------------------------*- C++ -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes interfaces to post dominance information for
11 // target-specific code.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
16 #define LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
17 
21 
22 namespace llvm {
23 
24 ///
25 /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used
26 /// to compute the a post-dominator tree.
27 ///
29 private:
31 
32 public:
33  static char ID;
34 
36 
38 
40 
41  const std::vector<MachineBasicBlock *> &getRoots() const {
42  return DT->getRoots();
43  }
44 
46  return DT->getRootNode();
47  }
48 
50  return DT->getNode(BB);
51  }
52 
54  return DT->getNode(BB);
55  }
56 
58  const MachineDomTreeNode *B) const {
59  return DT->dominates(A, B);
60  }
61 
62  bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const {
63  return DT->dominates(A, B);
64  }
65 
67  const MachineDomTreeNode *B) const {
68  return DT->properlyDominates(A, B);
69  }
70 
72  const MachineBasicBlock *B) const {
73  return DT->properlyDominates(A, B);
74  }
75 
77  MachineBasicBlock *B) {
78  return DT->findNearestCommonDominator(A, B);
79  }
80 
81  virtual bool runOnMachineFunction(MachineFunction &MF);
82  virtual void getAnalysisUsage(AnalysisUsage &AU) const;
83  virtual void print(llvm::raw_ostream &OS, const Module *M = 0) const;
84 };
85 } //end of namespace llvm
86 
87 #endif
virtual bool runOnMachineFunction(MachineFunction &MF)
MachineDomTreeNode * getRootNode() const
The main container class for the LLVM Intermediate Representation.
Definition: Module.h:112
MachineBasicBlock * findNearestCommonDominator(MachineBasicBlock *A, MachineBasicBlock *B)
virtual void getAnalysisUsage(AnalysisUsage &AU) const
FunctionPass * createMachinePostDominatorTreePass()
bool properlyDominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const
bool properlyDominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
virtual void print(llvm::raw_ostream &OS, const Module *M=0) const
const std::vector< MachineBasicBlock * > & getRoots() const