LLVM API Documentation

MachineDominanceFrontier.cpp
Go to the documentation of this file.
00001 //===- MachineDominanceFrontier.cpp ---------------------------------------===//
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 #include "llvm/CodeGen/MachineDominanceFrontier.h"
00011 #include "llvm/CodeGen/MachineDominators.h"
00012 #include "llvm/Analysis/DominanceFrontierImpl.h"
00013 #include "llvm/CodeGen/Passes.h"
00014 
00015 
00016 using namespace llvm;
00017 
00018 namespace llvm {
00019 template class DominanceFrontierBase<MachineBasicBlock>;
00020 template class ForwardDominanceFrontierBase<MachineBasicBlock>;
00021 }
00022 
00023 
00024 char MachineDominanceFrontier::ID = 0;
00025 
00026 INITIALIZE_PASS_BEGIN(MachineDominanceFrontier, "machine-domfrontier",
00027                 "Machine Dominance Frontier Construction", true, true)
00028 INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
00029 INITIALIZE_PASS_END(MachineDominanceFrontier, "machine-domfrontier",
00030                 "Machine Dominance Frontier Construction", true, true)
00031 
00032 MachineDominanceFrontier::MachineDominanceFrontier()
00033   : MachineFunctionPass(ID),
00034     Base() {
00035   initializeMachineDominanceFrontierPass(*PassRegistry::getPassRegistry());
00036 }
00037 
00038 char &llvm::MachineDominanceFrontierID = MachineDominanceFrontier::ID;
00039 
00040 bool MachineDominanceFrontier::runOnMachineFunction(MachineFunction &) {
00041   releaseMemory();
00042   Base.analyze(getAnalysis<MachineDominatorTree>().getBase());
00043   return false;
00044 }
00045 
00046 void MachineDominanceFrontier::releaseMemory() {
00047   Base.releaseMemory();
00048 }
00049 
00050 void MachineDominanceFrontier::getAnalysisUsage(AnalysisUsage &AU) const {
00051   AU.setPreservesAll();
00052   AU.addRequired<MachineDominatorTree>();
00053   MachineFunctionPass::getAnalysisUsage(AU);
00054 }