LLVM API Documentation

MachineFunctionAnalysis.h
Go to the documentation of this file.
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_MACHINEFUNCTIONANALYSIS_H
00015 #define LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H
00016 
00017 #include "llvm/Pass.h"
00018 
00019 namespace llvm {
00020 
00021 class MachineFunction;
00022 class TargetMachine;
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   MachineFunction *MF;
00030   unsigned NextFnNum;
00031 public:
00032   static char ID;
00033   explicit MachineFunctionAnalysis(const TargetMachine &tm);
00034   ~MachineFunctionAnalysis();
00035 
00036   MachineFunction &getMF() const { return *MF; }
00037 
00038   const char* getPassName() const override {
00039     return "Machine Function Analysis";
00040   }
00041 
00042 private:
00043   bool doInitialization(Module &M) override;
00044   bool runOnFunction(Function &F) override;
00045   void releaseMemory() override;
00046   void getAnalysisUsage(AnalysisUsage &AU) const override;
00047 };
00048 
00049 } // End llvm namespace
00050 
00051 #endif