[PATCH] D84274: Fixed move constructor of MMI to move MachineFunctions map

Sridhar Gopinath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 15:45:58 PDT 2020


sridhar_gopinath created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

The move constructor of MachineModuleInfo currently does not copy the MachineFunctions map. This commit fixes this issue.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84274

Files:
  llvm/lib/CodeGen/MachineModuleInfo.cpp


Index: llvm/lib/CodeGen/MachineModuleInfo.cpp
===================================================================
--- llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -178,7 +178,8 @@
 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84274.279645.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200721/27b721a7/attachment.bin>


More information about the llvm-commits mailing list