llvm.org GIT mirror llvm / 7a5a3f7
Attach a GCModuleInfo to a MachineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117867 91177308-0d34-0410-b5e6-96231b3b80d8 Nicolas Geoffray 10 years ago
3 changed file(s) with 11 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2727
2828 class Value;
2929 class Function;
30 class GCModuleInfo;
3031 class MachineRegisterInfo;
3132 class MachineFrameInfo;
3233 class MachineConstantPool;
7475 const TargetMachine &Target;
7576 MCContext &Ctx;
7677 MachineModuleInfo &MMI;
78 GCModuleInfo *GMI;
7779
7880 // RegInfo - Information about each register in use in the function.
7981 MachineRegisterInfo *RegInfo;
126128 void operator=(const MachineFunction&); // DO NOT IMPLEMENT
127129 public:
128130 MachineFunction(const Function *Fn, const TargetMachine &TM,
129 unsigned FunctionNum, MachineModuleInfo &MMI);
131 unsigned FunctionNum, MachineModuleInfo &MMI,
132 GCModuleInfo* GMI);
130133 ~MachineFunction();
131134
132135 MachineModuleInfo &getMMI() const { return MMI; }
136 GCModuleInfo *getGMI() const { return GMI; }
133137 MCContext &getContext() const { return Ctx; }
134138
135139 /// getFunction - Return the LLVM function that this machine code represents
5151 }
5252
5353 MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
54 unsigned FunctionNum, MachineModuleInfo &mmi)
55 : Fn(F), Target(TM), Ctx(mmi.getContext()), MMI(mmi) {
54 unsigned FunctionNum, MachineModuleInfo &mmi,
55 GCModuleInfo* gmi)
56 : Fn(F), Target(TM), Ctx(mmi.getContext()), MMI(mmi), GMI(gmi) {
5657 if (TM.getRegisterInfo())
5758 RegInfo = new (Allocator) MachineRegisterInfo(*TM.getRegisterInfo());
5859 else
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
14 #include "llvm/CodeGen/GCMetadata.h"
1415 #include "llvm/CodeGen/MachineFunction.h"
1516 #include "llvm/CodeGen/MachineModuleInfo.h"
1617 using namespace llvm;
5152 bool MachineFunctionAnalysis::runOnFunction(Function &F) {
5253 assert(!MF && "MachineFunctionAnalysis already initialized!");
5354 MF = new MachineFunction(&F, TM, NextFnNum++,
54 getAnalysis());
55 getAnalysis(),
56 getAnalysisIfAvailable());
5557 return false;
5658 }
5759