14 #ifndef LLVM_OBJECT_ARCHIVE_H
15 #define LLVM_OBJECT_ARCHIVE_H
36 uint64_t Size,
Error *Err);
52 sizeof(ArMemHdr->LastModified)).
rtrim(
' ');
59 return sizeof(ArMemHdrType);
65 char LastModified[12];
73 ArMemHdrType
const *ArMemHdr;
77 virtual void anchor();
96 assert(!Parent || !other.Parent || Parent == other.Parent);
149 return !(*
this == other);
155 assert(E &&
"Can't increment iterator with no Error attached");
157 if (
auto ChildOrErr = C.
getNext())
161 *E = ChildOrErr.takeError();
175 return (Parent == other.Parent) && (SymbolIndex == other.SymbolIndex);
181 , StringIndex(stri) {}
195 return symbol == other.symbol;
199 return !(*
this == other);
225 bool SkipInternal =
true)
const {
250 return std::move(ThinBuffers);
258 uint16_t FirstRegularStartOfFile = -1;
259 void setFirstRegular(
const Child &
C);
263 mutable std::vector<std::unique_ptr<MemoryBuffer>> ThinBuffers;
child_iterator(const Child &C, Error *E)
symbol_iterator symbol_end() const
Expected< Optional< Child > > findSym(StringRef name) const
Expected< uint64_t > getRawSize() const
bool operator==(const symbol_iterator &other) const
Expected< unsigned > getGID() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
Archive(MemoryBufferRef Source, Error &Err)
uint64_t getChildOffset() const
StringRef getStringTable() const
child_iterator child_begin(Error &Err, bool SkipInternal=true) const
const Symbol * operator->() const
StringRef getSymbolTable() const
std::vector< std::unique_ptr< MemoryBuffer > > takeThinBuffers()
Expected< uint64_t > getSize() const
Child(const Archive *Parent, const char *Start, Error *Err)
Expected< StringRef > getName() const
bool operator==(const child_iterator &other) const
const Symbol & operator*() const
iterator_range< symbol_iterator > symbols() const
child_iterator & operator++()
LLVM_NODISCARD StringRef rtrim(char Char) const
Return string with consecutive Char characters starting from the right removed.
Tagged union holding either a T or a Error.
bool operator!=(const symbol_iterator &other) const
Symbol(const Archive *p, uint32_t symi, uint32_t stri)
Expected< sys::fs::perms > getAccessMode() const
static Expected< std::unique_ptr< Archive > > create(MemoryBufferRef Source)
bool hasSymbolTable() const
Expected< Child > getNext() const
Expected< unsigned > getUID() const
bool operator==(const Child &other) const
child_iterator child_end() const
This is an important class for using LLVM in a threaded context.
StringRef getName() const
bool operator==(const Symbol &other) const
const Child * operator->() const
Expected< std::string > getFullName() const
const Child & operator*() const
const Archive * getParent() const
Expected< std::unique_ptr< Binary > > getAsBinary(LLVMContext *Context=nullptr) const
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
symbol_iterator symbol_begin() const
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
A range adaptor for a pair of iterators.
Expected< sys::TimePoint< std::chrono::seconds > > getLastModified() const
Helper for Errors used as out-parameters.
Expected< StringRef > getRawName() const
Expected< Child > getMember() const
StringRef getRawLastModified() const
uint32_t getNumberOfSymbols() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
static bool classof(Binary const *v)
Expected< StringRef > getBuffer() const
StringRef - Represent a constant reference to a string, i.e.
symbol_iterator(const Symbol &s)
Expected< MemoryBufferRef > getMemoryBufferRef() const
bool operator!=(const child_iterator &other) const
symbol_iterator & operator++()
iterator_range< child_iterator > children(Error &Err, bool SkipInternal=true) const