1 //===- MachinePostDominators.cpp -Machine Post Dominator Calculation ------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements simple dominator construction algorithms for finding
11 // post dominators on machine functions.
13 //===----------------------------------------------------------------------===//
15 #include "llvm/CodeGen/MachinePostDominators.h"
19 char MachinePostDominatorTree::ID = 0;
21 //declare initializeMachinePostDominatorTreePass
22 INITIALIZE_PASS(MachinePostDominatorTree, "machinepostdomtree",
23 "MachinePostDominator Tree Construction", true, true)
25 MachinePostDominatorTree::MachinePostDominatorTree() : MachineFunctionPass(ID) {
26 initializeMachinePostDominatorTreePass(*PassRegistry::getPassRegistry());
27 DT = new DominatorTreeBase<MachineBasicBlock>(true); //true indicate
32 MachinePostDominatorTree::createMachinePostDominatorTreePass() {
33 return new MachinePostDominatorTree();
37 MachinePostDominatorTree::runOnMachineFunction(MachineFunction &F) {
42 MachinePostDominatorTree::~MachinePostDominatorTree() {
47 MachinePostDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const {
49 MachineFunctionPass::getAnalysisUsage(AU);
53 MachinePostDominatorTree::print(llvm::raw_ostream &OS, const Module *M) const {