31 Ty, IRB.getInt32(Priority),
F, NULL);
38 unsigned n =
Init->getNumOperands();
39 CurrentCtors.reserve(n + 1);
40 for (
unsigned i = 0; i != n; ++i)
41 CurrentCtors.push_back(cast<Constant>(
Init->getOperand(i)));
43 GVCtor->eraseFromParent();
46 CurrentCtors.push_back(RuntimeCtorInit);
70 const char *
Name = CompilerUsed ?
"llvm.compiler.used" :
"llvm.used";
Special purpose, only applies to global arrays.
The main container class for the LLVM Intermediate Representation.
unsigned getNumOperands() const
void appendToGlobalCtors(Module &M, Function *F, int Priority)
const Constant * getInitializer() const
const GlobalVariable * getGlobalVariable(StringRef Name, bool AllowInternal=false) const
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
Value * stripPointerCastsNoFollowAliases()
Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the origi...
LLVM Constant Representation.
static Constant * get(ArrayType *T, ArrayRef< Constant * > V)
Value * getOperand(unsigned i) const
static Constant * get(StructType *T, ArrayRef< Constant * > V)
static void appendToGlobalArray(const char *Array, Module &M, Function *F, int Priority)
void appendToGlobalDtors(Module &M, Function *F, int Priority)
Same as appendToGlobalCtors(), but for global dtors.
static PointerType * getUnqual(Type *ElementType)
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
GlobalVariable * getNamedGlobal(StringRef Name)
bool hasInitializer() const
static ArrayType * get(Type *ElementType, uint64_t NumElements)
LLVM Value Representation.
GlobalVariable * collectUsedGlobalVariables(Module &M, SmallPtrSet< GlobalValue *, 8 > &Set, bool CompilerUsed)
Given "llvm.used" or "llvm.compiler.used" as a global name, collect the initializer elements of that ...
LLVMContext & getContext() const