Skip to content

Commit fcae973

Browse files
committed
Further simplify llvmcall
1 parent e4a1edd commit fcae973

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/backtrace.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ NOTE: `f` and all functions reachable from `f` must not contain a yield point.
268268
"""
269269
function withalloca end
270270

271-
function withalloca_wrapper(fptr, int)
272-
f = unsafe_pointer_to_objref(Ptr{Cvoid}(fptr))
271+
function withalloca_wrapper(f, int)
273272
f(Ptr{Cvoid}(int))
274273
nothing
275274
end
@@ -282,10 +281,8 @@ end
282281
top:
283282
%aptr = alloca i8, i$(Sys.WORD_SIZE) %2
284283
%aint = ptrtoint i8* %aptr to i$(Sys.WORD_SIZE)
285-
%wptr = inttoptr i$(Sys.WORD_SIZE) %0 to void (i$(Sys.WORD_SIZE),
286-
i$(Sys.WORD_SIZE))*
287-
%fptr = ptrtoint {}* %1 to i$(Sys.WORD_SIZE)
288-
call void %wptr(i$(Sys.WORD_SIZE) %fptr, i$(Sys.WORD_SIZE) %aint)
284+
%wptr = inttoptr i$(Sys.WORD_SIZE) %0 to void ({}*, i$(Sys.WORD_SIZE))*
285+
call void %wptr({}* %1, i$(Sys.WORD_SIZE) %aint)
289286
ret void
290287
}
291288
""",
@@ -295,7 +292,7 @@ end
295292
Tuple{Ptr{Cvoid},Any,Int},
296293
Base.unsafe_convert(
297294
Ptr{Cvoid},
298-
@cfunction(withalloca_wrapper, Cvoid, (UInt,UInt)),
295+
@cfunction(withalloca_wrapper, Cvoid, (Any,UInt)),
299296
),
300297
f,
301298
nbytes,

0 commit comments

Comments
 (0)