Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:30

0001 //===- llvm/CodeGen/MachineDominanceFrontier.h ------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CODEGEN_MACHINEDOMINANCEFRONTIER_H
0010 #define LLVM_CODEGEN_MACHINEDOMINANCEFRONTIER_H
0011 
0012 #include "llvm/Analysis/DominanceFrontier.h"
0013 #include "llvm/Analysis/DominanceFrontierImpl.h"
0014 #include "llvm/CodeGen/MachineBasicBlock.h"
0015 #include "llvm/CodeGen/MachineFunctionPass.h"
0016 #include "llvm/Support/GenericDomTree.h"
0017 
0018 namespace llvm {
0019 
0020 class MachineDominanceFrontier : public MachineFunctionPass {
0021   ForwardDominanceFrontierBase<MachineBasicBlock> Base;
0022 
0023 public:
0024  using DomTreeT = DomTreeBase<MachineBasicBlock>;
0025  using DomTreeNodeT = DomTreeNodeBase<MachineBasicBlock>;
0026  using DomSetType = DominanceFrontierBase<MachineBasicBlock, false>::DomSetType;
0027  using iterator = DominanceFrontierBase<MachineBasicBlock, false>::iterator;
0028  using const_iterator =
0029      DominanceFrontierBase<MachineBasicBlock, false>::const_iterator;
0030 
0031  MachineDominanceFrontier(const MachineDominanceFrontier &) = delete;
0032  MachineDominanceFrontier &operator=(const MachineDominanceFrontier &) = delete;
0033 
0034  static char ID;
0035 
0036  MachineDominanceFrontier();
0037 
0038  ForwardDominanceFrontierBase<MachineBasicBlock> &getBase() { return Base; }
0039 
0040  const SmallVectorImpl<MachineBasicBlock *> &getRoots() const {
0041    return Base.getRoots();
0042   }
0043 
0044   MachineBasicBlock *getRoot() const {
0045     return Base.getRoot();
0046   }
0047 
0048   bool isPostDominator() const {
0049     return Base.isPostDominator();
0050   }
0051 
0052   iterator begin() {
0053     return Base.begin();
0054   }
0055 
0056   const_iterator begin() const {
0057     return Base.begin();
0058   }
0059 
0060   iterator end() {
0061     return Base.end();
0062   }
0063 
0064   const_iterator end() const {
0065     return Base.end();
0066   }
0067 
0068   iterator find(MachineBasicBlock *B) {
0069     return Base.find(B);
0070   }
0071 
0072   const_iterator find(MachineBasicBlock *B) const {
0073     return Base.find(B);
0074   }
0075 
0076   bool runOnMachineFunction(MachineFunction &F) override;
0077 
0078   void releaseMemory() override;
0079 
0080   void getAnalysisUsage(AnalysisUsage &AU) const override;
0081 };
0082 
0083 } // end namespace llvm
0084 
0085 #endif // LLVM_CODEGEN_MACHINEDOMINANCEFRONTIER_H