llvm::createSanitizerCtorAndInitFunctions

Creates sanitizer constructor function, and calls sanitizer's init function from it.

Synopsis

Declared in <llvm/Transforms/Utils/ModuleUtils.h>

std::pair<Function*, FunctionCallee>
createSanitizerCtorAndInitFunctions(
    Module& M,
    StringRef CtorName,
    StringRef InitName,
    ArrayRef<Type*> InitArgTypes,
    ArrayRef<Value*> InitArgs,
    StringRef VersionCheckName = StringRef(),
    bool Weak = false);

Return Value

Returns pair of pointers to constructor, and init functions respectively.

Parameters

NameDescription
MA Module instance is used to store all the information related to an LLVM module. Modules are the top level container of all other LLVM Intermediate Representation (IR) objects. Each module directly contains a list of globals variables, a list of functions, a list of libraries (or other modules) this module depends on, a symbol table, and various data about the target's characteristics.
CtorNameRepresent a constant reference to a string, i.e. a character array and a length, which need not be null terminated.
InitNameRepresent a constant reference to a string, i.e. a character array and a length, which need not be null terminated.
InitArgTypesRepresent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently.
InitArgsRepresent a constant reference to an array (0 or more elements consecutively in memory), i.e. a start pointer and a length. It allows various APIs to take consecutive elements easily and conveniently.
VersionCheckNameRepresent a constant reference to a string, i.e. a character array and a length, which need not be null terminated.