diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/CodeGen/MachineModuleInfo.cpp | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index a0c0166d06f0..921feb253d64 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -56,11 +56,10 @@ void MachineModuleInfo::finalize() { MachineModuleInfo::MachineModuleInfo(MachineModuleInfo &&MMI) : TM(std::move(MMI.TM)), - Context(MMI.TM.getTargetTriple(), MMI.TM.getMCAsmInfo(), - MMI.TM.getMCRegisterInfo(), MMI.TM.getMCSubtargetInfo(), nullptr, - &MMI.TM.Options.MCOptions, false), + Context(TM.getTargetTriple(), TM.getMCAsmInfo(), TM.getMCRegisterInfo(), + TM.getMCSubtargetInfo(), nullptr, &TM.Options.MCOptions, false), MachineFunctions(std::move(MMI.MachineFunctions)) { - Context.setObjectFileInfo(MMI.TM.getObjFileLowering()); + Context.setObjectFileInfo(TM.getObjFileLowering()); ObjFileMMI = MMI.ObjFileMMI; CurCallSite = MMI.CurCallSite; ExternalContext = MMI.ExternalContext; @@ -107,6 +106,10 @@ MachineFunction &MachineModuleInfo::getOrCreateMachineFunction(Function &F) { const TargetSubtargetInfo &STI = *TM.getSubtargetImpl(F); MF = new MachineFunction(F, TM, STI, NextFnNum++, *this); MF->initTargetMachineFunctionInfo(STI); + + // MRI callback for target specific initializations. + TM.registerMachineRegisterInfoCallback(*MF); + // Update the set entry. I.first->second.reset(MF); } else { |