LLVM: lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp File Reference (original) (raw)

Add prototypes to prototypes-less functions.

WebAssembly has strict function prototype checking so we need functions declarations to match the call sites. Clang treats prototype-less functions as varargs (foo(...)) which happens to work on existing platforms but doesn't under WebAssembly. This pass will find all the call sites of each prototype-less function, ensure they agree, and then set the signature on the function declaration accordingly.

Definition in file WebAssemblyAddMissingPrototypes.cpp.