فهرست منبع

[X86] Fix several places that weren't passing what they though they were to MachineInstr::print

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
Craig Topper 6 سال پیش
والد
کامیت
393ae63d24
4فایلهای تغییر یافته به همراه16 افزوده شده و 7 حذف شده
  1. 9 3
      lib/CodeGen/LiveDebugValues.cpp
  2. 4 2
      lib/CodeGen/MachineCombiner.cpp
  3. 1 1
      lib/CodeGen/MachineInstr.cpp
  4. 2 1
      unittests/CodeGen/MachineInstrTest.cpp

+ 9 - 3
lib/CodeGen/LiveDebugValues.cpp

@@ -457,7 +457,9 @@ void LiveDebugValues::insertTransferDebugPair(
     VarLoc VL(*NewDebugInstr, LS);
     VarLoc VL(*NewDebugInstr, LS);
     ProcessVarLoc(VL, NewDebugInstr);
     ProcessVarLoc(VL, NewDebugInstr);
     LLVM_DEBUG(dbgs() << "Creating DBG_VALUE inst for register copy: ";
     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;
     return;
   }
   }
   case TransferKind::TransferSpill: {
   case TransferKind::TransferSpill: {
@@ -474,7 +476,9 @@ void LiveDebugValues::insertTransferDebugPair(
               SpillLocation.SpillOffset, LS);
               SpillLocation.SpillOffset, LS);
     ProcessVarLoc(VL, NewDebugInstr);
     ProcessVarLoc(VL, NewDebugInstr);
     LLVM_DEBUG(dbgs() << "Creating DBG_VALUE inst for spill: ";
     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;
     return;
   }
   }
   case TransferKind::TransferRestore: {
   case TransferKind::TransferRestore: {
@@ -488,7 +492,9 @@ void LiveDebugValues::insertTransferDebugPair(
     VarLoc VL(*NewDebugInstr, LS);
     VarLoc VL(*NewDebugInstr, LS);
     ProcessVarLoc(VL, NewDebugInstr);
     ProcessVarLoc(VL, NewDebugInstr);
     LLVM_DEBUG(dbgs() << "Creating DBG_VALUE inst for register restore: ";
     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;
     return;
   }
   }
   }
   }

+ 4 - 2
lib/CodeGen/MachineCombiner.cpp

@@ -561,10 +561,12 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
         dbgs() << "\tFor the Pattern (" << (int)P
         dbgs() << "\tFor the Pattern (" << (int)P
                << ") these instructions could be removed\n";
                << ") these instructions could be removed\n";
         for (auto const *InstrPtr : DelInstrs)
         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";
         dbgs() << "\tThese instructions could replace the removed ones\n";
         for (auto const *InstrPtr : InsInstrs)
         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;
       bool SubstituteAlways = false;

+ 1 - 1
lib/CodeGen/MachineInstr.cpp

@@ -1472,7 +1472,7 @@ void MachineInstr::print(raw_ostream &OS, bool IsStandalone, bool SkipOpers,
   ModuleSlotTracker MST(M);
   ModuleSlotTracker MST(M);
   if (F)
   if (F)
     MST.incorporateFunction(*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,
 void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,

+ 2 - 1
unittests/CodeGen/MachineInstrTest.cpp

@@ -265,7 +265,8 @@ TEST(MachineInstrPrintingTest, DebugLocPrinting) {
 
 
   std::string str;
   std::string str;
   raw_string_ostream OS(str);
   raw_string_ostream OS(str);
-  MI->print(OS);
+  MI->print(OS, /*IsStandalone*/true, /*SkipOpers*/false, /*SkipDebugLoc*/false,
+            /*AddNewLine*/false);
   ASSERT_TRUE(
   ASSERT_TRUE(
       StringRef(OS.str()).startswith("$noreg = UNKNOWN debug-location "));
       StringRef(OS.str()).startswith("$noreg = UNKNOWN debug-location "));
   ASSERT_TRUE(
   ASSERT_TRUE(