If EmbedBitcode is set, save a copy of the llvm IR as data in the __LLVM,__bitcode section (.llvmbc on non‐MacOS). If available, pass the serialized module via the Buf parameter. If not, pass an empty (default‐initialized) MemoryBufferRef, and the serialization will be handled by this API. The same behavior happens if the provided Buf is not bitcode (i.e. if it's invalid data or even textual LLVM assembly). If EmbedCmdline is set, the command line is also exported in the corresponding section (__LLVM,_cmdline / .llvmcmd) ‐ even if CmdArgs were empty.

Synopsis

Declared in <llvm/Bitcode/BitcodeWriter.h>

void
embedBitcodeInModule(
    Module& M,
    MemoryBufferRef Buf,
    bool EmbedBitcode,
    bool EmbedCmdline,
    std::vector<uint8_t> const& CmdArgs);

Parameters

Name

Description

M

A 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.

CmdArgs

A standard container which offers fixed time access to individual elements in any order.

Created with MrDocs