diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-14 01:06:16 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-14 01:06:16 +0000 |
commit | 2b05416be8cc116c2910684cb6097039cd1e2cc5 (patch) | |
tree | d2d10e9b5751649b0315e80ab4f526f735f53d28 /llvm/lib/Object | |
parent | 5fe5b90b18bb0916431157a9ae6c42534f091730 (diff) | |
download | bcm5719-llvm-2b05416be8cc116c2910684cb6097039cd1e2cc5.tar.gz bcm5719-llvm-2b05416be8cc116c2910684cb6097039cd1e2cc5.zip |
Add a herper function. NFC.
llvm-svn: 242100
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index efcc2d66362..c29e63941f2 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -353,11 +353,11 @@ Archive::child_iterator Archive::child_end() const { } StringRef Archive::Symbol::getName() const { - return Parent->SymbolTable->getBuffer().begin() + StringIndex; + return Parent->getSymbolTable().begin() + StringIndex; } ErrorOr<Archive::child_iterator> Archive::Symbol::getMember() const { - const char *Buf = Parent->SymbolTable->getBuffer().begin(); + const char *Buf = Parent->getSymbolTable().begin(); const char *Offsets = Buf; if (Parent->kind() == K_MIPS64) Offsets += sizeof(uint64_t); @@ -421,7 +421,7 @@ Archive::Symbol Archive::Symbol::getNext() const { // and the second being the offset into the archive of the member that // define the symbol. After that the next uint32_t is the byte count of // the string table followed by the string table. - const char *Buf = Parent->SymbolTable->getBuffer().begin(); + const char *Buf = Parent->getSymbolTable().begin(); uint32_t RanlibCount = 0; RanlibCount = read32le(Buf) / 8; // If t.SymbolIndex + 1 will be past the count of symbols (the RanlibCount) @@ -438,8 +438,7 @@ Archive::Symbol Archive::Symbol::getNext() const { } } else { // Go to one past next null. - t.StringIndex = - Parent->SymbolTable->getBuffer().find('\0', t.StringIndex) + 1; + t.StringIndex = Parent->getSymbolTable().find('\0', t.StringIndex) + 1; } ++t.SymbolIndex; return t; @@ -449,7 +448,7 @@ Archive::symbol_iterator Archive::symbol_begin() const { if (!hasSymbolTable()) return symbol_iterator(Symbol(this, 0, 0)); - const char *buf = SymbolTable->getBuffer().begin(); + const char *buf = getSymbolTable().begin(); if (kind() == K_GNU) { uint32_t symbol_count = 0; symbol_count = read32be(buf); @@ -481,7 +480,7 @@ Archive::symbol_iterator Archive::symbol_begin() const { symbol_count = read32le(buf); buf += 4 + (symbol_count * 2); // Skip indices. } - uint32_t string_start_offset = buf - SymbolTable->getBuffer().begin(); + uint32_t string_start_offset = buf - getSymbolTable().begin(); return symbol_iterator(Symbol(this, 0, string_start_offset)); } @@ -492,7 +491,7 @@ Archive::symbol_iterator Archive::symbol_end() const { } uint32_t Archive::getNumberOfSymbols() const { - const char *buf = SymbolTable->getBuffer().begin(); + const char *buf = getSymbolTable().begin(); if (kind() == K_GNU) return read32be(buf); if (kind() == K_MIPS64) |