LLVM
8.0.1
|
#include "llvm/Transforms/Utils/CtorUtils.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "ctor_utils" |
Functions | |
static void | removeGlobalCtors (GlobalVariable *GCL, const BitVector &CtorsToRemove) |
Given a specified llvm.global_ctors list, remove the listed elements. More... | |
static std::vector< Function * > | parseGlobalCtors (GlobalVariable *GV) |
Given a llvm.global_ctors list that we can understand, return a list of the functions and null terminator as a vector. More... | |
static GlobalVariable * | findGlobalCtors (Module &M) |
Find the llvm.global_ctors list, verifying that all initializers have an init priority of 65535. More... | |
#define DEBUG_TYPE "ctor_utils" |
Definition at line 23 of file CtorUtils.cpp.
|
static |
Find the llvm.global_ctors list, verifying that all initializers have an init priority of 65535.
Definition at line 81 of file CtorUtils.cpp.
References llvm::Module::getGlobalVariable(), llvm::GlobalVariable::getInitializer(), llvm::User::getOperand(), llvm::ConstantInt::getZExtValue(), llvm::GlobalVariable::hasUniqueInitializer(), and llvm::User::operands().
Referenced by llvm::optimizeGlobalCtorsList().
|
static |
Given a llvm.global_ctors list that we can understand, return a list of the functions and null terminator as a vector.
Definition at line 66 of file CtorUtils.cpp.
References llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Constant::isNullValue(), and llvm::User::operands().
Referenced by llvm::optimizeGlobalCtorsList().
|
static |
Given a specified llvm.global_ctors list, remove the listed elements.
Definition at line 28 of file CtorUtils.cpp.
References E, llvm::GlobalVariable::eraseFromParent(), llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::ConstantExpr::getBitCast(), llvm::SequentialType::getElementType(), llvm::Module::getGlobalList(), llvm::GlobalVariable::getInitializer(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::GlobalValue::getLinkage(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::GlobalValue::getParent(), llvm::GlobalValue::getThreadLocalMode(), llvm::Value::getType(), llvm::GlobalValue::getType(), llvm::ConstantArray::getType(), I, llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), llvm::GlobalVariable::isConstant(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::GlobalVariable::setInitializer(), llvm::Value::takeName(), llvm::BitVector::test(), and llvm::Value::use_empty().
Referenced by llvm::optimizeGlobalCtorsList().