llvm::appendToGlobalCtors

Append F to the list of global ctors of module M with the given Priority. This wraps the function in the appropriate structure and stores it along side other global constructors. For details see https://llvm.org/docs/LangRef.html#the-llvm-global-ctors-global-variable

Synopsis

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

void
appendToGlobalCtors(
    Module& M,
    Function* F,
    int Priority,
    Constant* Data = nullptr);

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.
DataThis is an important base class in LLVM. It provides the common facilities of all constant values in an LLVM program. A constant is a value that is immutable at runtime. Functions are constants because their address is immutable. Same with global variables.