LLVM 22.0.0git
CtorUtils.cpp File Reference

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.
static std::vector< std::pair< uint32_t, 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.
static GlobalVariablefindGlobalCtors (Module &M)
 Find the llvm.global_ctors list.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "ctor_utils"

Definition at line 23 of file CtorUtils.cpp.

Function Documentation

◆ findGlobalCtors()

◆ parseGlobalCtors()

std::vector< std::pair< uint32_t, Function * > > parseGlobalCtors ( GlobalVariable * GV)
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 64 of file CtorUtils.cpp.

References llvm::cast(), llvm::dyn_cast(), llvm::GlobalVariable::getInitializer(), llvm::User::getNumOperands(), llvm::User::getOperand(), and llvm::User::operands().

Referenced by llvm::optimizeGlobalCtorsList().

◆ removeGlobalCtors()