diff --git a/lib/Dialect/FIRRTL/Transforms/ModuleInliner.cpp b/lib/Dialect/FIRRTL/Transforms/ModuleInliner.cpp index 925b1963b1c8..64317dcad4e2 100644 --- a/lib/Dialect/FIRRTL/Transforms/ModuleInliner.cpp +++ b/lib/Dialect/FIRRTL/Transforms/ModuleInliner.cpp @@ -1027,7 +1027,8 @@ LogicalResult Inliner::inliningWalk( return success(); }) .Default([&](Operation *op) { - return op->emitError("unsupported operation cannot be inlined"); + return op->emitError("unsupported operation '") + << op->getName() << "' cannot be inlined"; }); if (failed(result)) return failure(); @@ -1040,8 +1041,9 @@ LogicalResult Inliner::checkInstanceParents(InstanceOp instance) { while (!isa(parent)) { if (!isa(parent)) return instance->emitError("cannot inline instance") - .attachNote(parent->getLoc()) - << "containing operation not safe to inline into"; + .attachNote(parent->getLoc()) + << "containing operation '" << parent->getName() + << "' not safe to inline into"; parent = parent->getParentOp(); } return success(); diff --git a/test/Dialect/FIRRTL/inliner-errors.mlir b/test/Dialect/FIRRTL/inliner-errors.mlir index 70efa6ee4af1..c4a557f19e47 100644 --- a/test/Dialect/FIRRTL/inliner-errors.mlir +++ b/test/Dialect/FIRRTL/inliner-errors.mlir @@ -5,7 +5,7 @@ firrtl.circuit "InlineIntoWhen" { firrtl.module private @Child () attributes {annotations = [{class = "firrtl.passes.InlineAnnotation"}]} {} firrtl.module @InlineIntoWhen(in %cond : !firrtl.uint<1>) { - // expected-note @below {{containing operation not safe to inline into}} + // expected-note @below {{containing operation 'firrtl.when' not safe to inline into}} firrtl.when %cond : !firrtl.uint<1> { // expected-error @below {{cannot inline instance}} firrtl.instance c @Child() @@ -20,7 +20,7 @@ firrtl.circuit "InlineIntoWhen" { firrtl.circuit "FlattenThroughWhen" { firrtl.module private @GChild () {} firrtl.module private @Child (in %cond : !firrtl.uint<1>) { - // expected-note @below {{containing operation not safe to inline into}} + // expected-note @below {{containing operation 'firrtl.when' not safe to inline into}} firrtl.when %cond : !firrtl.uint<1> { // expected-error @below {{cannot inline instance}} firrtl.instance c @GChild() @@ -40,7 +40,7 @@ firrtl.circuit "InlineIntoIfdef" { sv.macro.decl @A_0["A"] firrtl.module private @Child () attributes {annotations = [{class = "firrtl.passes.InlineAnnotation"}]} {} firrtl.module @InlineIntoIfdef() { - // expected-note @below {{containing operation not safe to inline into}} + // expected-note @below {{containing operation 'sv.ifdef' not safe to inline into}} sv.ifdef @A_0 { // expected-error @below {{cannot inline instance}} firrtl.instance c @Child() @@ -55,7 +55,7 @@ firrtl.circuit "InlineIntoIfdef" { firrtl.circuit "InlineIfdef" { sv.macro.decl @A_0["A"] firrtl.module private @Child () attributes {annotations = [{class = "firrtl.passes.InlineAnnotation"}]} { - // expected-error @below {{unsupported operation cannot be inlined}} + // expected-error @below {{unsupported operation 'sv.ifdef' cannot be inlined}} sv.ifdef @A_0 { } } firrtl.module @InlineIfdef() {