llvm-project/mlir/lib/TableGen
Lei Zhang 765b77cc70 Better support for attribute wrapper classes when getting def name
Unless we explicitly name a template instantiation in .td file, its def
name will be "anonymous_<number>". We typically give base-level Attr
template instantiation a name by writing `def AnAttr : Attr<...>`. But
when `AnAttr` is further wrapped in classes like OptionalAttr, the name
is lost unless explicitly def'ed again. These implicit-named template
instantiation is fairly common when writing op definitions. Those wrapper
classes are just essentially attaching more information to the attribute.
Without a proper way to trace back to the original attribute def name
can cause problems for consumers wanting to handle attributes according
to their types.

Previously we handled OptionalAttr and DefaultValuedAttr specifically,
but Confined was not supported. And they can compose together to have
Confined<OptionalAttr<...>, [...]>. So this CL moves the baseAttr field
to main Attr class (like isOptional) and set it only on the innermost
wrapper class.

PiperOrigin-RevId: 258341646
2019-07-16 13:45:03 -07:00
..
Argument.cpp Remove unnecessary C++ specifier in CPP files. NFC. 2019-05-20 13:42:13 -07:00
Attribute.cpp Better support for attribute wrapper classes when getting def name 2019-07-16 13:45:03 -07:00
CMakeLists.txt [ODS] Allow dialect to specify C++ namespaces 2019-05-20 13:49:27 -07:00
Constraint.cpp [ODS] Support region names and constraints 2019-06-01 20:11:42 -07:00
Dialect.cpp [ODS] Allow dialect to specify C++ namespaces 2019-05-20 13:49:27 -07:00
Format.cpp NFC: Add a missing include for std::isalnum and std::digit. 2019-06-01 20:04:03 -07:00
OpTrait.cpp Remove extra `;` after function definition (NFC) 2019-05-10 19:29:26 -07:00
Operator.cpp ODS: provide a flag to skip generation of default build methods 2019-07-05 02:28:05 -07:00
Pattern.cpp [ODS] Introduce IntEnumAttr 2019-07-01 09:55:47 -07:00
Predicate.cpp [TableGen] Support array attribute subclasses and constraints 2019-04-05 07:43:32 -07:00
Type.cpp [TableGen] Consolidate constraint related concepts 2019-03-29 17:38:46 -07:00