LLVM  3.7.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::LTOModule Struct Reference

C++ class which implements the opaque lto_module_t type. More...

#include <LTOModule.h>

Public Member Functions

 ~LTOModule ()
 
const ModulegetModule () const
 
ModulegetModule ()
 
const std::string & getTargetTriple ()
 Return the Module's target triple. More...
 
void setTargetTriple (StringRef Triple)
 Set the Module's target triple. More...
 
uint32_t getSymbolCount ()
 Get the number of symbols. More...
 
lto_symbol_attributes getSymbolAttributes (uint32_t index)
 Get the attributes for a symbol at the specified index. More...
 
const char * getSymbolName (uint32_t index)
 Get the name of the symbol at the specified index. More...
 
const GlobalValuegetSymbolGV (uint32_t index)
 
const char * getLinkerOpts ()
 
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. More...
 
static bool isBitcodeFile (const char *path)
 
static bool isBitcodeForTarget (MemoryBuffer *memBuffer, StringRef triplePrefix)
 Returns 'true' if the memory buffer is LLVM bitcode for the specified triple. More...
 
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. More...
 
static LTOModulecreateFromFile (const char *path, TargetOptions options, std::string &errMsg)
 Create an LTOModule. More...
 
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="")
 
static LTOModulecreateInLocalContext (const void *mem, size_t length, TargetOptions options, std::string &errMsg, StringRef path)
 
static LTOModulecreateInContext (const void *mem, size_t length, TargetOptions options, std::string &errMsg, StringRef path, LLVMContext *Context)
 

Detailed Description

C++ class which implements the opaque lto_module_t type.

Definition at line 39 of file LTOModule.h.

Constructor & Destructor Documentation

LTOModule::~LTOModule ( )

Definition at line 62 of file LTOModule.cpp.

Member Function Documentation

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

Definition at line 128 of file LTOModule.cpp.

References createInContext(), and llvm::getGlobalContext().

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 94 of file LTOModule.cpp.

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

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

Definition at line 107 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
LTOModule * LTOModule::createInContext ( const void *  mem,
size_t  length,
TargetOptions  options,
std::string &  errMsg,
StringRef  path,
LLVMContext Context 
)
static

Definition at line 142 of file LTOModule.cpp.

References llvm::Data.

Referenced by createFromBuffer(), and createInLocalContext().

LTOModule * LTOModule::createInLocalContext ( const void *  mem,
size_t  length,
TargetOptions  options,
std::string &  errMsg,
StringRef  path 
)
static

Definition at line 135 of file LTOModule.cpp.

References createInContext().

const std::vector<const char*>& llvm::LTOModule::getAsmUndefinedRefs ( )
inline
const char* llvm::LTOModule::getLinkerOpts ( )
inline

Definition at line 151 of file LTOModule.h.

const Module& llvm::LTOModule::getModule ( ) const
inline
Module& llvm::LTOModule::getModule ( )
inline

Definition at line 112 of file LTOModule.h.

lto_symbol_attributes llvm::LTOModule::getSymbolAttributes ( uint32_t  index)
inline

Get the attributes for a symbol at the specified index.

Definition at line 132 of file LTOModule.h.

References attributes.

uint32_t llvm::LTOModule::getSymbolCount ( )
inline

Get the number of symbols.

Definition at line 127 of file LTOModule.h.

const GlobalValue* llvm::LTOModule::getSymbolGV ( uint32_t  index)
inline

Definition at line 145 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 139 of file LTOModule.h.

References name.

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

Return the Module's target triple.

Definition at line 117 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 66 of file LTOModule.cpp.

References llvm::object::IRObjectFile::findBitcodeInMemBuffer().

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 83 of file LTOModule.cpp.

References llvm::object::IRObjectFile::findBitcodeInMemBuffer(), llvm::getBitcodeTargetTriple(), 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 258 of file LTOModule.cpp.

References llvm::MemoryBuffer::getMemBuffer().

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

Set the Module's target triple.

Definition at line 122 of file LTOModule.h.

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


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