Skip to content

Commit ed43adb

Browse files
committed
Document tweaks to generated wrappers.
1 parent 1fb93b4 commit ed43adb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

res/wrap.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ length(ARGS) == 2 || error("Usage: wrap.jl /path/to/llvm-config target")
5858
config = ARGS[1]
5959
ispath(config) || error("llvm-config at $config is't a valid path")
6060

61-
# Use `ccall\(\((:.+), libllvm\), (.*)\)` and replace with `@apicall($1, $2)`
62-
# Use `const (LLVMOpaque.*) = Cvoid` and replace with `mutable struct $1 end`
63-
# Use `awk '/^[[:blank:]]*$/ { print; next; }; {cur = seen[$0]; if(!seen[$0]++ || (/^end$/ && !prev) || /^.*Clang.*$/) print $0; prev=cur}' libLLVM_h.jl > libLLVM_g.jl` to remove duplicates
64-
# Use `cat -s` to remove duplicate empty lines
61+
# Manual clean-up:
62+
# - remove build-host details (HAVE_INTTYPES_H, LLVM_DEFAULT_TARGET_TRIPLE etc) in libLLVM_common.jl
63+
# - remove LLVMInitializeAll and LLVMInitializeNative wrappers (these are macros)
64+
# - remove "# Skipping ..." comments by Clang.jl
65+
# - replace `ccall\(\((:.+), libllvm\), (.*)\)` with `@apicall($1, $2)`
66+
# - replace `const (LLVMOpaque.*) = Cvoid` with `struct $1 end`
67+
# - use `awk '/^[[:blank:]]*$/ { print; next; }; {cur = seen[$0]; if(!seen[$0]++ || (/^end$/ && !prev) || /^.*Clang.*$/) print $0; prev=cur}' libLLVM_h.jl > libLLVM_g.jl` to remove duplicates
68+
# - use `cat -s` to remove duplicate empty lines
6569

6670
target = ARGS[2]
6771
wrap(config, target)

0 commit comments

Comments
 (0)