aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2020-04-03 15:55:15 -0700
committerDaniel Sanders <daniel_l_sanders@apple.com>2020-04-06 15:19:21 -0700
commit35b7b0851b1957d4f6f14f023eb3b4571cadc3d7 (patch)
treef1e54064bab99d55951002d66f57aa90f809555b /llvm/lib/CodeGen/MachineModuleInfo.cpp
parentbcf14f375e29b94e7abb381920df795eeefb2309 (diff)
downloadllvm-35b7b0851b1957d4f6f14f023eb3b4571cadc3d7.zip
llvm-35b7b0851b1957d4f6f14f023eb3b4571cadc3d7.tar.gz
llvm-35b7b0851b1957d4f6f14f023eb3b4571cadc3d7.tar.bz2
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp3
1 files changed, 1 insertions, 2 deletions
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)