LLVM API Documentation

Classes | Public Member Functions | Static Public Member Functions
llvm::LTOModule Struct Reference

#include <LTOModule.h>

List of all members.

Classes

struct  NameAndAttributes

Public Member Functions

const ModulegetModule () const
ModulegetModule ()
const std::string & getTargetTriple ()
 Return the Module's target triple.
void setTargetTriple (StringRef Triple)
 Set the Module's target triple.
uint32_t getSymbolCount ()
 Get the number of symbols.
lto_symbol_attributes getSymbolAttributes (uint32_t index)
 Get the attributes for a symbol at the specified index.
const char * getSymbolName (uint32_t index)
 Get the name of the symbol at the specified index.
uint32_t getDependentLibraryCount ()
 Get the number of dependent libraries.
const char * getDependentLibrary (uint32_t index)
 Get the dependent library at the specified index.
uint32_t getLinkerOptCount ()
 Get the number of linker options.
const char * getLinkerOpt (uint32_t index)
 Get the linker option at the specified index.
const std::vector< const char * > & getAsmUndefinedRefs ()

Static Public Member Functions

static bool isBitcodeFile (const void *mem, size_t length)
 Returns 'true' if the file or memory contents is LLVM bitcode.
static bool isBitcodeFile (const char *path)
static bool isBitcodeForTarget (MemoryBuffer *memBuffer, StringRef triplePrefix)
static std::unique_ptr
< MemoryBuffer
makeBuffer (const void *mem, size_t length, StringRef name="")
 Create a MemoryBuffer from a memory range with an optional name.
static LTOModulecreateFromFile (const char *path, TargetOptions options, std::string &errMsg)
static LTOModulecreateFromOpenFile (int fd, const char *path, size_t size, TargetOptions options, std::string &errMsg)
static LTOModulecreateFromOpenFileSlice (int fd, const char *path, size_t map_size, off_t offset, TargetOptions options, std::string &errMsg)
static LTOModulecreateFromBuffer (const void *mem, size_t length, TargetOptions options, std::string &errMsg, StringRef path="")

Detailed Description

C++ class which implements the opaque lto_module_t type.

Definition at line 38 of file LTOModule.h.


Member Function Documentation

LTOModule * LTOModule::createFromBuffer ( const void *  mem,
size_t  length,
TargetOptions  options,
std::string &  errMsg,
StringRef  path = "" 
) [static]

Definition at line 105 of file LTOModule.cpp.

LTOModule * LTOModule::createFromFile ( const char *  path,
TargetOptions  options,
std::string &  errMsg 
) [static]

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();

Definition at line 73 of file LTOModule.cpp.

References llvm::ErrorOr< T >::get(), llvm::ErrorOr< T >::getError(), and llvm::MemoryBuffer::getFile().

LTOModule * LTOModule::createFromOpenFile ( int  fd,
const char *  path,
size_t  size,
TargetOptions  options,
std::string &  errMsg 
) [static]

Definition at line 85 of file LTOModule.cpp.

References createFromOpenFileSlice().

LTOModule * LTOModule::createFromOpenFileSlice ( int  fd,
const char *  path,
size_t  map_size,
off_t  offset,
TargetOptions  options,
std::string &  errMsg 
) [static]
const std::vector<const char*>& llvm::LTOModule::getAsmUndefinedRefs ( ) [inline]

Definition at line 158 of file LTOModule.h.

Referenced by llvm::LTOCodeGenerator::addModule().

const char* llvm::LTOModule::getDependentLibrary ( uint32_t  index) [inline]

Get the dependent library at the specified index.

Definition at line 140 of file LTOModule.h.

Get the number of dependent libraries.

Definition at line 135 of file LTOModule.h.

const char* llvm::LTOModule::getLinkerOpt ( uint32_t  index) [inline]

Get the linker option at the specified index.

Definition at line 152 of file LTOModule.h.

uint32_t llvm::LTOModule::getLinkerOptCount ( ) [inline]

Get the number of linker options.

Definition at line 147 of file LTOModule.h.

Definition at line 98 of file LTOModule.h.

Referenced by llvm::LTOCodeGenerator::addModule(), getTargetTriple(), and setTargetTriple().

Definition at line 101 of file LTOModule.h.

Get the attributes for a symbol at the specified index.

Definition at line 121 of file LTOModule.h.

References attributes.

uint32_t llvm::LTOModule::getSymbolCount ( ) [inline]

Get the number of symbols.

Definition at line 116 of file LTOModule.h.

const char* llvm::LTOModule::getSymbolName ( uint32_t  index) [inline]

Get the name of the symbol at the specified index.

Definition at line 128 of file LTOModule.h.

const std::string& llvm::LTOModule::getTargetTriple ( ) [inline]

Return the Module's target triple.

Definition at line 106 of file LTOModule.h.

References getModule(), and llvm::Module::getTargetTriple().

bool LTOModule::isBitcodeFile ( const void *  mem,
size_t  length 
) [static]

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

isBitcodeFile - Returns 'true' if the file (or memory contents) is LLVM bitcode.

Definition at line 54 of file LTOModule.cpp.

References llvm::sys::fs::file_magic::bitcode, and llvm::sys::fs::identify_magic().

bool LTOModule::isBitcodeFile ( const char *  path) [static]
bool LTOModule::isBitcodeForTarget ( MemoryBuffer memBuffer,
StringRef  triplePrefix 
) [static]

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

Definition at line 66 of file LTOModule.cpp.

References llvm::getBitcodeTargetTriple(), llvm::getGlobalContext(), llvm::MemoryBuffer::getMemBufferRef(), and llvm::StringRef::startswith().

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

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

Definition at line 169 of file LTOModule.cpp.

References llvm::MemoryBuffer::getMemBuffer().

void llvm::LTOModule::setTargetTriple ( StringRef  Triple) [inline]

Set the Module's target triple.

Definition at line 111 of file LTOModule.h.

References getModule(), and llvm::Module::setTargetTriple().


The documentation for this struct was generated from the following files: