LLVM  15.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
llvm::object::Archive Class Reference

#include "llvm/Object/Archive.h"

Inheritance diagram for llvm::object::Archive:
Inheritance graph
[legend]
Collaboration diagram for llvm::object::Archive:
Collaboration graph
[legend]

Classes

class  Child
 
class  ChildFallibleIterator
 
class  Symbol
 
class  symbol_iterator
 

Public Types

enum  Kind {
  K_GNU, K_GNU64, K_BSD, K_DARWIN,
  K_DARWIN64, K_COFF, K_AIXBIG
}
 
using child_iterator = fallible_iterator< ChildFallibleIterator >
 

Public Member Functions

 Archive (MemoryBufferRef Source, Error &Err)
 
Kind kind () const
 
bool isThin () const
 
child_iterator child_begin (Error &Err, bool SkipInternal=true) const
 
child_iterator child_end () const
 
iterator_range< child_iteratorchildren (Error &Err, bool SkipInternal=true) const
 
symbol_iterator symbol_begin () const
 
symbol_iterator symbol_end () const
 
iterator_range< symbol_iteratorsymbols () const
 
Expected< Optional< Child > > findSym (StringRef name) const
 
virtual bool isEmpty () const
 
bool hasSymbolTable () const
 
StringRef getSymbolTable () const
 
StringRef getStringTable () const
 
uint32_t getNumberOfSymbols () const
 
virtual uint64_t getFirstChildOffset () const
 
std::vector< std::unique_ptr< MemoryBuffer > > takeThinBuffers ()
 
std::unique_ptr< AbstractArchiveMemberHeadercreateArchiveMemberHeader (const char *RawHeaderPtr, uint64_t Size, Error *Err) const
 
- Public Member Functions inherited from llvm::object::Binary
 Binary ()=delete
 
 Binary (const Binary &other)=delete
 
virtual ~Binary ()
 
virtual Error initContent ()
 
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 isTapiUniversal () const
 
bool isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isXCOFF () const
 
bool isWasm () const
 
bool isCOFFImportFile () const
 
bool isIR () const
 
bool isMinidump () const
 
bool isTapiFile () const
 
bool isLittleEndian () const
 
bool isWinRes () const
 
Triple::ObjectFormatType getTripleObjectFormat () const
 

Static Public Member Functions

static Expected< std::unique_ptr< Archive > > create (MemoryBufferRef Source)
 
static object::Archive::Kind getDefaultKindForHost ()
 
static bool classof (Binary const *v)
 
- Static Public Member Functions inherited from llvm::object::Binary
static Error checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
 

Static Public Attributes

static const uint64_t MaxMemberSize = 9999999999
 Size field is 10 decimal digits long. More...
 

Protected Member Functions

uint64_t getArchiveMagicLen () const
 
void setFirstRegular (const Child &C)
 
- Protected Member Functions inherited from llvm::object::Binary
 Binary (unsigned int Type, MemoryBufferRef Source)
 

Additional Inherited Members

- Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive, ID_MachOUniversalBinary, ID_COFFImportFile, ID_IR,
  ID_TapiUniversal, ID_TapiFile, ID_Minidump, ID_WinRes,
  ID_StartObjects, ID_COFF, ID_XCOFF32, ID_XCOFF64,
  ID_ELF32L, ID_ELF32B, ID_ELF64L, ID_ELF64B,
  ID_MachO32L, ID_MachO32B, ID_MachO64L, ID_MachO64B,
  ID_Wasm, ID_EndObjects
}
 
- 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

Definition at line 159 of file Archive.h.

Member Typedef Documentation

◆ child_iterator

Definition at line 290 of file Archive.h.

Member Enumeration Documentation

◆ Kind

Enumerator
K_GNU 
K_GNU64 
K_BSD 
K_DARWIN 
K_DARWIN64 
K_COFF 
K_AIXBIG 

Definition at line 339 of file Archive.h.

Constructor & Destructor Documentation

◆ Archive()

Archive::Archive ( MemoryBufferRef  Source,
Error Err 
)

Definition at line 694 of file Archive.cpp.

Member Function Documentation

◆ child_begin()

Archive::child_iterator Archive::child_begin ( Error Err,
bool  SkipInternal = true 
) const

Definition at line 937 of file Archive.cpp.

◆ child_end()

Archive::child_iterator Archive::child_end ( ) const

Definition at line 953 of file Archive.cpp.

References llvm::fallible_iterator< Underlying >::end().

◆ children()

iterator_range<child_iterator> llvm::object::Archive::children ( Error Err,
bool  SkipInternal = true 
) const
inline

Definition at line 347 of file Archive.h.

◆ classof()

static bool llvm::object::Archive::classof ( Binary const v)
inlinestatic

Definition at line 358 of file Archive.h.

References llvm::object::Binary::isArchive().

◆ create()

Expected< std::unique_ptr< Archive > > Archive::create ( MemoryBufferRef  Source)
static

◆ createArchiveMemberHeader()

std::unique_ptr< AbstractArchiveMemberHeader > Archive::createArchiveMemberHeader ( const char *  RawHeaderPtr,
uint64_t  Size,
Error Err 
) const

Definition at line 670 of file Archive.cpp.

Referenced by llvm::object::Archive::Child::Child().

◆ findSym()

Expected< Optional< Archive::Child > > Archive::findSym ( StringRef  name) const

◆ getArchiveMagicLen()

uint64_t Archive::getArchiveMagicLen ( ) const
protected

◆ getDefaultKindForHost()

object::Archive::Kind Archive::getDefaultKindForHost ( )
static

◆ getFirstChildOffset()

virtual uint64_t llvm::object::Archive::getFirstChildOffset ( ) const
inlinevirtual

Reimplemented in llvm::object::BigArchive.

Definition at line 368 of file Archive.h.

References getArchiveMagicLen().

◆ getNumberOfSymbols()

uint32_t Archive::getNumberOfSymbols ( ) const

◆ getStringTable()

StringRef llvm::object::Archive::getStringTable ( ) const
inline

Definition at line 366 of file Archive.h.

Referenced by llvm::object::ArchiveMemberHeader::getName().

◆ getSymbolTable()

StringRef llvm::object::Archive::getSymbolTable ( ) const
inline

◆ hasSymbolTable()

bool Archive::hasSymbolTable ( ) const

◆ isEmpty()

bool Archive::isEmpty ( ) const
virtual

◆ isThin()

bool llvm::object::Archive::isThin ( ) const
inline

◆ kind()

Kind llvm::object::Archive::kind ( ) const
inline

◆ setFirstRegular()

void Archive::setFirstRegular ( const Child C)
protected

Definition at line 689 of file Archive.cpp.

◆ symbol_begin()

Archive::symbol_iterator Archive::symbol_begin ( ) const

◆ symbol_end()

Archive::symbol_iterator Archive::symbol_end ( ) const

Definition at line 1116 of file Archive.cpp.

References getNumberOfSymbols(), and llvm::ARMBuildAttrs::Symbol.

Referenced by findSym(), and symbols().

◆ symbols()

iterator_range<symbol_iterator> llvm::object::Archive::symbols ( ) const
inline

Definition at line 354 of file Archive.h.

References llvm::make_range(), symbol_begin(), and symbol_end().

◆ takeThinBuffers()

std::vector<std::unique_ptr<MemoryBuffer> > llvm::object::Archive::takeThinBuffers ( )
inline

Definition at line 370 of file Archive.h.

References move.

Member Data Documentation

◆ MaxMemberSize

const uint64_t llvm::object::Archive::MaxMemberSize = 9999999999
static

Size field is 10 decimal digits long.

Definition at line 337 of file Archive.h.


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