comparison lib/CodeGen/MachineDominanceFrontier.cpp @ 77:54457678186b LLVM3.6

LLVM 3.6
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Mon, 08 Sep 2014 22:06:00 +0900
parents
children 60c9769439b8
comparison
equal deleted inserted replaced
34:e874dbf0ad9d 77:54457678186b
1 //===- MachineDominanceFrontier.cpp ---------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "llvm/CodeGen/MachineDominanceFrontier.h"
11 #include "llvm/CodeGen/MachineDominators.h"
12 #include "llvm/Analysis/DominanceFrontierImpl.h"
13 #include "llvm/CodeGen/Passes.h"
14
15
16 using namespace llvm;
17
18 namespace llvm {
19 template class DominanceFrontierBase<MachineBasicBlock>;
20 template class ForwardDominanceFrontierBase<MachineBasicBlock>;
21 }
22
23
24 char MachineDominanceFrontier::ID = 0;
25
26 INITIALIZE_PASS_BEGIN(MachineDominanceFrontier, "machine-domfrontier",
27 "Machine Dominance Frontier Construction", true, true)
28 INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
29 INITIALIZE_PASS_END(MachineDominanceFrontier, "machine-domfrontier",
30 "Machine Dominance Frontier Construction", true, true)
31
32 MachineDominanceFrontier::MachineDominanceFrontier()
33 : MachineFunctionPass(ID),
34 Base() {
35 initializeMachineDominanceFrontierPass(*PassRegistry::getPassRegistry());
36 }
37
38 char &llvm::MachineDominanceFrontierID = MachineDominanceFrontier::ID;
39
40 bool MachineDominanceFrontier::runOnMachineFunction(MachineFunction &) {
41 releaseMemory();
42 Base.analyze(getAnalysis<MachineDominatorTree>().getBase());
43 return false;
44 }
45
46 void MachineDominanceFrontier::releaseMemory() {
47 Base.releaseMemory();
48 }
49
50 void MachineDominanceFrontier::getAnalysisUsage(AnalysisUsage &AU) const {
51 AU.setPreservesAll();
52 AU.addRequired<MachineDominatorTree>();
53 MachineFunctionPass::getAnalysisUsage(AU);
54 }