diff options
Diffstat (limited to 'include/llvm/Object/Archive.h')
-rw-r--r-- | include/llvm/Object/Archive.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h index 4e96205a93ba..8da6919a4655 100644 --- a/include/llvm/Object/Archive.h +++ b/include/llvm/Object/Archive.h @@ -41,6 +41,9 @@ struct ArchiveMemberHeader { sys::fs::perms getAccessMode() const; sys::TimeValue getLastModified() const; + llvm::StringRef getRawLastModified() const { + return StringRef(LastModified, sizeof(LastModified)).rtrim(" "); + } unsigned getUID() const; unsigned getGID() const; }; @@ -78,6 +81,9 @@ public: sys::TimeValue getLastModified() const { return getHeader()->getLastModified(); } + StringRef getRawLastModified() const { + return getHeader()->getRawLastModified(); + } unsigned getUID() const { return getHeader()->getUID(); } unsigned getGID() const { return getHeader()->getGID(); } sys::fs::perms getAccessMode() const { @@ -85,10 +91,13 @@ public: } /// \return the size of the archive member without the header or padding. uint64_t getSize() const; + /// \return the size in the archive header for this member. + uint64_t getRawSize() const; StringRef getBuffer() const { return StringRef(Data.data() + StartOfFile, getSize()); } + uint64_t getChildOffset() const; ErrorOr<MemoryBufferRef> getMemoryBufferRef() const; @@ -146,9 +155,8 @@ public: Symbol symbol; public: symbol_iterator(const Symbol &s) : symbol(s) {} - const Symbol *operator->() const { - return &symbol; - } + const Symbol *operator->() const { return &symbol; } + const Symbol &operator*() const { return symbol; } bool operator==(const symbol_iterator &other) const { return symbol == other.symbol; @@ -169,6 +177,7 @@ public: enum Kind { K_GNU, + K_MIPS64, K_BSD, K_COFF }; @@ -184,6 +193,9 @@ public: symbol_iterator symbol_begin() const; symbol_iterator symbol_end() const; + iterator_range<symbol_iterator> symbols() const { + return iterator_range<symbol_iterator>(symbol_begin(), symbol_end()); + } // Cast methods. static inline bool classof(Binary const *v) { @@ -194,6 +206,8 @@ public: child_iterator findSym(StringRef name) const; bool hasSymbolTable() const; + child_iterator getSymbolTableChild() const { return SymbolTable; } + uint32_t getNumberOfSymbols() const; private: child_iterator SymbolTable; |