The error message in the `std.constant` verifier for function-typed constants
had the name of the undefined function hardcoded to `bar`. Report the actual
name instead.
Differential Revision: https://reviews.llvm.org/D82666
auto fn =
op.getParentOfType<ModuleOp>().lookupSymbol<FuncOp>(fnAttr.getValue());
if (!fn)
- return op.emitOpError("reference to undefined function 'bar'");
+ return op.emitOpError()
+ << "reference to undefined function '" << fnAttr.getValue() << "'";
// Check that the referenced function has the correct type.
if (fn.getType() != type)
func @undefined_function() {
^bb0:
- %x = constant @bar : (i32) -> () // expected-error {{reference to undefined function 'bar'}}
+ %x = constant @qux : (i32) -> () // expected-error {{reference to undefined function 'qux'}}
return
}