Skip to content

Commit eb3f76f

Browse files
committed
[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print
Committed r322867 too soon. Differential Revision: https://reviews.llvm.org/D42239 llvm-svn: 322868
1 parent 378b5f3 commit eb3f76f

10 files changed

+26
-25
lines changed

llvm/include/llvm/CodeGen/MachineBasicBlock.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ class MachineBasicBlock
726726
// Debugging methods.
727727
void dump() const;
728728
void print(raw_ostream &OS, const SlotIndexes * = nullptr,
729-
bool IsVerbose = true) const;
729+
bool IsStandalone = true) const;
730730
void print(raw_ostream &OS, ModuleSlotTracker &MST,
731-
const SlotIndexes * = nullptr, bool IsVerbose = true) const;
731+
const SlotIndexes * = nullptr, bool IsStandalone = true) const;
732732

733733
// Printing method used by LoopInfo.
734734
void printAsOperand(raw_ostream &OS, bool PrintType = true) const;

llvm/include/llvm/CodeGen/MachineInstr.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1234,17 +1234,17 @@ class MachineInstr
12341234

12351235
/// Print this MI to \p OS.
12361236
/// Don't print information that can be inferred from other instructions if
1237-
/// \p IsVerbose is false. It is usually true when only a fragment of the
1237+
/// \p IsStandalone is false. It is usually true when only a fragment of the
12381238
/// function is printed.
12391239
/// Only print the defs and the opcode if \p SkipOpers is true.
12401240
/// Otherwise, also print operands if \p SkipDebugLoc is true.
12411241
/// Otherwise, also print the debug loc, with a terminating newline.
12421242
/// \p TII is used to print the opcode name. If it's not present, but the
12431243
/// MI is in a function, the opcode will be printed using the function's TII.
1244-
void print(raw_ostream &OS, bool IsVerbose = true, bool SkipOpers = false,
1244+
void print(raw_ostream &OS, bool IsStandalone = true, bool SkipOpers = false,
12451245
bool SkipDebugLoc = false,
12461246
const TargetInstrInfo *TII = nullptr) const;
1247-
void print(raw_ostream &OS, ModuleSlotTracker &MST, bool IsVerbose = true,
1247+
void print(raw_ostream &OS, ModuleSlotTracker &MST, bool IsStandalone = true,
12481248
bool SkipOpers = false, bool SkipDebugLoc = false,
12491249
const TargetInstrInfo *TII = nullptr) const;
12501250
void dump() const;

llvm/include/llvm/CodeGen/MachineOperand.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class MachineOperand {
270270
/// \param PrintDef - whether we want to print `def` on an operand which
271271
/// isDef. Sometimes, if the operand is printed before '=', we don't print
272272
/// `def`.
273-
/// \param IsVerbose - whether we want a verbose output of the MO. This
273+
/// \param IsStandalone - whether we want a verbose output of the MO. This
274274
/// prints extra information that can be easily inferred when printing the
275275
/// whole function, but not when printing only a fragment of it.
276276
/// \param ShouldPrintRegisterTies - whether we want to print register ties.
@@ -283,7 +283,7 @@ class MachineOperand {
283283
/// information from it's parent.
284284
/// \param IntrinsicInfo - same as \p TRI.
285285
void print(raw_ostream &os, ModuleSlotTracker &MST, LLT TypeToPrint,
286-
bool PrintDef, bool IsVerbose, bool ShouldPrintRegisterTies,
286+
bool PrintDef, bool IsStandalone, bool ShouldPrintRegisterTies,
287287
unsigned TiedOperandIdx, const TargetRegisterInfo *TRI,
288288
const TargetIntrinsicInfo *IntrinsicInfo) const;
289289

llvm/lib/CodeGen/MIRPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ void MIPrinter::print(const MachineInstr &MI, unsigned OpIdx,
768768
if (ShouldPrintRegisterTies && Op.isReg() && Op.isTied() && !Op.isDef())
769769
TiedOperandIdx = Op.getParent()->findTiedOperandIdx(OpIdx);
770770
const TargetIntrinsicInfo *TII = MI.getMF()->getTarget().getIntrinsicInfo();
771-
Op.print(OS, MST, TypeToPrint, PrintDef, /*IsVerbose=*/false,
771+
Op.print(OS, MST, TypeToPrint, PrintDef, /*IsStandalone=*/false,
772772
ShouldPrintRegisterTies, TiedOperandIdx, TRI, TII);
773773
break;
774774
}

llvm/lib/CodeGen/MachineBasicBlock.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ std::string MachineBasicBlock::getFullName() const {
260260
}
261261

262262
void MachineBasicBlock::print(raw_ostream &OS, const SlotIndexes *Indexes,
263-
bool IsVerbose) const {
263+
bool IsStandalone) const {
264264
const MachineFunction *MF = getParent();
265265
if (!MF) {
266266
OS << "Can't print out MachineBasicBlock because parent MachineFunction"
@@ -270,12 +270,12 @@ void MachineBasicBlock::print(raw_ostream &OS, const SlotIndexes *Indexes,
270270
const Function &F = MF->getFunction();
271271
const Module *M = F.getParent();
272272
ModuleSlotTracker MST(M);
273-
print(OS, MST, Indexes, IsVerbose);
273+
print(OS, MST, Indexes, IsStandalone);
274274
}
275275

276276
void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST,
277277
const SlotIndexes *Indexes,
278-
bool IsVerbose) const {
278+
bool IsStandalone) const {
279279
const MachineFunction *MF = getParent();
280280
if (!MF) {
281281
OS << "Can't print out MachineBasicBlock because parent MachineFunction"
@@ -331,7 +331,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST,
331331
OS << '\t';
332332
if (I.isInsideBundle())
333333
OS << " * ";
334-
I.print(OS, MST, IsVerbose);
334+
I.print(OS, MST, IsStandalone);
335335
}
336336

337337
// Print the successors of this block according to the CFG.

llvm/lib/CodeGen/MachineFunction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const {
524524
OS << '\n';
525525
// If we print the whole function, don't print any verbose information,
526526
// since that information is already present.
527-
BB.print(OS, MST, Indexes, /*IsVerbose=*/false);
527+
BB.print(OS, MST, Indexes, /*IsStandalone=*/false);
528528
}
529529

530530
OS << "\n# End machine code for function " << getName() << ".\n\n";

llvm/lib/CodeGen/MachineInstr.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ LLVM_DUMP_METHOD void MachineInstr::dump() const {
12291229
}
12301230
#endif
12311231

1232-
void MachineInstr::print(raw_ostream &OS, bool IsVerbose, bool SkipOpers,
1232+
void MachineInstr::print(raw_ostream &OS, bool IsStandalone, bool SkipOpers,
12331233
bool SkipDebugLoc, const TargetInstrInfo *TII) const {
12341234
const Module *M = nullptr;
12351235
const Function *F = nullptr;
@@ -1241,11 +1241,11 @@ void MachineInstr::print(raw_ostream &OS, bool IsVerbose, bool SkipOpers,
12411241
ModuleSlotTracker MST(M);
12421242
if (F)
12431243
MST.incorporateFunction(*F);
1244-
print(OS, MST, IsVerbose, SkipOpers, SkipDebugLoc, TII);
1244+
print(OS, MST, IsStandalone, SkipOpers, SkipDebugLoc, TII);
12451245
}
12461246

12471247
void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
1248-
bool IsVerbose, bool SkipOpers, bool SkipDebugLoc,
1248+
bool IsStandalone, bool SkipOpers, bool SkipDebugLoc,
12491249
const TargetInstrInfo *TII) const {
12501250
// We can be a bit tidier if we know the MachineFunction.
12511251
const MachineFunction *MF = nullptr;
@@ -1281,7 +1281,7 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
12811281

12821282
LLT TypeToPrint = MRI ? getTypeToPrint(StartOp, PrintedTypes, *MRI) : LLT{};
12831283
unsigned TiedOperandIdx = getTiedOperandIdx(StartOp);
1284-
MO.print(OS, MST, TypeToPrint, /*PrintDef=*/false, IsVerbose,
1284+
MO.print(OS, MST, TypeToPrint, /*PrintDef=*/false, IsStandalone,
12851285
ShouldPrintRegisterTies, TiedOperandIdx, TRI, IntrinsicInfo);
12861286
++StartOp;
12871287
}
@@ -1314,7 +1314,7 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
13141314
const unsigned OpIdx = InlineAsm::MIOp_AsmString;
13151315
LLT TypeToPrint = MRI ? getTypeToPrint(OpIdx, PrintedTypes, *MRI) : LLT{};
13161316
unsigned TiedOperandIdx = getTiedOperandIdx(OpIdx);
1317-
getOperand(OpIdx).print(OS, MST, TypeToPrint, /*PrintDef=*/true, IsVerbose,
1317+
getOperand(OpIdx).print(OS, MST, TypeToPrint, /*PrintDef=*/true, IsStandalone,
13181318
ShouldPrintRegisterTies, TiedOperandIdx, TRI,
13191319
IntrinsicInfo);
13201320

@@ -1353,7 +1353,7 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
13531353
else {
13541354
LLT TypeToPrint = MRI ? getTypeToPrint(i, PrintedTypes, *MRI) : LLT{};
13551355
unsigned TiedOperandIdx = getTiedOperandIdx(i);
1356-
MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true, IsVerbose,
1356+
MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true, IsStandalone,
13571357
ShouldPrintRegisterTies, TiedOperandIdx, TRI, IntrinsicInfo);
13581358
}
13591359
} else if (i == AsmDescOp && MO.isImm()) {
@@ -1420,7 +1420,7 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
14201420
if (MO.isImm() && isOperandSubregIdx(i))
14211421
MachineOperand::printSubRegIdx(OS, MO.getImm(), TRI);
14221422
else
1423-
MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true, IsVerbose,
1423+
MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true, IsStandalone,
14241424
ShouldPrintRegisterTies, TiedOperandIdx, TRI, IntrinsicInfo);
14251425
}
14261426
}

llvm/lib/CodeGen/MachineOperand.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,13 @@ void MachineOperand::print(raw_ostream &OS, const TargetRegisterInfo *TRI,
641641
const TargetIntrinsicInfo *IntrinsicInfo) const {
642642
tryToGetTargetInfo(*this, TRI, IntrinsicInfo);
643643
ModuleSlotTracker DummyMST(nullptr);
644-
print(OS, DummyMST, LLT{}, /*PrintDef=*/false, /*IsVerbose=*/true,
644+
print(OS, DummyMST, LLT{}, /*PrintDef=*/false, /*IsStandalone=*/true,
645645
/*ShouldPrintRegisterTies=*/true,
646646
/*TiedOperandIdx=*/0, TRI, IntrinsicInfo);
647647
}
648648

649649
void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
650-
LLT TypeToPrint, bool PrintDef, bool IsVerbose,
650+
LLT TypeToPrint, bool PrintDef, bool IsStandalone,
651651
bool ShouldPrintRegisterTies,
652652
unsigned TiedOperandIdx,
653653
const TargetRegisterInfo *TRI,
@@ -687,7 +687,7 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
687687
if (TargetRegisterInfo::isVirtualRegister(Reg)) {
688688
if (const MachineFunction *MF = getMFIfAvailable(*this)) {
689689
const MachineRegisterInfo &MRI = MF->getRegInfo();
690-
if (IsVerbose || !PrintDef || MRI.def_empty(Reg)) {
690+
if (IsStandalone || !PrintDef || MRI.def_empty(Reg)) {
691691
OS << ':';
692692
OS << printRegClassOrBank(Reg, MRI, TRI);
693693
}

llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ DiagnosticInfoMIROptimization::MachineArgument::MachineArgument(
2727
Key = MKey;
2828

2929
raw_string_ostream OS(Val);
30-
MI.print(OS, /*IsVerbose=*/true, /*SkipOpers=*/false, /*SkipDebugLoc=*/true);
30+
MI.print(OS, /*IsStandalone=*/true, /*SkipOpers=*/false,
31+
/*SkipDebugLoc=*/true);
3132
}
3233

3334
Optional<uint64_t>

llvm/unittests/CodeGen/MachineOperandTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ TEST(MachineOperandTest, PrintMetadata) {
311311
std::string str;
312312
// Print a MachineOperand containing a metadata node.
313313
raw_string_ostream OS(str);
314-
MO.print(OS, MST, LLT{}, /*PrintDef=*/false, /*IsVerbose=*/false,
314+
MO.print(OS, MST, LLT{}, /*PrintDef=*/false, /*IsStandalone=*/false,
315315
/*ShouldPrintRegisterTies=*/false, 0, /*TRI=*/nullptr,
316316
/*IntrinsicInfo=*/nullptr);
317317
ASSERT_TRUE(OS.str() == "!0");

0 commit comments

Comments
 (0)