LLVM  3.7.0
MachineFunctionAnalysis.h
Go to the documentation of this file.
1 //===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the MachineFunctionAnalysis class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H
15 #define LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H
16 
17 #include "llvm/Pass.h"
18 
19 namespace llvm {
20 
21 class MachineFunction;
22 class MachineFunctionInitializer;
23 class TargetMachine;
24 
25 /// MachineFunctionAnalysis - This class is a Pass that manages a
26 /// MachineFunction object.
28 private:
29  const TargetMachine &TM;
30  MachineFunction *MF;
31  unsigned NextFnNum;
32  MachineFunctionInitializer *MFInitializer;
33 
34 public:
35  static char ID;
36  explicit MachineFunctionAnalysis(const TargetMachine &tm,
37  MachineFunctionInitializer *MFInitializer);
38  ~MachineFunctionAnalysis() override;
39 
40  MachineFunction &getMF() const { return *MF; }
41 
42  const char* getPassName() const override {
43  return "Machine Function Analysis";
44  }
45 
46 private:
47  bool doInitialization(Module &M) override;
48  bool runOnFunction(Function &F) override;
49  void releaseMemory() override;
50  void getAnalysisUsage(AnalysisUsage &AU) const override;
51 };
52 
53 } // End llvm namespace
54 
55 #endif
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:114
const char * getPassName() const override
getPassName - Return a nice clean name for a pass.
F(f)
MachineFunctionAnalysis - This class is a Pass that manages a MachineFunction object.
MachineFunction & getMF() const
MachineFunctionAnalysis(const TargetMachine &tm, MachineFunctionInitializer *MFInitializer)
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:294
Primary interface to the complete machine description for the target machine.
This interface provides a way to initialize machine functions after they are created by the machine f...