[Mlir-commits] [mlir] [mlir] Add the ability to define dialect-specific location attrs. (PR #105584)
River Riddle
llvmlistbot at llvm.org
Wed Sep 18 09:23:37 PDT 2024
================
@@ -18,7 +18,8 @@ include "mlir/IR/BuiltinDialect.td"
// Base class for Builtin dialect location attributes.
class Builtin_LocationAttr<string name, list<Trait> traits = []>
- : AttrDef<Builtin_Dialect, name, traits, "::mlir::LocationAttr"> {
+ : AttrDef<Builtin_Dialect, name, traits # [NativeAttrTrait<"IsLocation">],
+ "::mlir::LocationAttr"> {
----------------
River707 wrote:
Can you add a LocationAttrDef near AttrDef that adds the trait and also sets the base class to `::mlir::LocationAttr`? (Pretty much every location will want that)
https://github.com/llvm/llvm-project/pull/105584
More information about the Mlir-commits
mailing list