@@ -312,42 +312,31 @@ end
312
312
GHOST # not passed
313
313
end
314
314
315
- function method_argnames (m:: Method )
316
- argnames = ccall (:jl_uncompress_argnames , Vector{Symbol}, (Any,), m. slot_syms)
317
- isempty (argnames) && return argnames
318
- return argnames[1 : m. nargs]
319
- end
320
-
321
315
function classify_arguments (@nospecialize (job:: CompilerJob ), codegen_ft:: LLVM.FunctionType )
322
316
source_sig = typed_signature (job)
323
317
324
318
source_types = [source_sig. parameters... ]
325
- source_method = only (method_matches (typed_signature (job); job. source. world)). method
326
- source_arguments = method_argnames (source_method)
327
319
328
320
codegen_types = parameters (codegen_ft)
329
321
330
322
args = []
331
323
codegen_i = 1
332
324
for (source_i, source_typ) in enumerate (source_types)
333
- source_name = source_arguments[min (source_i, length (source_arguments))]
334
- # NOTE: in case of varargs, we have fewer arguments than parameters
335
-
336
325
if isghosttype (source_typ) || Core. Compiler. isconstType (source_typ)
337
- push! (args, (cc= GHOST, typ= source_typ, name = source_name ))
326
+ push! (args, (cc= GHOST, typ= source_typ))
338
327
continue
339
328
end
340
329
341
330
codegen_typ = codegen_types[codegen_i]
342
331
if codegen_typ isa LLVM. PointerType && ! issized (eltype (codegen_typ))
343
- push! (args, (cc= MUT_REF, typ= source_typ, name = source_name,
332
+ push! (args, (cc= MUT_REF, typ= source_typ,
344
333
codegen= (typ= codegen_typ, i= codegen_i)))
345
334
elseif codegen_typ isa LLVM. PointerType && issized (eltype (codegen_typ)) &&
346
335
! (source_typ <: Ptr ) && ! (source_typ <: Core.LLVMPtr )
347
- push! (args, (cc= BITS_REF, typ= source_typ, name = source_name,
336
+ push! (args, (cc= BITS_REF, typ= source_typ,
348
337
codegen= (typ= codegen_typ, i= codegen_i)))
349
338
else
350
- push! (args, (cc= BITS_VALUE, typ= source_typ, name = source_name,
339
+ push! (args, (cc= BITS_VALUE, typ= source_typ,
351
340
codegen= (typ= codegen_typ, i= codegen_i)))
352
341
end
353
342
codegen_i += 1
@@ -356,37 +345,6 @@ function classify_arguments(@nospecialize(job::CompilerJob), codegen_ft::LLVM.Fu
356
345
return args
357
346
end
358
347
359
- function classify_fields (julia:: DataType , llvm:: LLVMType )
360
- nfields = fieldcount (julia)
361
- fieldoffsets = [fieldoffset (julia, i) for i in 1 : nfields]
362
- fieldsizes = similar (fieldoffsets)
363
- for i in 1 : nfields
364
- field_start = fieldoffsets[i]
365
- field_end = i == nfields ? sizeof (julia) : fieldoffsets[i+ 1 ]
366
- fieldsizes[i] = field_end - field_start
367
- end
368
- fieldsizes
369
-
370
- args = []
371
- codegen_i = 1
372
- for source_i in 1 : nfields
373
- source_name = fieldname (julia, source_i)
374
- source_typ = fieldtype (julia, source_i)
375
- if fieldsizes[source_i] == 0
376
- push! (args, (; typ= source_typ, name= source_name))
377
- continue
378
- end
379
-
380
- # NOTE: a cc doesn't make sense here, so the lack of codegen field should be checked
381
-
382
- codegen_typ = elements (llvm)[codegen_i]
383
- push! (args, (typ= source_typ, name= source_name, codegen= (typ= codegen_typ, i= codegen_i)))
384
- codegen_i += 1
385
- end
386
-
387
- return args
388
- end
389
-
390
348
if VERSION >= v " 1.7.0-DEV.204"
391
349
function is_immutable_datatype (T:: Type )
392
350
isa (T,DataType) && ! Base. ismutabletype (T)
0 commit comments