]> granicus.if.org Git - llvm/commitdiff
[X86] Fix several places that weren't passing what they though they were to MachineIn...
authorCraig Topper <craig.topper@intel.com>
Sun, 2 Jun 2019 01:36:48 +0000 (01:36 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 2 Jun 2019 01:36:48 +0000 (01:36 +0000)
Over a year ago, MachineInstr gained a fourth boolean parameter that occurs
before the TII pointer. When this happened, several places started accidentally
passing TII into this boolean parameter instead of the TII parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362312 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveDebugValues.cpp
lib/CodeGen/MachineCombiner.cpp
lib/CodeGen/MachineInstr.cpp
unittests/CodeGen/MachineInstrTest.cpp

index 2ac3fe20fffb2ebc09f1e7c4342b0d46a1150644..7f95e12186f35dd926df417c893b57c9df1980a2 100644 (file)
@@ -457,7 +457,9 @@ void LiveDebugValues::insertTransferDebugPair(
     VarLoc VL(*NewDebugInstr, LS);
     ProcessVarLoc(VL, NewDebugInstr);
     LLVM_DEBUG(dbgs() << "Creating DBG_VALUE inst for register copy: ";
-               NewDebugInstr->print(dbgs(), false, false, false, TII));
+               NewDebugInstr->print(dbgs(), /*IsStandalone*/false,
+                                    /*SkipOpers*/false, /*SkipDebugLoc*/false,
+                                    /*AddNewLine*/true, TII));
     return;
   }
   case TransferKind::TransferSpill: {
@@ -474,7 +476,9 @@ void LiveDebugValues::insertTransferDebugPair(
               SpillLocation.SpillOffset, LS);
     ProcessVarLoc(VL, NewDebugInstr);
     LLVM_DEBUG(dbgs() << "Creating DBG_VALUE inst for spill: ";
-               NewDebugInstr->print(dbgs(), false, false, false, TII));
+               NewDebugInstr->print(dbgs(), /*IsStandalone*/false,
+                                    /*SkipOpers*/false, /*SkipDebugLoc*/false,
+                                    /*AddNewLine*/true, TII));
     return;
   }
   case TransferKind::TransferRestore: {
@@ -488,7 +492,9 @@ void LiveDebugValues::insertTransferDebugPair(
     VarLoc VL(*NewDebugInstr, LS);
     ProcessVarLoc(VL, NewDebugInstr);
     LLVM_DEBUG(dbgs() << "Creating DBG_VALUE inst for register restore: ";
-               NewDebugInstr->print(dbgs(), false, false, false, TII));
+               NewDebugInstr->print(dbgs(), /*IsStandalone*/false,
+                                    /*SkipOpers*/false, /*SkipDebugLoc*/false,
+                                    /*AddNewLine*/true, TII));
     return;
   }
   }
index 218484715db63ae3f660fa03108ebf2c38f6bb01..0584ec0bd2b313e9bbc06d33d42c72b66584785f 100644 (file)
@@ -561,10 +561,12 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
         dbgs() << "\tFor the Pattern (" << (int)P
                << ") these instructions could be removed\n";
         for (auto const *InstrPtr : DelInstrs)
-          InstrPtr->print(dbgs(), false, false, false, TII);
+          InstrPtr->print(dbgs(), /*IsStandalone*/false, /*SkipOpers*/false,
+                          /*SkipDebugLoc*/false, /*AddNewLine*/true, TII);
         dbgs() << "\tThese instructions could replace the removed ones\n";
         for (auto const *InstrPtr : InsInstrs)
-          InstrPtr->print(dbgs(), false, false, false, TII);
+          InstrPtr->print(dbgs(), /*IsStandalone*/false, /*SkipOpers*/false,
+                          /*SkipDebugLoc*/false, /*AddNewLine*/true, TII);
       });
 
       bool SubstituteAlways = false;
index be39a72614029d112ede998d1eb4433d0bc1f8dc..894d0abea3eb01496d31cf7bf95038a7eb2d5afe 100644 (file)
@@ -1472,7 +1472,7 @@ void MachineInstr::print(raw_ostream &OS, bool IsStandalone, bool SkipOpers,
   ModuleSlotTracker MST(M);
   if (F)
     MST.incorporateFunction(*F);
-  print(OS, MST, IsStandalone, SkipOpers, SkipDebugLoc, TII);
+  print(OS, MST, IsStandalone, SkipOpers, SkipDebugLoc, AddNewLine, TII);
 }
 
 void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
index bfdd940bf376d8c95c6ac9451cb276948b84a199..21b5eb6f4e14a33fb43e74bb9478c034a4c0ff01 100644 (file)
@@ -265,7 +265,8 @@ TEST(MachineInstrPrintingTest, DebugLocPrinting) {
 
   std::string str;
   raw_string_ostream OS(str);
-  MI->print(OS);
+  MI->print(OS, /*IsStandalone*/true, /*SkipOpers*/false, /*SkipDebugLoc*/false,
+            /*AddNewLine*/false);
   ASSERT_TRUE(
       StringRef(OS.str()).startswith("$noreg = UNKNOWN debug-location "));
   ASSERT_TRUE(