LLVM API Documentation
00001 //===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-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 // This file declares the MachineFunctionAnalysis class. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H 00015 #define LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H 00016 00017 #include "llvm/Pass.h" 00018 #include "llvm/Target/TargetMachine.h" 00019 00020 namespace llvm { 00021 00022 class MachineFunction; 00023 00024 /// MachineFunctionAnalysis - This class is a Pass that manages a 00025 /// MachineFunction object. 00026 struct MachineFunctionAnalysis : public FunctionPass { 00027 private: 00028 const TargetMachine &TM; 00029 CodeGenOpt::Level OptLevel; 00030 MachineFunction *MF; 00031 00032 public: 00033 static char ID; 00034 explicit MachineFunctionAnalysis(TargetMachine &tm, 00035 CodeGenOpt::Level OL = CodeGenOpt::Default); 00036 ~MachineFunctionAnalysis(); 00037 00038 MachineFunction &getMF() const { return *MF; } 00039 CodeGenOpt::Level getOptLevel() const { return OptLevel; } 00040 00041 private: 00042 virtual bool runOnFunction(Function &F); 00043 virtual void releaseMemory(); 00044 virtual void getAnalysisUsage(AnalysisUsage &AU) const; 00045 }; 00046 00047 } // End llvm namespace 00048 00049 #endif