[llvm] 4b5412b - Fix the move constructor of MMI to move MachineFunctions map

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 14:10:33 PDT 2020


Author: Sridhar Gopinath
Date: 2020-07-27T14:10:05-07:00
New Revision: 4b5412b5dbc87096e420de5172837b4bd5ab9485

URL: https://github.com/llvm/llvm-project/commit/4b5412b5dbc87096e420de5172837b4bd5ab9485
DIFF: https://github.com/llvm/llvm-project/commit/4b5412b5dbc87096e420de5172837b4bd5ab9485.diff

LOG: 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

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineModuleInfo.cpp

Removed: 
    


################################################################################
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;


        


More information about the llvm-commits mailing list