Creates sanitizer constructor and init functions lazily.
Declared in <llvm/Transforms/Utils/ModuleUtils.h>
std::pair<Function*, FunctionCallee>
getOrCreateSanitizerCtorAndInitFunctions(
Module& M,
StringRef CtorName,
StringRef InitName,
ArrayRef<Type*> InitArgTypes,
ArrayRef<Value*> InitArgs,
function_ref<void(Function*, FunctionCallee)> FunctionsCreatedCallback,
StringRef VersionCheckName = StringRef(),
bool Weak = false);
If a constructor and init function already exist, this function returns them. Otherwise it calls createSanitizerCtorAndInitFunctions. The FunctionsCreatedCallback is invoked in that case, passing the new Ctor and Init function.
Returns pair of pointers to constructor, and init functions respectively.
| Name | Description |
|---|---|
| M | Module in which to look up or create the functions. |
| CtorName | Name of the constructor function. |
| InitName | Name of the sanitizer init function. |
| InitArgTypes | Argument types of the init function. |
| InitArgs | Argument values passed to the init function. |
| FunctionsCreatedCallback | Invoked when new Ctor and Init are created. |
| VersionCheckName | Optional name of a version-check function to call. |
| Weak | If true, declare the init function as a weak external symbol. |