1 //===-- MachineFunctionAnalysis.cpp ---------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the definitions of the MachineFunctionAnalysis members.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
15 #include "llvm/CodeGen/MachineFunction.h"
18 // Register this pass with PassInfo directly to avoid having to define
19 // a default constructor.
21 X("Machine Function Analysis", "machine-function-analysis",
22 intptr_t(&MachineFunctionAnalysis::ID
), 0,
23 /*CFGOnly=*/false, /*is_analysis=*/true);
25 char MachineFunctionAnalysis::ID
= 0;
27 MachineFunctionAnalysis::MachineFunctionAnalysis(TargetMachine
&tm
,
28 CodeGenOpt::Level OL
) :
29 FunctionPass(&ID
), TM(tm
), OptLevel(OL
), MF(0) {
32 MachineFunctionAnalysis::~MachineFunctionAnalysis() {
33 assert(!MF
&& "MachineFunctionAnalysis left initialized!");
36 bool MachineFunctionAnalysis::runOnFunction(Function
&F
) {
37 assert(!MF
&& "MachineFunctionAnalysis already initialized!");
38 MF
= new MachineFunction(&F
, TM
);
42 void MachineFunctionAnalysis::releaseMemory() {
47 void MachineFunctionAnalysis::getAnalysisUsage(AnalysisUsage
&AU
) const {