LLVM 20.0.0git
|
Lower @llvm.global_dtors. More...
#include "llvm/Transforms/Utils/LowerGlobalDtors.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include <map>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "lower-global-dtors" |
Functions | |
INITIALIZE_PASS (LowerGlobalDtorsLegacyPass, DEBUG_TYPE, "Lower @llvm.global_dtors via `__cxa_atexit`", false, false) ModulePass *llvm | |
static bool | runImpl (Module &M) |
Lower @llvm.global_dtors.
Implement @llvm.global_dtors by creating wrapper functions that are registered in @llvm.global_ctors and which contain a call to __cxa_atexit
to register their destructor functions.
Definition in file LowerGlobalDtors.cpp.
#define DEBUG_TYPE "lower-global-dtors" |
Definition at line 32 of file LowerGlobalDtors.cpp.
INITIALIZE_PASS | ( | LowerGlobalDtorsLegacyPass | , |
DEBUG_TYPE | , | ||
"Lower @llvm.global_dtors via `__cxa_atexit`" | , | ||
false | , | ||
false | |||
) |
Definition at line 56 of file LowerGlobalDtors.cpp.
Definition at line 77 of file LowerGlobalDtors.cpp.
References llvm::appendToGlobalCtors(), llvm::CallingConv::C, llvm::BranchInst::Create(), llvm::Function::Create(), llvm::CallInst::Create(), llvm::ReturnInst::Create(), llvm::BasicBlock::Create(), llvm::GlobalVariable::eraseFromParent(), llvm::GlobalValue::ExternalWeakLinkage, F, llvm::ConstantPointerNull::get(), llvm::PointerType::get(), llvm::FunctionType::get(), llvm::FunctionCallee::getCallee(), llvm::Intrinsic::getDeclaration(), llvm::ArrayType::getElementType(), llvm::GlobalVariable::getInitializer(), llvm::Type::getInt32Ty(), llvm::Type::getInt8Ty(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::ConstantArray::getType(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::Type::getVoidTy(), llvm::GlobalVariable::hasInitializer(), llvm::GlobalValue::HiddenVisibility, llvm::CmpInst::ICMP_NE, llvm::Constant::isNullValue(), llvm::Null, llvm::User::operands(), llvm::GlobalValue::PrivateLinkage, llvm::reverse(), llvm::GlobalValue::setVisibility(), and llvm::Constant::stripPointerCasts().