[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / CodeGen / MachinePostDominators.h
blobb67e6b52ac8fee120c6bd02d444734155419c623
1 //===- llvm/CodeGen/MachinePostDominators.h ----------------------*- C++ -*-==//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file exposes interfaces to post dominance information for
10 // target-specific code.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
15 #define LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
17 #include "llvm/CodeGen/MachineDominators.h"
18 #include "llvm/CodeGen/MachineFunctionPass.h"
20 namespace llvm {
22 ///
23 /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used
24 /// to compute the post-dominator tree.
25 ///
26 struct MachinePostDominatorTree : public MachineFunctionPass {
27 private:
28 PostDomTreeBase<MachineBasicBlock> *DT;
30 public:
31 static char ID;
33 MachinePostDominatorTree();
35 ~MachinePostDominatorTree() override;
37 FunctionPass *createMachinePostDominatorTreePass();
39 const SmallVectorImpl<MachineBasicBlock *> &getRoots() const {
40 return DT->getRoots();
43 MachineDomTreeNode *getRootNode() const {
44 return DT->getRootNode();
47 MachineDomTreeNode *operator[](MachineBasicBlock *BB) const {
48 return DT->getNode(BB);
51 MachineDomTreeNode *getNode(MachineBasicBlock *BB) const {
52 return DT->getNode(BB);
55 bool dominates(const MachineDomTreeNode *A,
56 const MachineDomTreeNode *B) const {
57 return DT->dominates(A, B);
60 bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const {
61 return DT->dominates(A, B);
64 bool properlyDominates(const MachineDomTreeNode *A,
65 const MachineDomTreeNode *B) const {
66 return DT->properlyDominates(A, B);
69 bool properlyDominates(const MachineBasicBlock *A,
70 const MachineBasicBlock *B) const {
71 return DT->properlyDominates(A, B);
74 MachineBasicBlock *findNearestCommonDominator(MachineBasicBlock *A,
75 MachineBasicBlock *B) {
76 return DT->findNearestCommonDominator(A, B);
79 bool runOnMachineFunction(MachineFunction &MF) override;
80 void getAnalysisUsage(AnalysisUsage &AU) const override;
81 void print(llvm::raw_ostream &OS, const Module *M = nullptr) const override;
83 } //end of namespace llvm
85 #endif