Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
[oota-llvm.git] / include / llvm / Object / Archive.h
index da6a5419aa06e6503f8b8acc1c44ee27b41d98e3..8da6919a46555cf515e8ab379c87f2bf47fcf9a1 100644 (file)
@@ -14,8 +14,8 @@
 #ifndef LLVM_OBJECT_ARCHIVE_H
 #define LLVM_OBJECT_ARCHIVE_H
 
-#include "llvm/ADT/iterator_range.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator_range.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ErrorOr.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;