diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleSlotTracker.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineModuleSlotTracker.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp b/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp index 8f10435e7998..ad2a4acc690d 100644 --- a/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp +++ b/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp @@ -39,7 +39,7 @@ void MachineModuleSlotTracker::processMachineModule( if (&F != &TheFunction) continue; MDNStartSlot = AST->getNextMetadataSlot(); - if (auto *MF = TheMMI.getMachineFunction(F)) + if (auto *MF = MachineFunctionGetterFn(F)) processMachineFunctionMetadata(AST, *MF); MDNEndSlot = AST->getNextMetadataSlot(); break; @@ -52,7 +52,7 @@ void MachineModuleSlotTracker::processMachineFunction( bool ShouldInitializeAllMetadata) { if (!ShouldInitializeAllMetadata && F == &TheFunction) { MDNStartSlot = AST->getNextMetadataSlot(); - if (auto *MF = TheMMI.getMachineFunction(*F)) + if (auto *MF = MachineFunctionGetterFn(*F)) processMachineFunctionMetadata(AST, *MF); MDNEndSlot = AST->getNextMetadataSlot(); } @@ -64,11 +64,10 @@ void MachineModuleSlotTracker::collectMachineMDNodes( } MachineModuleSlotTracker::MachineModuleSlotTracker( - const MachineModuleInfo &MMI, const MachineFunction *MF, - bool ShouldInitializeAllMetadata) + MFGetterFnT Fn, const MachineFunction *MF, bool ShouldInitializeAllMetadata) : ModuleSlotTracker(MF->getFunction().getParent(), ShouldInitializeAllMetadata), - TheFunction(MF->getFunction()), TheMMI(MMI) { + TheFunction(MF->getFunction()), MachineFunctionGetterFn(Fn) { setProcessHook([this](AbstractSlotTrackerStorage *AST, const Module *M, bool ShouldInitializeAllMetadata) { this->processMachineModule(AST, M, ShouldInitializeAllMetadata); |
