1 //===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===//
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 declares the MachineFunctionAnalysis class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H
15 #define LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H
17 #include "llvm/Pass.h"
18 #include "llvm/Target/TargetMachine.h"
22 class MachineFunction;
24 /// MachineFunctionAnalysis - This class is a Pass that manages a
25 /// MachineFunction object.
26 struct MachineFunctionAnalysis : public FunctionPass {
28 const TargetMachine &TM;
29 CodeGenOpt::Level OptLevel;
34 explicit MachineFunctionAnalysis(const TargetMachine &tm,
35 CodeGenOpt::Level OL = CodeGenOpt::Default);
36 ~MachineFunctionAnalysis();
38 MachineFunction &getMF() const { return *MF; }
39 CodeGenOpt::Level getOptLevel() const { return OptLevel; }
42 virtual bool doInitialization(Module &M);
43 virtual bool runOnFunction(Function &F);
44 virtual void releaseMemory();
45 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
48 } // End llvm namespace