Skip to content

Commit a4c84d6

Browse files
committed
[mlir] Only inline if properties are used.
This is a followup to 0f52f4d It breaks dialects that don't use properties yet.
1 parent 2921a09 commit a4c84d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/test/mlir-tblgen/op-decl-and-defs.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> {
5959
// CHECK: class AOpGenericAdaptorBase {
6060
// CHECK: public:
6161
// CHECK: AOpGenericAdaptorBase(AOp{{[[:space:]]}}
62-
// CHECK: ::mlir::IntegerAttr getAttr1Attr() {
62+
// CHECK: ::mlir::IntegerAttr getAttr1Attr();
6363
// CHECK: uint32_t getAttr1();
64-
// CHECK: ::mlir::FloatAttr getSomeAttr2Attr() {
64+
// CHECK: ::mlir::FloatAttr getSomeAttr2Attr();
6565
// CHECK: ::std::optional< ::llvm::APFloat > getSomeAttr2();
6666
// CHECK: ::mlir::Region &getSomeRegion() {
6767
// CHECK: ::mlir::RegionRange getSomeRegions() {

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4167,8 +4167,8 @@ OpOperandAdaptorEmitter::OpOperandAdaptorEmitter(
41674167
// value, in which case the default value may be arbitrary code.
41684168
auto *method = genericAdaptorBase.addMethod(
41694169
attr.getStorageType(), emitName + "Attr",
4170-
attr.hasDefaultValue() ? Method::Properties::None
4171-
: Method::Properties::Inline);
4170+
attr.hasDefaultValue() || !useProperties ? Method::Properties::None
4171+
: Method::Properties::Inline);
41724172
ERROR_IF_PRUNED(method, "Adaptor::" + emitName + "Attr", op);
41734173
auto &body = method->body().indent();
41744174
if (!useProperties)

0 commit comments

Comments
 (0)