Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Receive EMULATED_FUNCTION_POINTER_CASTS #233

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/Target/JSBackend/JSBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ EmulatedFunctionPointers("emscripten-emulated-function-pointers",
cl::desc("Emulate function pointers, avoiding asm.js function tables (see emscripten EMULATED_FUNCTION_POINTERS option)"),
cl::init(false));

static cl::opt<bool>
EmulateFunctionPointerCasts("emscripten-emulate-function-pointer-casts",
cl::desc("Emulate function pointers casts, handling extra or ignored parameters (see emscripten EMULATE_FUNCTION_POINTER_CASTS option)"),
cl::init(false));

static cl::opt<int>
EmscriptenAssertions("emscripten-assertions",
cl::desc("Additional JS-specific assertions (see emscripten ASSERTIONS)"),
Expand Down Expand Up @@ -3409,7 +3414,7 @@ void JSWriter::printFunctionBody(const Function *F) {
// use a simple i64-based ABI for everything, using function pointers for dlsym etc. (otherwise, if we used an
// export which is callable by JS - not using the i64 ABI - that would not be a proper function pointer for
// a wasm->wasm call).
if (WebAssembly && EmulatedFunctionPointers) {
if (WebAssembly && EmulateFunctionPointerCasts) {
getFunctionIndex(F);
}
}
Expand Down