LLVM  9.0.0svn
Macros | Functions
WebAssemblyAddMissingPrototypes.cpp File Reference

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

#include "WebAssembly.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
Include dependency graph for WebAssemblyAddMissingPrototypes.cpp:

Go to the source code of this file.


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


 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


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

Definition at line 32 of file WebAssemblyAddMissingPrototypes.cpp.

Function Documentation


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