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_MACHINEFUNCTIONANALYSIS_H
15 #define LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H
17 #include "llvm/Pass.h"
21 class MachineFunction;
22 class MachineFunctionInitializer;
25 /// MachineFunctionAnalysis - This class is a Pass that manages a
26 /// MachineFunction object.
27 struct MachineFunctionAnalysis : public FunctionPass {
29 const TargetMachine &TM;
32 MachineFunctionInitializer *MFInitializer;
36 explicit MachineFunctionAnalysis(const TargetMachine &tm,
37 MachineFunctionInitializer *MFInitializer);
38 ~MachineFunctionAnalysis() override;
40 MachineFunction &getMF() const { return *MF; }
42 const char* getPassName() const override {
43 return "Machine Function Analysis";
47 bool doInitialization(Module &M) override;
48 bool runOnFunction(Function &F) override;
49 void releaseMemory() override;
50 void getAnalysisUsage(AnalysisUsage &AU) const override;
53 } // End llvm namespace