Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0236ad5

Browse files
authored
[mlir][core] Restore dropped printIR behavior. (#196628)
Restore checking for module scope which is dropped in #195198
1 parent 0a2f943 commit 0236ad5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

mlir/lib/Pass/IRPrinting.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ class IRPrinterInstrumentation : public PassInstrumentation {
4848

4949
static void printIR(Operation *op, bool printModuleScope, raw_ostream &out,
5050
OpPrintingFlags flags) {
51+
// Check to see if we are not printing at module scope.
52+
if (!printModuleScope)
53+
return op->print(out, op->getBlock() ? flags.useLocalScope() : flags);
54+
55+
// Otherwise, we are printing at module scope.
5156
// Find the top-level operation.
5257
auto *topLevelOp = op;
5358
while (auto *parentOp = topLevelOp->getParentOp())

0 commit comments

Comments
 (0)