@@ -48,19 +48,22 @@ class BlockLayoutDataType(
4848 " invoke${invokeFunctionTypeSuffix?.let { " _$it " } ? : " " } " ,
4949 ).apply {
5050 returnType = invokeReturnType
51- arguments = arrayOf(
52- ParameterDefinitionImpl (
53- " block" ,
54- PointerDataType (
55- // Throwing this all together at once seems to avoid data type conflicts. If this
56- // were instead defined outside the `apply` block and then used inside, it seems
57- // to cause two data types to be defined for this singular block layout type.
58- this @BlockLayoutDataType,
59- dataTypeManager,
60- ),
61- null ,
62- ),
63- ) + parameters
51+ setArguments(
52+ *
53+ arrayOf(
54+ ParameterDefinitionImpl (
55+ " block" ,
56+ PointerDataType (
57+ // Throwing this all together at once seems to avoid data type conflicts. If this
58+ // were instead defined outside the `apply` block and then used inside, it seems
59+ // to cause two data types to be defined for this singular block layout type.
60+ this @BlockLayoutDataType,
61+ dataTypeManager,
62+ ),
63+ null ,
64+ ),
65+ ) + parameters,
66+ )
6467 }
6568 add(PointerDataType (invokeFunctionType, dataTypeManager), " invoke" , null )
6669 add(PointerDataType (BlockDescriptor1DataType (dataTypeManager), dataTypeManager), " descriptor" , null )
@@ -84,21 +87,19 @@ class BlockDescriptor2DataType(
8487 val copyHelperFunctionDataType =
8588 FunctionDefinitionDataType (" copy_helper" ).apply {
8689 returnType = VoidDataType .dataType
87- arguments =
88- arrayOf(
89- ParameterDefinitionImpl (" dst" , PointerDataType (VoidDataType (), dataTypeManager), null ),
90- ParameterDefinitionImpl (" src" , PointerDataType (VoidDataType (), dataTypeManager), null ),
91- )
90+ setArguments(
91+ ParameterDefinitionImpl (" dst" , PointerDataType (VoidDataType (), dataTypeManager), null ),
92+ ParameterDefinitionImpl (" src" , PointerDataType (VoidDataType (), dataTypeManager), null ),
93+ )
9294 }
9395 add(PointerDataType (copyHelperFunctionDataType), " copy_helper" , null )
9496 val disposeHelperFunctionDataType =
9597 FunctionDefinitionDataType (" dispose_helper" ).apply {
9698 returnType = VoidDataType .dataType
97- arguments =
98- arrayOf(
99- ParameterDefinitionImpl (" dst" , PointerDataType (VoidDataType (), dataTypeManager), null ),
100- ParameterDefinitionImpl (" src" , PointerDataType (VoidDataType (), dataTypeManager), null ),
101- )
99+ setArguments(
100+ ParameterDefinitionImpl (" dst" , PointerDataType (VoidDataType (), dataTypeManager), null ),
101+ ParameterDefinitionImpl (" src" , PointerDataType (VoidDataType (), dataTypeManager), null ),
102+ )
102103 }
103104 add(PointerDataType (disposeHelperFunctionDataType, dataTypeManager), " dispose_helper" , null )
104105 }
@@ -149,26 +150,24 @@ class BlockByrefKeepFunctionDefinitionDataType(
149150 init {
150151 val blockByRefPointerType =
151152 PointerDataType (BlockByRef3DataType (dataTypeManager), dataTypeManager)
152- arguments =
153- arrayOf(
154- ParameterDefinitionImpl (null , blockByRefPointerType, null ),
155- ParameterDefinitionImpl (null , blockByRefPointerType, null ),
156- )
153+ setArguments(
154+ ParameterDefinitionImpl (null , blockByRefPointerType, null ),
155+ ParameterDefinitionImpl (null , blockByRefPointerType, null ),
156+ )
157157 }
158158}
159159
160160class BlockByrefDestroyFunctionDefinitionDataType (
161161 dataTypeManager : DataTypeManager ,
162162) : FunctionDefinitionDataType(" BlockByrefDestroyFunction" , dataTypeManager) {
163163 init {
164- arguments =
165- arrayOf(
166- ParameterDefinitionImpl (
167- null ,
168- PointerDataType (BlockByRef3DataType (dataTypeManager), dataTypeManager),
169- null ,
170- ),
171- )
164+ setArguments(
165+ ParameterDefinitionImpl (
166+ null ,
167+ PointerDataType (BlockByRef3DataType (dataTypeManager), dataTypeManager),
168+ null ,
169+ ),
170+ )
172171 }
173172}
174173
0 commit comments