This repository was archived by the owner on Apr 23, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ class Archive : public Binary {
239
239
// check if a symbol is in the archive
240
240
Expected<Optional<Child>> findSym (StringRef name) const ;
241
241
242
+ bool isEmpty () const ;
242
243
bool hasSymbolTable () const ;
243
244
StringRef getSymbolTable () const { return SymbolTable; }
244
245
StringRef getStringTable () const { return StringTable; }
Original file line number Diff line number Diff line change @@ -752,7 +752,7 @@ Archive::Archive(MemoryBufferRef Source, Error &Err)
752
752
753
753
Archive::child_iterator Archive::child_begin (Error &Err,
754
754
bool SkipInternal) const {
755
- if (Data. getBufferSize () == 8 ) // empty archive.
755
+ if (isEmpty ())
756
756
return child_end ();
757
757
758
758
if (SkipInternal)
@@ -968,4 +968,7 @@ Expected<Optional<Archive::Child>> Archive::findSym(StringRef name) const {
968
968
return Optional<Child>();
969
969
}
970
970
971
+ // Returns true if archive file contains no member file.
972
+ bool Archive::isEmpty () const { return Data.getBufferSize () == 8 ; }
973
+
971
974
bool Archive::hasSymbolTable () const { return !SymbolTable.empty (); }
You can’t perform that action at this time.
0 commit comments