@@ -90,15 +90,15 @@ class DialectAttr<Dialect d, Pred condition, string summary = ""> :
9090// Attribute modifier definition
9191
9292// Decorates an attribute to have an (unvalidated) default value if not present.
93- class DefaultValuedAttr<Attr attr, string val> :
93+ class DefaultValuedAttr<Attr attr, string val, string builderCall = "" > :
9494 Attr<attr.predicate, attr.summary> {
9595 // Construct this attribute with the input attribute and change only
9696 // the default value.
9797 // Note: this has to be kept up to date with Attr above.
9898 let storageType = attr.storageType;
9999 let returnType = attr.returnType;
100100 let convertFromStorage = attr.convertFromStorage;
101- let constBuilderCall = attr.constBuilderCall;
101+ let constBuilderCall = !if(!eq(builderCall, ""), attr.constBuilderCall, builderCall) ;
102102 let defaultValue = val;
103103 let valueType = attr.valueType;
104104
@@ -107,15 +107,15 @@ class DefaultValuedAttr<Attr attr, string val> :
107107
108108// Decorates an optional attribute to have an (unvalidated) default value
109109// return by ODS generated accessors if not present.
110- class DefaultValuedOptionalAttr<Attr attr, string val> :
110+ class DefaultValuedOptionalAttr<Attr attr, string val, string builderCall = "" > :
111111 Attr<attr.predicate, attr.summary> {
112112 // Construct this attribute with the input attribute and change only
113113 // the default value.
114114 // Note: this has to be kept up to date with Attr above.
115115 let storageType = attr.storageType;
116116 let returnType = attr.returnType;
117117 let convertFromStorage = attr.convertFromStorage;
118- let constBuilderCall = attr.constBuilderCall;
118+ let constBuilderCall = !if(!eq(builderCall, ""), attr.constBuilderCall, builderCall) ;
119119 let defaultValue = val;
120120 let valueType = attr.valueType;
121121 let isOptional = 1;
0 commit comments