From 35b7b0851b1957d4f6f14f023eb3b4571cadc3d7 Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Fri, 3 Apr 2020 15:55:15 -0700 Subject: Allow MachineFunction to obtain non-const Function (to enable MIR-level debugify) Summary: To debugify MIR, we need to be able to create metadata and to do that, we need a non-const Module. However, MachineFunction only had a const reference to the Function preventing this. Reviewers: aprantl, bogner Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77439 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index a55943aff..f866c7c 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -225,8 +225,7 @@ MachineModuleInfo::getMachineFunction(const Function &F) const { return I != MachineFunctions.end() ? I->second.get() : nullptr; } -MachineFunction & -MachineModuleInfo::getOrCreateMachineFunction(const Function &F) { +MachineFunction &MachineModuleInfo::getOrCreateMachineFunction(Function &F) { // Shortcut for the common case where a sequence of MachineFunctionPasses // all query for the same Function. if (LastRequest == &F) -- cgit v1.1