[llvm] 865c2b0 - [MC][nfc] Don't use a value after it has been std::move()'d

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 12:15:36 PST 2023


Author: Jez Ng
Date: 2023-02-23T15:15:24-05:00
New Revision: 865c2b0d153fbdd39f1f3e68b0bba6e634cc566d

URL: https://github.com/llvm/llvm-project/commit/865c2b0d153fbdd39f1f3e68b0bba6e634cc566d
DIFF: https://github.com/llvm/llvm-project/commit/865c2b0d153fbdd39f1f3e68b0bba6e634cc566d.diff

LOG: [MC][nfc] Don't use a value after it has been std::move()'d

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D144662

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineModuleInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index a0c0166d06f0..b9bf0a03dd33 100644
--- a/llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -56,11 +56,10 @@ void MachineModuleInfo::finalize() {
 
 MachineModuleInfo::MachineModuleInfo(MachineModuleInfo &&MMI)
     : TM(std::move(MMI.TM)),
-      Context(MMI.TM.getTargetTriple(), MMI.TM.getMCAsmInfo(),
-              MMI.TM.getMCRegisterInfo(), MMI.TM.getMCSubtargetInfo(), nullptr,
-              &MMI.TM.Options.MCOptions, false),
+      Context(TM.getTargetTriple(), TM.getMCAsmInfo(), TM.getMCRegisterInfo(),
+              TM.getMCSubtargetInfo(), nullptr, &TM.Options.MCOptions, false),
       MachineFunctions(std::move(MMI.MachineFunctions)) {
-  Context.setObjectFileInfo(MMI.TM.getObjFileLowering());
+  Context.setObjectFileInfo(TM.getObjFileLowering());
   ObjFileMMI = MMI.ObjFileMMI;
   CurCallSite = MMI.CurCallSite;
   ExternalContext = MMI.ExternalContext;


        


More information about the llvm-commits mailing list