LLVM 22.0.0git
WebAssemblyAddMissingPrototypes.cpp File Reference

Add prototypes to prototypes-less functions. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-add-missing-prototypes"

Functions

 INITIALIZE_PASS (WebAssemblyAddMissingPrototypes, DEBUG_TYPE, "Add prototypes to prototypes-less functions", false, false) ModulePass *llvm

Detailed Description

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.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-add-missing-prototypes"

Definition at line 31 of file WebAssemblyAddMissingPrototypes.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( WebAssemblyAddMissingPrototypes ,
DEBUG_TYPE ,
"Add prototypes to prototypes-less functions" ,
false ,
false  )