From 4b5412b5dbc87096e420de5172837b4bd5ab9485 Mon Sep 17 00:00:00 2001 From: Sridhar Gopinath Date: Fri, 24 Jul 2020 10:44:48 -0700 Subject: [PATCH] Fix the move constructor of MMI to move MachineFunctions map The move constructor of MachineModuleInfo currently does not copy the MachineFunctions map. This commit fixes this issue. Patch by Sridhar Gopinath. Thanks! Differential Revision: https://reviews.llvm.org/D84274 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index f866c7ca53c6..be08f0ae3117 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -178,7 +178,8 @@ void MachineModuleInfo::finalize() { MachineModuleInfo::MachineModuleInfo(MachineModuleInfo &&MMI) : TM(std::move(MMI.TM)), Context(MMI.TM.getMCAsmInfo(), MMI.TM.getMCRegisterInfo(), - MMI.TM.getObjFileLowering(), nullptr, nullptr, false) { + MMI.TM.getObjFileLowering(), nullptr, nullptr, false), + MachineFunctions(std::move(MMI.MachineFunctions)) { ObjFileMMI = MMI.ObjFileMMI; CurCallSite = MMI.CurCallSite; UsesMSVCFloatingPoint = MMI.UsesMSVCFloatingPoint; -- 2.34.1