diff options
author | Rui Ueyama <ruiu@google.com> | 2016-09-30 17:54:31 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-09-30 17:54:31 +0000 |
commit | 14a5ca0498552a4ae3e9b99cb339dcffac6a5a12 (patch) | |
tree | 57ca33790f35f93dd5e54bca794bba8e8033ee73 /llvm/lib/Object/Archive.cpp | |
parent | f6f795e9ae08d48f2696b2d4d5c48fe286fccd77 (diff) | |
download | bcm5719-llvm-14a5ca0498552a4ae3e9b99cb339dcffac6a5a12.tar.gz bcm5719-llvm-14a5ca0498552a4ae3e9b99cb339dcffac6a5a12.zip |
[Object] Define Archive::isEmpty().
llvm-svn: 282884
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 2870584cdcf..73761fa73db 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -752,7 +752,7 @@ Archive::Archive(MemoryBufferRef Source, Error &Err) Archive::child_iterator Archive::child_begin(Error &Err, bool SkipInternal) const { - if (Data.getBufferSize() == 8) // empty archive. + if (isEmpty()) return child_end(); if (SkipInternal) @@ -968,4 +968,7 @@ Expected<Optional<Archive::Child>> Archive::findSym(StringRef name) const { return Optional<Child>(); } +// Returns true if archive file contains no member file. +bool Archive::isEmpty() const { return Data.getBufferSize() == 8; } + bool Archive::hasSymbolTable() const { return !SymbolTable.empty(); } |