|
LLVM
8.0.1
|
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 | |
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.
| #define DEBUG_TYPE "wasm-add-missing-prototypes" |
Definition at line 33 of file WebAssemblyAddMissingPrototypes.cpp.
| INITIALIZE_PASS | ( | WebAssemblyAddMissingPrototypes | , |
| DEBUG_TYPE | , | ||
| "Add prototypes to prototypes-less functions" | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 55 of file WebAssemblyAddMissingPrototypes.cpp.
References llvm::Function::Create(), llvm::IRBuilder< T, Inserter >::CreatePointerCast(), llvm::dbgs(), llvm::Value::dump(), llvm::Function::eraseFromParent(), F(), llvm::ConstantExpr::getPointerCast(), llvm::Value::getType(), I, LLVM_DEBUG, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Function::removeFnAttr(), llvm::Value::replaceAllUsesWith(), llvm::report_fatal_error(), and llvm::Function::setAttributes().
1.8.13