forked from OSchip/llvm-project
Add `//` before the banner displayed in `--print-ir-before/after-all`
This is making the output file (when the stream is a file) a valid MLIR file. Differential Revision: https://reviews.llvm.org/D78604
This commit is contained in:
parent
46a52ff9ed
commit
8dc790b933
|
@ -141,7 +141,7 @@ void IRPrinterInstrumentation::runBeforePass(Pass *pass, Operation *op) {
|
||||||
beforePassFingerPrints.try_emplace(pass, op);
|
beforePassFingerPrints.try_emplace(pass, op);
|
||||||
|
|
||||||
config->printBeforeIfEnabled(pass, op, [&](raw_ostream &out) {
|
config->printBeforeIfEnabled(pass, op, [&](raw_ostream &out) {
|
||||||
out << formatv("*** IR Dump Before {0} ***", pass->getName());
|
out << formatv("// *** IR Dump Before {0} ***", pass->getName());
|
||||||
printIR(op, config->shouldPrintAtModuleScope(), out, OpPrintingFlags());
|
printIR(op, config->shouldPrintAtModuleScope(), out, OpPrintingFlags());
|
||||||
out << "\n\n";
|
out << "\n\n";
|
||||||
});
|
});
|
||||||
|
@ -165,7 +165,7 @@ void IRPrinterInstrumentation::runAfterPass(Pass *pass, Operation *op) {
|
||||||
}
|
}
|
||||||
|
|
||||||
config->printAfterIfEnabled(pass, op, [&](raw_ostream &out) {
|
config->printAfterIfEnabled(pass, op, [&](raw_ostream &out) {
|
||||||
out << formatv("*** IR Dump After {0} ***", pass->getName());
|
out << formatv("// *** IR Dump After {0} ***", pass->getName());
|
||||||
printIR(op, config->shouldPrintAtModuleScope(), out, OpPrintingFlags());
|
printIR(op, config->shouldPrintAtModuleScope(), out, OpPrintingFlags());
|
||||||
out << "\n\n";
|
out << "\n\n";
|
||||||
});
|
});
|
||||||
|
@ -178,7 +178,7 @@ void IRPrinterInstrumentation::runAfterPassFailed(Pass *pass, Operation *op) {
|
||||||
beforePassFingerPrints.erase(pass);
|
beforePassFingerPrints.erase(pass);
|
||||||
|
|
||||||
config->printAfterIfEnabled(pass, op, [&](raw_ostream &out) {
|
config->printAfterIfEnabled(pass, op, [&](raw_ostream &out) {
|
||||||
out << formatv("*** IR Dump After {0} Failed ***", pass->getName());
|
out << formatv("// *** IR Dump After {0} Failed ***", pass->getName());
|
||||||
printIR(op, config->shouldPrintAtModuleScope(), out,
|
printIR(op, config->shouldPrintAtModuleScope(), out,
|
||||||
OpPrintingFlags().printGenericOpForm());
|
OpPrintingFlags().printGenericOpForm());
|
||||||
out << "\n\n";
|
out << "\n\n";
|
||||||
|
|
Loading…
Reference in New Issue