struct LTOModule

Declaration

struct LTOModule { /* full declaration omitted */ };

Description

C++ class which implements the opaque lto_module_t type.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:38

Method Overview

  • public static ErrorOr<std::unique_ptr<LTOModule>> createFromBuffer(llvm::LLVMContext & Context, const void * mem, size_t length, const llvm::TargetOptions & options, llvm::StringRef path = "")
  • public static ErrorOr<std::unique_ptr<LTOModule>> createFromFile(llvm::LLVMContext & Context, llvm::StringRef path, const llvm::TargetOptions & options)
  • public static ErrorOr<std::unique_ptr<LTOModule>> createFromOpenFile(llvm::LLVMContext & Context, int fd, llvm::StringRef path, size_t size, const llvm::TargetOptions & options)
  • public static ErrorOr<std::unique_ptr<LTOModule>> createFromOpenFileSlice(llvm::LLVMContext & Context, int fd, llvm::StringRef path, size_t map_size, off_t offset, const llvm::TargetOptions & options)
  • public static ErrorOr<std::unique_ptr<LTOModule>> createInLocalContext(std::unique_ptr<LLVMContext> Context, const void * mem, size_t length, const llvm::TargetOptions & options, llvm::StringRef path)
  • public static lto::InputFile * createInputFile(const void * buffer, size_t buffer_size, const char * path, std::string & out_error)
  • public const std::vector<StringRef> & getAsmUndefinedRefs()
  • public static const char * getDependentLibrary(lto::InputFile * input, size_t index, size_t * size)
  • public static size_t getDependentLibraryCount(lto::InputFile * input)
  • public llvm::StringRef getLinkerOpts()
  • public llvm::Module & getModule()
  • public const llvm::Module & getModule() const
  • public static std::string getProducerString(llvm::MemoryBuffer * Buffer)
  • public lto_symbol_attributes getSymbolAttributes(uint32_t index)
  • public uint32_t getSymbolCount()
  • public const llvm::GlobalValue * getSymbolGV(uint32_t index)
  • public llvm::StringRef getSymbolName(uint32_t index)
  • public const std::string & getTargetTriple()
  • public static bool isBitcodeFile(llvm::StringRef path)
  • public static bool isBitcodeFile(const void * mem, size_t length)
  • public static bool isBitcodeForTarget(llvm::MemoryBuffer * memBuffer, llvm::StringRef triplePrefix)
  • public bool isThinLTO()
  • public static std::unique_ptr<MemoryBuffer> makeBuffer(const void * mem, size_t length, llvm::StringRef name = "")
  • public void setTargetTriple(llvm::StringRef Triple)
  • public std::unique_ptr<Module> takeModule()
  • public ~LTOModule()

Methods

static ErrorOr<std::unique_ptr<LTOModule>>
createFromBuffer(
    llvm::LLVMContext& Context,
    const void* mem,
    size_t length,
    const llvm::TargetOptions& options,
    llvm::StringRef path = "")

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:110

Parameters

llvm::LLVMContext& Context
const void* mem
size_t length
const llvm::TargetOptions& options
llvm::StringRef path = ""

static ErrorOr<std::unique_ptr<LTOModule>>
createFromFile(llvm::LLVMContext& Context,
               llvm::StringRef path,
               const llvm::TargetOptions& options)

Description

Create an LTOModule. N.B. These methods take ownership of the buffer. The caller must have initialized the Targets, the TargetMCs, the AsmPrinters, and the AsmParsers by calling: InitializeAllTargets(); InitializeAllTargetMCs(); InitializeAllAsmPrinters(); InitializeAllAsmParsers();

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:100

Parameters

llvm::LLVMContext& Context
llvm::StringRef path
const llvm::TargetOptions& options

static ErrorOr<std::unique_ptr<LTOModule>>
createFromOpenFile(
    llvm::LLVMContext& Context,
    int fd,
    llvm::StringRef path,
    size_t size,
    const llvm::TargetOptions& options)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:103

Parameters

llvm::LLVMContext& Context
int fd
llvm::StringRef path
size_t size
const llvm::TargetOptions& options

static ErrorOr<std::unique_ptr<LTOModule>>
createFromOpenFileSlice(
    llvm::LLVMContext& Context,
    int fd,
    llvm::StringRef path,
    size_t map_size,
    off_t offset,
    const llvm::TargetOptions& options)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:106

Parameters

llvm::LLVMContext& Context
int fd
llvm::StringRef path
size_t map_size
off_t offset
const llvm::TargetOptions& options

static ErrorOr<std::unique_ptr<LTOModule>>
createInLocalContext(
    std::unique_ptr<LLVMContext> Context,
    const void* mem,
    size_t length,
    const llvm::TargetOptions& options,
    llvm::StringRef path)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:113

Parameters

std::unique_ptr<LLVMContext> Context
const void* mem
size_t length
const llvm::TargetOptions& options
llvm::StringRef path

static lto::InputFile* createInputFile(
    const void* buffer,
    size_t buffer_size,
    const char* path,
    std::string& out_error)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:161

Parameters

const void* buffer
size_t buffer_size
const char* path
std::string& out_error

const std::vector<StringRef>&
getAsmUndefinedRefs()

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:159

static const char* getDependentLibrary(
    lto::InputFile* input,
    size_t index,
    size_t* size)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:166

Parameters

lto::InputFile* input
size_t index
size_t* size

static size_t getDependentLibraryCount(
    lto::InputFile* input)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:164

Parameters

lto::InputFile* input

llvm::StringRef getLinkerOpts()

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:157

llvm::Module& getModule()

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:118

const llvm::Module& getModule() const

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:117

static std::string getProducerString(
    llvm::MemoryBuffer* Buffer)

Description

Returns a string representing the producer identification stored in the bitcode, or "" if the bitcode does not contains any.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:85

Parameters

llvm::MemoryBuffer* Buffer

lto_symbol_attributes getSymbolAttributes(
    uint32_t index)

Description

Get the attributes for a symbol at the specified index.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:138

Parameters

uint32_t index

uint32_t getSymbolCount()

Description

Get the number of symbols

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:133

const llvm::GlobalValue* getSymbolGV(
    uint32_t index)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:151

Parameters

uint32_t index

llvm::StringRef getSymbolName(uint32_t index)

Description

Get the name of the symbol at the specified index.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:145

Parameters

uint32_t index

const std::string& getTargetTriple()

Description

Return the Module's target triple.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:123

static bool isBitcodeFile(llvm::StringRef path)

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:72

Parameters

llvm::StringRef path

static bool isBitcodeFile(const void* mem,
                          size_t length)

Description

Returns 'true' if the file or memory contents is LLVM bitcode.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:71

Parameters

const void* mem
size_t length

static bool isBitcodeForTarget(
    llvm::MemoryBuffer* memBuffer,
    llvm::StringRef triplePrefix)

Description

Returns 'true' if the memory buffer is LLVM bitcode for the specified triple.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:79

Parameters

llvm::MemoryBuffer* memBuffer
llvm::StringRef triplePrefix

bool isThinLTO()

Description

Returns 'true' if the Module is produced for ThinLTO.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:75

static std::unique_ptr<MemoryBuffer> makeBuffer(
    const void* mem,
    size_t length,
    llvm::StringRef name = "")

Description

Create a MemoryBuffer from a memory range with an optional name.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:89

Parameters

const void* mem
size_t length
llvm::StringRef name = ""

void setTargetTriple(llvm::StringRef Triple)

Description

Set the Module's target triple.

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:128

Parameters

llvm::StringRef Triple

std::unique_ptr<Module> takeModule()

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:120

~LTOModule()

Declared at: llvm/include/llvm/LTO/legacy/LTOModule.h:68