LLVM
8.0.1
|
Lower .global_dtors. More...
#include "WebAssembly.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "wasm-lower-global-dtors" |
Functions | |
INITIALIZE_PASS (LowerGlobalDtors, DEBUG_TYPE, "Lower @llvm.global_dtors for WebAssembly", false, false) ModulePass *llvm | |
Lower .global_dtors.
WebAssembly doesn't have a builtin way to invoke static destructors. Implement .global_dtors by creating wrapper functions that are registered in .global_ctors and which contain a call to __cxa_atexit
to register their destructor functions.
Definition in file WebAssemblyLowerGlobalDtors.cpp.
#define DEBUG_TYPE "wasm-lower-global-dtors" |
Definition at line 32 of file WebAssemblyLowerGlobalDtors.cpp.
INITIALIZE_PASS | ( | LowerGlobalDtors | , |
DEBUG_TYPE | , | ||
"Lower @llvm.global_dtors for WebAssembly" | , | ||
false | , | ||
false | |||
) |
Definition at line 54 of file WebAssemblyLowerGlobalDtors.cpp.
References llvm::appendToGlobalCtors(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, C, llvm::BasicBlock::Create(), llvm::Function::Create(), llvm::CallInst::Create(), llvm::ReturnInst::Create(), llvm::BranchInst::Create(), llvm::dbgs(), llvm::dyn_cast(), llvm::GlobalVariable::eraseFromParent(), llvm::GlobalValue::ExternalWeakLinkage, llvm::FunctionType::get(), llvm::PointerType::get(), llvm::ConstantPointerNull::get(), llvm::Module::getContext(), llvm::Intrinsic::getDeclaration(), llvm::SequentialType::getElementType(), llvm::Module::getGlobalVariable(), llvm::GlobalVariable::getInitializer(), llvm::Type::getInt32Ty(), llvm::Type::getInt8PtrTy(), llvm::Type::getInt8Ty(), llvm::ConstantInt::getLimitedValue(), llvm::Value::getName(), llvm::Module::getNamedValue(), llvm::Constant::getNullValue(), llvm::StructType::getNumElements(), llvm::User::getOperand(), llvm::Module::getOrInsertFunction(), llvm::Value::getType(), llvm::ConstantArray::getType(), llvm::CompositeType::getTypeAtIndex(), llvm::Type::getVoidTy(), llvm::GlobalValue::HiddenVisibility, llvm::CmpInst::ICMP_NE, llvm::Type::isIntegerTy(), llvm::Constant::isNullValue(), llvm::Type::isPointerTy(), LLVM_DEBUG, llvm::RISCVFenceField::O, llvm::User::operands(), llvm::GlobalValue::PrivateLinkage, llvm::GlobalValue::setVisibility(), llvm::Value::stripPointerCastsNoFollowAliases(), and llvm::Intrinsic::trap.