Skip to content

Commit a4095df

Browse files
committed
Don't print uselistorder in --print-changed
Using uselistorders is fairly niche, it shouldn't be on by default and mostly just clutters the output. Reviewed By: jamieschmeiser Differential Revision: https://reviews.llvm.org/D111282
1 parent 1262f8a commit a4095df

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

llvm/lib/Passes/StandardInstrumentations.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,9 @@ void printIR(raw_ostream &OS, const Function *F) {
230230
OS << *F;
231231
}
232232

233-
void printIR(raw_ostream &OS, const Module *M,
234-
bool ShouldPreserveUseListOrder = false) {
233+
void printIR(raw_ostream &OS, const Module *M) {
235234
if (isFunctionInPrintList("*") || forcePrintModuleIR()) {
236-
M->print(OS, nullptr, ShouldPreserveUseListOrder);
235+
M->print(OS, nullptr);
237236
} else {
238237
for (const auto &F : M->functions()) {
239238
printIR(OS, &F);
@@ -323,21 +322,20 @@ bool shouldPrintIR(Any IR) {
323322

324323
/// Generic IR-printing helper that unpacks a pointer to IRUnit wrapped into
325324
/// llvm::Any and does actual print job.
326-
void unwrapAndPrint(raw_ostream &OS, Any IR,
327-
bool ShouldPreserveUseListOrder = false) {
325+
void unwrapAndPrint(raw_ostream &OS, Any IR) {
328326
if (!shouldPrintIR(IR))
329327
return;
330328

331329
if (forcePrintModuleIR()) {
332330
auto *M = unwrapModule(IR);
333331
assert(M && "should have unwrapped module");
334-
printIR(OS, M, ShouldPreserveUseListOrder);
332+
printIR(OS, M);
335333
return;
336334
}
337335

338336
if (any_isa<const Module *>(IR)) {
339337
const Module *M = any_cast<const Module *>(IR);
340-
printIR(OS, M, ShouldPreserveUseListOrder);
338+
printIR(OS, M);
341339
return;
342340
}
343341

@@ -497,8 +495,7 @@ void TextChangeReporter<IRUnitT>::handleInitialIR(Any IR) {
497495
auto *M = unwrapModule(IR, /*Force=*/true);
498496
assert(M && "Expected module to be unwrapped when forced.");
499497
Out << "*** IR Dump At Start ***\n";
500-
M->print(Out, nullptr,
501-
/*ShouldPreserveUseListOrder=*/true);
498+
M->print(Out, nullptr);
502499
}
503500

504501
template <typename IRUnitT>
@@ -538,8 +535,7 @@ void IRChangedPrinter::registerCallbacks(PassInstrumentationCallbacks &PIC) {
538535
void IRChangedPrinter::generateIRRepresentation(Any IR, StringRef PassID,
539536
std::string &Output) {
540537
raw_string_ostream OS(Output);
541-
unwrapAndPrint(OS, IR,
542-
/*ShouldPreserveUseListOrder=*/true);
538+
unwrapAndPrint(OS, IR);
543539
OS.str();
544540
}
545541

0 commit comments

Comments
 (0)