25 EmptyModuleStatsTy = makeModuleStatsTy();
31ArrayType *SanitizerStatReport::makeModuleStatsArrayTy() {
35StructType *SanitizerStatReport::makeModuleStatsTy() {
37 {PointerType::getUnqual(M->getContext()),
38 Type::getInt32Ty(M->getContext()),
39 makeModuleStatsArrayTy()});
46 IntegerType *IntPtrTy =
B.getIntPtrTy(M->getDataLayout());
59 M->getOrInsertFunction(
"__sanitizer_stat_report", StatReportTy);
62 EmptyModuleStatsTy, ModuleStatsGV,
64 ConstantInt::get(IntPtrTy, 0), ConstantInt::get(
B.getInt32Ty(), 2),
65 ConstantInt::get(IntPtrTy, Inits.size() - 1),
67 B.CreateCall(StatReport, InitAddr);
86 ConstantInt::get(Int32Ty, Inits.size()),
101 B.CreateCall(StatInit, NewModuleStatsGV);
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class to represent array types.
static ArrayType * get(Type *ElementType, uint64_t NumElements)
This static method is the primary way to construct an ArrayType.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
static Constant * get(ArrayType *T, ArrayRef< Constant * > V)
static Constant * getIntToPtr(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList, GEPNoWrapFlags NW=GEPNoWrapFlags::none(), std::optional< ConstantRange > InRange=std::nullopt, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
static Constant * getAnon(ArrayRef< Constant * > V, bool Packed=false)
Return an anonymous struct that has the specified elements.
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
Class to represent function types.
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
@ InternalLinkage
Rename collisions when linking (static functions).
void eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Class to represent integer types.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
A Module instance is used to store all the information related to an LLVM module.
LLVMContext & getContext() const
Get the global data context.
FunctionCallee getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
Class to represent pointers.
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
Class to represent struct types.
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
The instances of the Type class are immutable: once they are created, they are never changed.
static Type * getVoidTy(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
This is an optimization pass for GlobalISel generic memory operations.
void appendToGlobalCtors(Module &M, Function *F, int Priority, Constant *Data=nullptr)
Append F to the list of global ctors of module M with the given Priority.
void finish()
Finalize module stats array and add global constructor to register it.
SanitizerStatReport(Module *M)
void create(IRBuilder<> &B, SanitizerStatKind SK)
Generates code into B that increments a location-specific counter tagged with the given sanitizer kin...