The top-level verifier of data layout specifications delegates verification of
entries with identifier keys to the dialect of the identifier prefix. This flow
was missing a check whether the dialect actually implements the relevant
interface.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D103945
const auto *iface =
dialect->getRegisteredInterface<DataLayoutDialectInterface>();
+ if (!iface) {
+ return emitError(loc)
+ << "the '" << dialect->getNamespace()
+ << "' dialect does not support identifier data layout entries";
+ }
if (failed(iface->verifyEntry(kvp.second, loc)))
return failure();
}
// -----
+// expected-error@below {{the 'test' dialect does not support identifier data layout entries}}
+"test.op_with_data_layout"() { dlti.dl_spec = #dlti.dl_spec<
+ #dlti.dl_entry<index, 32>,
+ #dlti.dl_entry<"test.foo", [32]>>} : () -> ()
+
+// -----
+
// CHECK-LABEL: @index
module @index attributes { dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<index, 32>>} {