@@ -261,29 +261,34 @@ end
261
261
262
262
function classify_arguments (@nospecialize (job:: CompilerJob ), codegen_ft:: LLVM.FunctionType )
263
263
source_sig = job. source. specTypes
264
-
265
264
source_types = [source_sig. parameters... ]
266
265
266
+ source_argnames = Base. method_argnames (job. source. def)
267
+ while length (source_argnames) < length (source_types)
268
+ # this is probably due to a trailing vararg; repeat its name
269
+ push! (source_argnames, source_argnames[end ])
270
+ end
271
+
267
272
codegen_types = parameters (codegen_ft)
268
273
269
274
args = []
270
275
codegen_i = 1
271
- for (source_i, source_typ) in enumerate (source_types)
276
+ for (source_i, ( source_typ, source_name)) in enumerate (zip ( source_types, source_argnames) )
272
277
if isghosttype (source_typ) || Core. Compiler. isconstType (source_typ)
273
- push! (args, (cc= GHOST, typ= source_typ))
278
+ push! (args, (cc= GHOST, typ= source_typ, name = source_name ))
274
279
continue
275
280
end
276
281
277
282
codegen_typ = codegen_types[codegen_i]
278
283
if codegen_typ isa LLVM. PointerType && ! issized (eltype (codegen_typ))
279
- push! (args, (cc= MUT_REF, typ= source_typ,
284
+ push! (args, (cc= MUT_REF, typ= source_typ, name = source_name,
280
285
codegen= (typ= codegen_typ, i= codegen_i)))
281
286
elseif codegen_typ isa LLVM. PointerType && issized (eltype (codegen_typ)) &&
282
287
! (source_typ <: Ptr ) && ! (source_typ <: Core.LLVMPtr )
283
- push! (args, (cc= BITS_REF, typ= source_typ,
288
+ push! (args, (cc= BITS_REF, typ= source_typ, name = source_name,
284
289
codegen= (typ= codegen_typ, i= codegen_i)))
285
290
else
286
- push! (args, (cc= BITS_VALUE, typ= source_typ,
291
+ push! (args, (cc= BITS_VALUE, typ= source_typ, name = source_name,
287
292
codegen= (typ= codegen_typ, i= codegen_i)))
288
293
end
289
294
codegen_i += 1
0 commit comments