File tree 2 files changed +5117
-1279
lines changed
2 files changed +5117
-1279
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,20 @@ build!(ctx, BUILDSTAGE_NO_PRINTING)
21
21
function rewrite! (dag:: ExprDAG )
22
22
for node in get_nodes (dag)
23
23
node. type isa Generators. AbstractFunctionNodeType || continue
24
+ func_name = string (node. id)
25
+ handle = Symbol (func_name* " _handle" )
24
26
for expr in node. exprs
25
27
Meta. isexpr (expr, :function ) || continue
26
28
for block_expr in expr. args
27
29
Meta. isexpr (block_expr, :block ) || continue
28
30
for ccall_expr in block_expr. args
29
31
Meta. isexpr (ccall_expr, :call ) || continue
30
- ccall_expr. args[2 ] = :(getprocaddress_e ( $ ( string (node . id))) )
32
+ ccall_expr. args[2 ] = :($ handle[] )
31
33
end
34
+ pushfirst! (block_expr. args, :($ handle[] == C_NULL && ($ handle[] = getprocaddress_e ($ func_name))))
32
35
end
33
36
end
37
+ pushfirst! (node. exprs, :(const $ handle = Ref {Ptr{Cvoid}} ()))
34
38
end
35
39
end
36
40
You can’t perform that action at this time.
0 commit comments