LLVM 20.0.0git
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"

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 32 of file WebAssemblyAddMissingPrototypes.cpp.

Function Documentation

◆ INITIALIZE_PASS()

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

Definition at line 54 of file WebAssemblyAddMissingPrototypes.cpp.