LLVM
8.0.1
|
C++ class which implements the opaque lto_module_t type. More...
#include "llvm/LTO/legacy/LTOModule.h"
Public Member Functions | |
~LTOModule () | |
bool | isThinLTO () |
Returns 'true' if the Module is produced for ThinLTO. More... | |
const Module & | getModule () const |
Module & | getModule () |
std::unique_ptr< Module > | takeModule () |
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... | |
StringRef | getSymbolName (uint32_t index) |
Get the name of the symbol at the specified index. More... | |
const GlobalValue * | getSymbolGV (uint32_t index) |
StringRef | getLinkerOpts () |
const std::vector< StringRef > & | 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 (StringRef path) |
static bool | isBitcodeForTarget (MemoryBuffer *memBuffer, StringRef triplePrefix) |
Returns 'true' if the memory buffer is LLVM bitcode for the specified triple. More... | |
static std::string | getProducerString (MemoryBuffer *Buffer) |
Returns a string representing the producer identification stored in the bitcode, or "" if the bitcode does not contains any. 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 ErrorOr< std::unique_ptr< LTOModule > > | createFromFile (LLVMContext &Context, StringRef path, const TargetOptions &options) |
Create an LTOModule. More... | |
static ErrorOr< std::unique_ptr< LTOModule > > | createFromOpenFile (LLVMContext &Context, int fd, StringRef path, size_t size, const TargetOptions &options) |
static ErrorOr< std::unique_ptr< LTOModule > > | createFromOpenFileSlice (LLVMContext &Context, int fd, StringRef path, size_t map_size, off_t offset, const TargetOptions &options) |
static ErrorOr< std::unique_ptr< LTOModule > > | createFromBuffer (LLVMContext &Context, const void *mem, size_t length, const TargetOptions &options, StringRef path="") |
static ErrorOr< std::unique_ptr< LTOModule > > | createInLocalContext (std::unique_ptr< LLVMContext > Context, const void *mem, size_t length, const TargetOptions &options, StringRef path) |
C++ class which implements the opaque lto_module_t type.
Definition at line 38 of file LTOModule.h.
LTOModule::~LTOModule | ( | ) |
Definition at line 52 of file LTOModule.cpp.
|
static |
Definition at line 145 of file LTOModule.cpp.
References llvm::Data.
|
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 110 of file LTOModule.cpp.
References llvm::LLVMContext::emitError(), llvm::ErrorOr< T >::get(), llvm::ErrorOr< T >::getError(), and llvm::MemoryBuffer::getFile().
|
static |
Definition at line 124 of file LTOModule.cpp.
|
static |
Definition at line 130 of file LTOModule.cpp.
References llvm::LLVMContext::emitError(), llvm::ErrorOr< T >::get(), llvm::ErrorOr< T >::getError(), and llvm::MemoryBuffer::getOpenFileSlice().
|
static |
Definition at line 154 of file LTOModule.cpp.
References llvm::Data, and llvm::MipsISD::Ret.
Definition at line 157 of file LTOModule.h.
References F(), name, and Name.
Referenced by llvm::LTOCodeGenerator::setAsmUndefinedRefs().
|
inline |
Definition at line 155 of file LTOModule.h.
Definition at line 115 of file LTOModule.h.
Referenced by llvm::LTOCodeGenerator::addModule(), getTargetTriple(), and setTargetTriple().
|
inline |
Definition at line 116 of file LTOModule.h.
|
static |
Returns a string representing the producer identification stored in the bitcode, or "" if the bitcode does not contains any.
Definition at line 96 of file LTOModule.cpp.
References llvm::errorToBool(), llvm::expectedToErrorOrAndEmitErrors(), llvm::getBitcodeProducerString(), llvm::MemoryBuffer::getMemBufferRef(), and llvm::Expected< T >::takeError().
|
inline |
Get the attributes for a symbol at the specified index.
Definition at line 136 of file LTOModule.h.
References attributes.
|
inline |
Get the number of symbols.
Definition at line 131 of file LTOModule.h.
|
inline |
Definition at line 149 of file LTOModule.h.
Get the name of the symbol at the specified index.
Definition at line 143 of file LTOModule.h.
References name.
|
inline |
Return the Module's target triple.
Definition at line 121 of file LTOModule.h.
References getModule(), and llvm::Module::getTargetTriple().
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 56 of file LTOModule.cpp.
References llvm::errorToBool(), and llvm::Expected< T >::takeError().
Definition at line 62 of file LTOModule.cpp.
References llvm::errorToBool(), llvm::ErrorOr< T >::get(), llvm::MemoryBuffer::getFile(), and llvm::Expected< T >::takeError().
|
static |
Returns 'true' if the memory buffer is LLVM bitcode for the specified triple.
Definition at line 82 of file LTOModule.cpp.
References llvm::errorToBool(), llvm::expectedToErrorOrAndEmitErrors(), llvm::getBitcodeTargetTriple(), llvm::MemoryBuffer::getMemBufferRef(), llvm::StringRef::startswith(), and llvm::Expected< T >::takeError().
bool LTOModule::isThinLTO | ( | ) |
Returns 'true' if the Module is produced for ThinLTO.
Definition at line 73 of file LTOModule.cpp.
References llvm::errs(), llvm::getBitcodeLTOInfo(), llvm::logAllUnhandledErrors(), and llvm::Expected< T >::takeError().
|
static |
Create a MemoryBuffer from a memory range with an optional name.
Definition at line 239 of file LTOModule.cpp.
References assert(), llvm::StringMap< ValueTy, AllocatorTy >::begin(), llvm::SmallString< InternalLen >::c_str(), llvm::GlobalValue::canBeOmittedFromSymbolTable(), llvm::countTrailingZeros(), llvm::StringRef::data(), llvm::PointerUnion< PT1, PT2 >::dyn_cast(), llvm::dyn_cast(), llvm::emitLinkerFlagsForGlobalCOFF(), F(), llvm::PointerUnion< PT1, PT2 >::get(), llvm::GlobalValue::getAlignment(), llvm::GlobalVariable::getInitializer(), llvm::MemoryBuffer::getMemBuffer(), llvm::MDNode::getNumOperands(), llvm::User::getOperand(), llvm::MDNode::getOperand(), llvm::MDString::getString(), llvm::GlobalValue::hasComdat(), llvm::GlobalValue::hasCommonLinkage(), llvm::GlobalValue::hasExternalWeakLinkage(), llvm::GlobalValue::hasHiddenVisibility(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalValue::hasProtectedVisibility(), llvm::GlobalValue::hasSection(), llvm::GlobalValue::hasWeakLinkage(), info, llvm::GlobalVariable::isConstant(), LTO_SYMBOL_ALIAS, LTO_SYMBOL_COMDAT, LTO_SYMBOL_DEFINITION_REGULAR, LTO_SYMBOL_DEFINITION_TENTATIVE, LTO_SYMBOL_DEFINITION_UNDEFINED, LTO_SYMBOL_DEFINITION_WEAK, LTO_SYMBOL_DEFINITION_WEAKUNDEF, LTO_SYMBOL_PERMISSIONS_CODE, LTO_SYMBOL_PERMISSIONS_DATA, LTO_SYMBOL_PERMISSIONS_RODATA, LTO_SYMBOL_SCOPE_DEFAULT, LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN, LTO_SYMBOL_SCOPE_HIDDEN, LTO_SYMBOL_SCOPE_INTERNAL, LTO_SYMBOL_SCOPE_MASK, LTO_SYMBOL_SCOPE_PROTECTED, name, Name, op, llvm::ARMBuildAttrs::Section, llvm::object::BasicSymbolRef::SF_FormatSpecific, llvm::object::BasicSymbolRef::SF_Global, llvm::object::BasicSymbolRef::SF_Undefined, llvm::StringRef::size(), and llvm::StringRef::startswith().
|
inline |
Set the Module's target triple.
Definition at line 126 of file LTOModule.h.
References getModule(), and llvm::Module::setTargetTriple().
|
inline |
Definition at line 118 of file LTOModule.h.
Referenced by llvm::LTOCodeGenerator::addModule().