[MC][nfc] Don't use a value after it has been std::move()'d
authorJez Ng <jezng@fb.com>
Thu, 23 Feb 2023 20:15:14 +0000 (15:15 -0500)
committerJez Ng <jezng@fb.com>
Thu, 23 Feb 2023 20:15:24 +0000 (15:15 -0500)
Reviewed By: serge-sans-paille

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

llvm/lib/CodeGen/MachineModuleInfo.cpp

index a0c0166..b9bf0a0 100644 (file)
@@ -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;