@@ -25,10 +25,6 @@ function check_method(@nospecialize(job::CompilerJob))
2525 return
2626end
2727
28- if VERSION < v " 1.1.0-DEV.593"
29- fieldtypes (@nospecialize (dt)) = ntuple (i-> fieldtype (dt, i), fieldcount (dt))
30- end
31-
3228# The actual check is rather complicated
3329# and might change from version to version...
3430function hasfieldcount (@nospecialize (dt))
@@ -60,24 +56,13 @@ function check_invocation(@nospecialize(job::CompilerJob), entry::LLVM.Function)
6056 sig = Base. signature_type (job. source. f, job. source. tt):: Type
6157 for (arg_i,dt) in enumerate (sig. parameters)
6258 isghosttype (dt) && continue
63- VERSION >= v " 1.5.0-DEV.581 " && Core. Compiler. isconstType (dt) && continue
59+ Core. Compiler. isconstType (dt) && continue
6460 real_arg_i += 1
6561
6662 if ! isbitstype (dt)
67- if VERSION >= v " 1.5.0-DEV.581"
68- throw (KernelError (job, " passing and using non-bitstype argument" ,
69- """ Argument $arg_i to your kernel function is of type $dt , which is not isbits:
70- $(explain_nonisbits (dt)) """ ))
71- else
72- # be slightly more lenient pre 1.5, to support `function(::Type, ...)`
73- param = parameters (entry)[real_arg_i]
74- if ! isempty (uses (param))
75- throw (KernelError (job, " passing and using non-bitstype argument" ,
76- """ Argument $arg_i to your kernel function is of type $dt , which is not isbits:
77- $(explain_nonisbits (dt))
78- Passing non-isbits types is only allowed if they they are unused by the kernel.""" ))
79- end
80- end
63+ throw (KernelError (job, " passing and using non-bitstype argument" ,
64+ """ Argument $arg_i to your kernel function is of type $dt , which is not isbits:
65+ $(explain_nonisbits (dt)) """ ))
8166 end
8267 end
8368
@@ -167,15 +152,7 @@ function check_ir!(job, errors::Vector{IRError}, inst::LLVM.CallInst)
167152 end
168153 elseif fn == " jl_invoke"
169154 try
170- if VERSION < v " 1.3.0-DEV.244"
171- meth, args, nargs, _ = operands (inst)
172- else
173- f, args, nargs, meth = operands (inst)
174- end
175- if VERSION < v " 1.5.0-DEV.802"
176- # addrspacecast
177- meth = first (operands (meth:: ConstantExpr ))
178- end
155+ f, args, nargs, meth = operands (inst)
179156 meth = first (operands (meth:: ConstantExpr )):: ConstantInt
180157 meth = convert (Int, meth)
181158 meth = Ptr {Cvoid} (meth)
@@ -187,19 +164,7 @@ function check_ir!(job, errors::Vector{IRError}, inst::LLVM.CallInst)
187164 end
188165 elseif fn == " jl_apply_generic"
189166 try
190- if VERSION < v " 1.3.0-DEV.244"
191- args, nargs, _ = operands (inst)
192- # # args is a buffer where arguments are stored in
193- f, args = user .(uses (args))
194- # # first store into the args buffer is a direct store
195- f = first (operands (f:: LLVM.StoreInst )):: ConstantExpr
196- else
197- f, args, nargs, _ = operands (inst)
198- end
199-
200- if VERSION < v " 1.5.0-DEV.802"
201- f = first (operands (f:: ConstantExpr )) # get rid of addrspacecast
202- end
167+ f, args, nargs, _ = operands (inst)
203168 f = first (operands (f)):: ConstantInt # get rid of inttoptr
204169 f = convert (Int, f)
205170 f = Ptr {Cvoid} (f)
@@ -245,11 +210,7 @@ function check_ir!(job, errors::Vector{IRError}, inst::LLVM.CallInst)
245210 frames = ccall (:jl_lookup_code_address , Any, (Ptr{Cvoid}, Cint,), ptr, 0 )
246211 if length (frames) >= 1
247212 @compiler_assert length (frames) == 1 job frames= frames
248- if VERSION >= v " 1.4.0-DEV.123"
249- fn, file, line, linfo, fromC, inlined = last (frames)
250- else
251- fn, file, line, linfo, fromC, inlined, ip = last (frames)
252- end
213+ fn, file, line, linfo, fromC, inlined = last (frames)
253214 push! (errors, (POINTER_FUNCTION, bt, fn))
254215 else
255216 push! (errors, (POINTER_FUNCTION, bt, nothing ))
0 commit comments