forked from OSchip/llvm-project
[mlir][drr] Improve error message for unexpected attribute (NFC)
When using an attribute where a value is expected previously this would fail complaining about unbound symbol. Instead make error clear and mention common failure reason.
This commit is contained in:
parent
178da37b18
commit
768a517581
|
@ -1295,6 +1295,14 @@ void PatternEmitter::createAggregateLocalVarsForOpArgs(
|
|||
childNodeNames.lookup(argIndex));
|
||||
} else {
|
||||
DagLeaf leaf = node.getArgAsLeaf(argIndex);
|
||||
if (leaf.isConstantAttr())
|
||||
// TODO: Use better location
|
||||
PrintFatalError(
|
||||
loc,
|
||||
"attribute found where value was expected, if attempting to use "
|
||||
"constant value, construct a constant op with given attribute "
|
||||
"instead");
|
||||
|
||||
auto symbol =
|
||||
symbolInfoMap.getValueAndRangeUse(node.getArgName(argIndex));
|
||||
if (leaf.isNativeCodeCall()) {
|
||||
|
|
Loading…
Reference in New Issue