mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-27 02:34:52 -06:00
44bdd10e5c
* wasm: build without --export-all, annotate exports and "used" functions This introduces three #define statements, - WASM_EXPORT(name) - OPA_BUILTIN - OPA_INTERNAL The first one makes LLVM _export_ a function (by the passed name), the latter two make LLVM keep them, so they're not removed when it's deleting dead code. Under the hood, there is no distinction between OPA_BUILTIN and OPA_INTERNAL. OPA_BUILTIN is used for functions that are the; implementation of a builtin; OPA_INTERNAL is used for functions that the planner generates calls to (i.e., parts implemented in C, but not directly corresponding to builtins). * wasm: read func indices from name section The Name section (a custom section) includes imports, exports, and the names of "ordinary" functions. Since we no longer export everything, it allows us to map names to func indices. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>