[Mlir-commits] [mlir] [mlir][async] Avoid crash when not using `func.func` (PR #72801)

Matthias Springer llvmlistbot at llvm.org
Mon Nov 20 05:37:38 PST 2023


================
@@ -1143,6 +1143,8 @@ void OpEmitter::genAttrNameGetters() {
       const char *const getAttrName = R"(
   assert(index < {0} && "invalid attribute index");
   assert(name.getStringRef() == getOperationName() && "invalid operation name");
+  assert(!name.getAttributeNames().empty() && "empty attribute names. Is a new "
----------------
matthias-springer wrote:

I'm wondering if it is correct for `getAttributeNames` to return an empty list if the dialect is not loaded. The documentation of `getAttributeNames` talks about caching and maybe this should have fallen back to `OpTy::getAttributeNames`? Maybe @joker-eph knows.

https://github.com/llvm/llvm-project/pull/72801


More information about the Mlir-commits mailing list