summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
diff options
context:
space:
mode:
authorAkshat Oke <Akshat.Oke@amd.com>2025-05-19 11:02:19 +0000
committerAkshat Oke <Akshat.Oke@amd.com>2025-05-19 11:12:09 +0000
commit8c46890c0e04500528155f1dab2300969bfef1ce (patch)
tree42e85e1e01ac33f344239d3a89d3be7a37a91042 /llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
parent61d3ad963c9a8764a20c01c26374000d9ba5975d (diff)
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleSlotTracker.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleSlotTracker.cpp9
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);