LLVM 20.0.0git
|
#include "llvm/Object/Archive.h"
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 > |
Static Public Member Functions | |
static Expected< std::unique_ptr< Archive > > | create (MemoryBufferRef Source) |
static object::Archive::Kind | getDefaultKind () |
static object::Archive::Kind | getDefaultKindForTriple (Triple &T) |
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. | |
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) | |
Protected Attributes | |
StringRef | SymbolTable |
StringRef | ECSymbolTable |
StringRef | StringTable |
Protected Attributes inherited from llvm::object::Binary | |
MemoryBufferRef | Data |
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_Offload , 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_GOFF , 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) |
Archive::Archive | ( | MemoryBufferRef | Source, |
Error & | Err | ||
) |
Definition at line 709 of file Archive.cpp.
References llvm::object::ArchiveMagic, llvm::object::BigArchiveMagic, llvm::CallingConv::C, child_begin(), child_end(), llvm::object::Binary::Data, ECSymbolTable, llvm::errorCodeToError(), llvm::Expected< T >::get(), llvm::MemoryBufferRef::getBuffer(), I, llvm::object::invalid_file_type, K_AIXBIG, K_BSD, K_COFF, K_DARWIN64, K_GNU, K_GNU64, Name, llvm::object::parse_failed, setFirstRegular(), llvm::StringRef::starts_with(), StringTable, llvm::Error::success(), SymbolTable, llvm::Expected< T >::takeError(), and llvm::object::ThinArchiveMagic.
Archive::child_iterator Archive::child_begin | ( | Error & | Err, |
bool | SkipInternal = true |
||
) | const |
Definition at line 987 of file Archive.cpp.
References llvm::CallingConv::C, child_end(), llvm::object::Binary::Data, llvm::MemoryBufferRef::getBufferStart(), getFirstChildOffset(), isEmpty(), and llvm::fallible_iterator< Underlying >::itr().
Referenced by Archive(), llvm::object::BigArchive::BigArchive(), and children().
Archive::child_iterator Archive::child_end | ( | ) | const |
Definition at line 1003 of file Archive.cpp.
References llvm::fallible_iterator< Underlying >::end().
Referenced by Archive(), llvm::object::BigArchive::BigArchive(), child_begin(), and children().
|
inline |
Definition at line 346 of file Archive.h.
References child_begin(), child_end(), and llvm::make_range().
Referenced by appendFile(), llvm::objcopy::createNewArchiveMembers(), and doList().
|
static |
Definition at line 669 of file Archive.cpp.
References llvm::object::BigArchiveMagic, llvm::StringRef::starts_with(), and llvm::Error::success().
Referenced by llvm::orc::COFFPlatform::Create(), llvm::orc::StaticLibraryDefinitionGenerator::Create(), llvm::object::createBinary(), llvm::object::extractOffloadBinaries(), and llvm::object::MachOUniversalBinary::ObjectForArch::getAsArchive().
std::unique_ptr< AbstractArchiveMemberHeader > Archive::createArchiveMemberHeader | ( | const char * | RawHeaderPtr, |
uint64_t | Size, | ||
Error * | Err | ||
) | const |
Definition at line 685 of file Archive.cpp.
References K_AIXBIG, kind(), and Size.
Referenced by llvm::object::Archive::Child::Child().
Expected< iterator_range< Archive::symbol_iterator > > Archive::ec_symbols | ( | ) | const |
Definition at line 1195 of file Archive.cpp.
References llvm::StringRef::begin(), ECSymbolTable, llvm::StringRef::empty(), llvm::StringRef::find(), getNumberOfSymbols(), llvm::make_range(), malformedError(), llvm::StringRef::npos, llvm::support::endian::read16le(), llvm::support::endian::read32le(), llvm::StringRef::size(), and SymbolTable.
Expected< std::optional< Archive::Child > > Archive::findSym | ( | StringRef | name | ) | const |
Definition at line 1264 of file Archive.cpp.
References llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::Symbol::getName(), name, symbol_begin(), and symbol_end().
|
protected |
Definition at line 694 of file Archive.cpp.
References llvm::object::ArchiveMagic, llvm::object::BigArchiveMagic, isThin(), K_AIXBIG, and llvm::object::ThinArchiveMagic.
Referenced by getFirstChildOffset(), and isEmpty().
|
static |
Definition at line 982 of file Archive.cpp.
References getDefaultKindForTriple(), and llvm::sys::getDefaultTargetTriple().
Referenced by llvm::NewArchiveMember::detectKindFromObject().
|
static |
Definition at line 972 of file Archive.cpp.
References K_AIXBIG, K_COFF, K_DARWIN, and K_GNU.
Referenced by llvm::NewArchiveMember::detectKindFromObject(), and getDefaultKind().
|
inlinevirtual |
Reimplemented in llvm::object::BigArchive.
Definition at line 370 of file Archive.h.
References getArchiveMagicLen().
Referenced by child_begin().
uint32_t Archive::getNumberOfECSymbols | ( | ) | const |
Definition at line 1258 of file Archive.cpp.
References llvm::StringRef::begin(), ECSymbolTable, llvm::support::endian::read32le(), and llvm::StringRef::size().
Referenced by llvm::object::Archive::Symbol::isECSymbol().
uint32_t Archive::getNumberOfSymbols | ( | ) | const |
Definition at line 1240 of file Archive.cpp.
References llvm::StringRef::begin(), getSymbolTable(), hasSymbolTable(), K_AIXBIG, K_BSD, K_DARWIN64, K_GNU, K_GNU64, kind(), llvm::support::endian::read32be(), llvm::support::endian::read32le(), llvm::support::endian::read64be(), and llvm::support::endian::read64le().
Referenced by ec_symbols(), llvm::object::Archive::Symbol::isECSymbol(), and symbol_end().
|
inline |
Definition at line 367 of file Archive.h.
References StringTable.
Referenced by llvm::object::ArchiveMemberHeader::getName(), and symbol_begin().
|
inline |
Definition at line 366 of file Archive.h.
References SymbolTable.
Referenced by getNumberOfSymbols(), and symbol_begin().
bool Archive::hasSymbolTable | ( | ) | const |
Definition at line 1285 of file Archive.cpp.
References llvm::StringRef::empty(), and SymbolTable.
Referenced by llvm::objcopy::executeObjcopyOnArchive(), getNumberOfSymbols(), and symbol_begin().
|
virtual |
Reimplemented in llvm::object::BigArchive.
Definition at line 1281 of file Archive.cpp.
References llvm::object::Binary::Data, getArchiveMagicLen(), and llvm::MemoryBufferRef::getBufferSize().
Referenced by child_begin().
|
inline |
Definition at line 340 of file Archive.h.
Referenced by llvm::object::Archive::Child::Child(), llvm::objcopy::executeObjcopyOnArchive(), getArchiveMagicLen(), llvm::object::Archive::Child::getBuffer(), llvm::object::Archive::Child::getFullName(), and llvm::object::ArchiveMemberHeader::isThin().
|
inline |
Definition at line 339 of file Archive.h.
Referenced by llvm::object::Archive::Child::Child(), createArchiveMemberHeader(), llvm::objcopy::executeObjcopyOnArchive(), llvm::object::ArchiveMemberHeader::getName(), getNumberOfSymbols(), llvm::object::ArchiveMemberHeader::getRawName(), and symbol_begin().
Definition at line 704 of file Archive.cpp.
References llvm::CallingConv::C.
Referenced by Archive(), and llvm::object::BigArchive::BigArchive().
Archive::symbol_iterator Archive::symbol_begin | ( | ) | const |
Definition at line 1133 of file Archive.cpp.
References llvm::StringRef::begin(), getStringTable(), getSymbolTable(), hasSymbolTable(), K_AIXBIG, K_BSD, K_DARWIN64, K_GNU, K_GNU64, kind(), llvm::support::endian::read32be(), llvm::support::endian::read32le(), llvm::support::endian::read64be(), and llvm::support::endian::read64le().
Archive::symbol_iterator Archive::symbol_end | ( | ) | const |
Definition at line 1191 of file Archive.cpp.
References getNumberOfSymbols().
|
inline |
Definition at line 353 of file Archive.h.
References llvm::make_range(), symbol_begin(), and symbol_end().
|
inline |
|
protected |
Definition at line 385 of file Archive.h.
Referenced by Archive(), ec_symbols(), and getNumberOfECSymbols().
Size field is 10 decimal digits long.
Definition at line 335 of file Archive.h.
Referenced by computeMemberData().
|
protected |
Definition at line 386 of file Archive.h.
Referenced by appendGlobalSymbolTableInfo(), Archive(), llvm::object::BigArchive::BigArchive(), and getStringTable().
|
protected |
Definition at line 384 of file Archive.h.
Referenced by appendGlobalSymbolTableInfo(), Archive(), llvm::object::BigArchive::BigArchive(), ec_symbols(), getSymbolTable(), and hasSymbolTable().