LLVM API Documentation

MachineDominanceFrontier.h
Go to the documentation of this file.
00001 //===- llvm/CodeGen/MachineDominanceFrontier.h ------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_CODEGEN_MACHINEDOMINANCEFRONTIER_H
00011 #define LLVM_CODEGEN_MACHINEDOMINANCEFRONTIER_H
00012 
00013 #include "llvm/Analysis/DominanceFrontier.h"
00014 #include "llvm/CodeGen/MachineBasicBlock.h"
00015 #include "llvm/CodeGen/MachineFunctionPass.h"
00016 
00017 
00018 namespace llvm {
00019 
00020 class MachineDominanceFrontier : public MachineFunctionPass {
00021   ForwardDominanceFrontierBase<MachineBasicBlock> Base;
00022 public:
00023   typedef DominatorTreeBase<MachineBasicBlock> DomTreeT;
00024   typedef DomTreeNodeBase<MachineBasicBlock> DomTreeNodeT;
00025   typedef DominanceFrontierBase<MachineBasicBlock>::DomSetType DomSetType;
00026   typedef DominanceFrontierBase<MachineBasicBlock>::iterator iterator;
00027   typedef DominanceFrontierBase<MachineBasicBlock>::const_iterator const_iterator;
00028 
00029   void operator=(const MachineDominanceFrontier &) LLVM_DELETED_FUNCTION;
00030   MachineDominanceFrontier(const MachineDominanceFrontier &) LLVM_DELETED_FUNCTION;
00031 
00032   static char ID;
00033 
00034   MachineDominanceFrontier();
00035 
00036   DominanceFrontierBase<MachineBasicBlock> &getBase() {
00037     return Base;
00038   }
00039 
00040   inline const std::vector<MachineBasicBlock*> &getRoots() const {
00041     return Base.getRoots();
00042   }
00043 
00044   MachineBasicBlock *getRoot() const {
00045     return Base.getRoot();
00046   }
00047 
00048   bool isPostDominator() const {
00049     return Base.isPostDominator();
00050   }
00051 
00052   iterator begin() {
00053     return Base.begin();
00054   }
00055 
00056   const_iterator begin() const {
00057     return Base.begin();
00058   }
00059 
00060   iterator end() {
00061     return Base.end();
00062   }
00063 
00064   const_iterator end() const {
00065     return Base.end();
00066   }
00067 
00068   iterator find(MachineBasicBlock *B) {
00069     return Base.find(B);
00070   }
00071 
00072   const_iterator find(MachineBasicBlock *B) const {
00073     return Base.find(B);
00074   }
00075 
00076   iterator addBasicBlock(MachineBasicBlock *BB, const DomSetType &frontier) {
00077     return Base.addBasicBlock(BB, frontier);
00078   }
00079 
00080   void removeBlock(MachineBasicBlock *BB) {
00081     return Base.removeBlock(BB);
00082   }
00083 
00084   void addToFrontier(iterator I, MachineBasicBlock *Node) {
00085     return Base.addToFrontier(I, Node);
00086   }
00087 
00088   void removeFromFrontier(iterator I, MachineBasicBlock *Node) {
00089     return Base.removeFromFrontier(I, Node);
00090   }
00091 
00092   bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const {
00093     return Base.compareDomSet(DS1, DS2);
00094   }
00095 
00096   bool compare(DominanceFrontierBase<MachineBasicBlock> &Other) const {
00097     return Base.compare(Other);
00098   }
00099 
00100   bool runOnMachineFunction(MachineFunction &F) override;
00101 
00102   void releaseMemory() override;
00103 
00104   void getAnalysisUsage(AnalysisUsage &AU) const override;
00105 };
00106 
00107 }
00108 
00109 #endif