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
MModule in which to create the constructor and init functions.
CtorNameName of the constructor function to create.
InitNameName of the sanitizer init function to call.
InitArgTypesArgument types of the init function.
InitArgsArgument values passed to the init function.
VersionCheckNameOptional name of a version-check function to call.
WeakIf true, declare the init function as a weak external symbol.