LLVM  4.0.0
Public Member Functions | Static Public Member Functions | List of all members
llvm::object::ModuleSummaryIndexObjectFile Class Reference

This class is used to read just the module summary index related sections out of the given object (which may contain a single module's bitcode or be a combined index bitcode file). More...

#include <ModuleSummaryIndexObjectFile.h>

Inheritance diagram for llvm::object::ModuleSummaryIndexObjectFile:
[legend]
Collaboration diagram for llvm::object::ModuleSummaryIndexObjectFile:
[legend]

Public Member Functions

 ModuleSummaryIndexObjectFile (MemoryBufferRef Object, std::unique_ptr< ModuleSummaryIndex > I)
 
 ~ModuleSummaryIndexObjectFile () override
 
void moveSymbolNext (DataRefImpl &Symb) const override
 
std::error_code printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
 
uint32_t getSymbolFlags (DataRefImpl Symb) const override
 
basic_symbol_iterator symbol_begin () const override
 
basic_symbol_iterator symbol_end () const override
 
const ModuleSummaryIndexgetIndex () const
 
ModuleSummaryIndexgetIndex ()
 
std::unique_ptr
< ModuleSummaryIndex
takeIndex ()
 
- Public Member Functions inherited from llvm::object::SymbolicFile
 ~SymbolicFile () override
 
 SymbolicFile (unsigned int Type, MemoryBufferRef Source)
 
basic_symbol_iterator_range symbols () const
 
- Public Member Functions inherited from llvm::object::Binary
virtual ~Binary ()
 
StringRef getData () const
 
StringRef getFileName () const
 
MemoryBufferRef getMemoryBufferRef () const
 
unsigned int getType () const
 
bool isObject () const
 
bool isSymbolic () const
 
bool isArchive () const
 
bool isMachOUniversalBinary () const
 
bool isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isWasm () const
 
bool isCOFFImportFile () const
 
bool isIR () const
 
bool isModuleSummaryIndex () const
 
bool isLittleEndian () const
 

Static Public Member Functions

static bool classof (const Binary *v)
 
static ErrorOr< MemoryBufferReffindBitcodeInObject (const ObjectFile &Obj)
 Finds and returns bitcode embedded in the given object file, or an error code if not found. More...
 
static ErrorOr< MemoryBufferReffindBitcodeInMemBuffer (MemoryBufferRef Object)
 Finds and returns bitcode in the given memory buffer (which may be either a bitcode file or a native object file with embedded bitcode), or an error code if not found. More...
 
static Expected
< std::unique_ptr
< ModuleSummaryIndexObjectFile > > 
create (MemoryBufferRef Object)
 Parse module summary index in the given memory buffer. More...
 
- Static Public Member Functions inherited from llvm::object::SymbolicFile
static Expected
< std::unique_ptr
< SymbolicFile > > 
createSymbolicFile (MemoryBufferRef Object, sys::fs::file_magic Type, LLVMContext *Context)
 
static Expected
< std::unique_ptr
< SymbolicFile > > 
createSymbolicFile (MemoryBufferRef Object)
 
static Expected< OwningBinary
< SymbolicFile > > 
createSymbolicFile (StringRef ObjectPath)
 
static bool classof (const Binary *v)
 

Additional Inherited Members

- Public Types inherited from llvm::object::SymbolicFile
typedef iterator_range
< basic_symbol_iterator
basic_symbol_iterator_range
 
- Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive, ID_MachOUniversalBinary, ID_COFFImportFile, ID_IR,
  ID_ModuleSummaryIndex, ID_StartObjects, ID_COFF, ID_ELF32L,
  ID_ELF32B, ID_ELF64L, ID_ELF64B, ID_MachO32L,
  ID_MachO32B, ID_MachO64L, ID_MachO64B, ID_Wasm,
  ID_EndObjects
}
 
- Protected Member Functions inherited from llvm::object::Binary
 Binary (unsigned int Type, MemoryBufferRef Source)
 
- Static Protected Member Functions inherited from llvm::object::Binary
static unsigned int getELFType (bool isLE, bool is64Bits)
 
static unsigned int getMachOType (bool isLE, bool is64Bits)
 
- Protected Attributes inherited from llvm::object::Binary
MemoryBufferRef Data
 

Detailed Description

This class is used to read just the module summary index related sections out of the given object (which may contain a single module's bitcode or be a combined index bitcode file).

It builds a ModuleSummaryIndex object.

Definition at line 31 of file ModuleSummaryIndexObjectFile.h.

Constructor & Destructor Documentation

ModuleSummaryIndexObjectFile::ModuleSummaryIndexObjectFile ( MemoryBufferRef  Object,
std::unique_ptr< ModuleSummaryIndex I 
)

Definition at line 31 of file ModuleSummaryIndexObjectFile.cpp.

ModuleSummaryIndexObjectFile::~ModuleSummaryIndexObjectFile ( )
override

Definition at line 36 of file ModuleSummaryIndexObjectFile.cpp.

Member Function Documentation

static bool llvm::object::ModuleSummaryIndexObjectFile::classof ( const Binary v)
inlinestatic
Expected< std::unique_ptr< ModuleSummaryIndexObjectFile > > ModuleSummaryIndexObjectFile::create ( MemoryBufferRef  Object)
static

Parse module summary index in the given memory buffer.

Return new ModuleSummaryIndexObjectFile instance containing parsed module summary/index.

Definition at line 80 of file ModuleSummaryIndexObjectFile.cpp.

References llvm::errorCodeToError(), findBitcodeInMemBuffer(), llvm::ErrorOr< T >::get(), llvm::ErrorOr< T >::getError(), and llvm::getModuleSummaryIndex().

Referenced by llvm::getModuleSummaryIndexForFile(), and llvm::ThinLTOCodeGenerator::linkCombinedIndex().

ErrorOr< MemoryBufferRef > ModuleSummaryIndexObjectFile::findBitcodeInMemBuffer ( MemoryBufferRef  Object)
static
ErrorOr< MemoryBufferRef > ModuleSummaryIndexObjectFile::findBitcodeInObject ( const ObjectFile Obj)
static

Finds and returns bitcode embedded in the given object file, or an error code if not found.

Definition at line 43 of file ModuleSummaryIndexObjectFile.cpp.

References llvm::object::bitcode_section_not_found, llvm::object::Binary::getFileName(), and llvm::object::ObjectFile::sections().

Referenced by findBitcodeInMemBuffer().

const ModuleSummaryIndex& llvm::object::ModuleSummaryIndexObjectFile::getIndex ( ) const
inline

Definition at line 62 of file ModuleSummaryIndexObjectFile.h.

ModuleSummaryIndex& llvm::object::ModuleSummaryIndexObjectFile::getIndex ( )
inline

Definition at line 65 of file ModuleSummaryIndexObjectFile.h.

uint32_t llvm::object::ModuleSummaryIndexObjectFile::getSymbolFlags ( DataRefImpl  Symb) const
inlineoverridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 49 of file ModuleSummaryIndexObjectFile.h.

References llvm_unreachable.

void llvm::object::ModuleSummaryIndexObjectFile::moveSymbolNext ( DataRefImpl Symb) const
inlineoverridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 41 of file ModuleSummaryIndexObjectFile.h.

References llvm_unreachable.

std::error_code llvm::object::ModuleSummaryIndexObjectFile::printSymbolName ( raw_ostream OS,
DataRefImpl  Symb 
) const
inlineoverridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 44 of file ModuleSummaryIndexObjectFile.h.

References llvm_unreachable.

basic_symbol_iterator llvm::object::ModuleSummaryIndexObjectFile::symbol_begin ( ) const
inlineoverridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 53 of file ModuleSummaryIndexObjectFile.h.

References llvm_unreachable.

basic_symbol_iterator llvm::object::ModuleSummaryIndexObjectFile::symbol_end ( ) const
inlineoverridevirtual

Implements llvm::object::SymbolicFile.

Definition at line 57 of file ModuleSummaryIndexObjectFile.h.

References llvm_unreachable.

std::unique_ptr< ModuleSummaryIndex > ModuleSummaryIndexObjectFile::takeIndex ( )

Definition at line 38 of file ModuleSummaryIndexObjectFile.cpp.

Referenced by llvm::getModuleSummaryIndexForFile().


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