Module

Modules are the top level container of all other LLVM Intermediate Representation (IR) objects. Each Module contains metadata about your program, a list of globals variables, a list of functions, a list of libraries (or other modules) yours depends on. It also holds a symbol table and various data about the target’s Triple characteristics.

llvm::Module::getOrInsertFunction

Look up the specified function in the module symbol table.

If it does not exist, register a prototype for the function and return it. Otherwise, return the existing function.

FunctionCallee getOrInsertFunction(StringRef Name, FunctionType* T);

llvm::Module::getFunction

Look up the specified function in the module symbol table.

If it does not exist, return nullptr.

Function* getFunction(StringRef Name) const;

llvm::Module::setTargetTriple

Set the target Triple. It may be used to specifically target a CPU architecture.

void setTargetTriple(StringRef T);