1 //===- MachinePostDominators.cpp -Machine Post Dominator Calculation ------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements simple dominator construction algorithms for finding
10 // post dominators on machine functions.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/CodeGen/MachinePostDominators.h"
19 template class DominatorTreeBase
<MachineBasicBlock
, true>; // PostDomTreeBase
22 char MachinePostDominatorTree::ID
= 0;
24 //declare initializeMachinePostDominatorTreePass
25 INITIALIZE_PASS(MachinePostDominatorTree
, "machinepostdomtree",
26 "MachinePostDominator Tree Construction", true, true)
28 MachinePostDominatorTree::MachinePostDominatorTree() : MachineFunctionPass(ID
) {
29 initializeMachinePostDominatorTreePass(*PassRegistry::getPassRegistry());
30 DT
= new PostDomTreeBase
<MachineBasicBlock
>();
34 MachinePostDominatorTree::createMachinePostDominatorTreePass() {
35 return new MachinePostDominatorTree();
39 MachinePostDominatorTree::runOnMachineFunction(MachineFunction
&F
) {
44 MachinePostDominatorTree::~MachinePostDominatorTree() {
49 MachinePostDominatorTree::getAnalysisUsage(AnalysisUsage
&AU
) const {
51 MachineFunctionPass::getAnalysisUsage(AU
);
55 MachinePostDominatorTree::print(llvm::raw_ostream
&OS
, const Module
*M
) const {