diff options
author | Jake Ehrlich <jakehehrlich@google.com> | 2017-09-20 18:23:01 +0000 |
---|---|---|
committer | Jake Ehrlich <jakehehrlich@google.com> | 2017-09-20 18:23:01 +0000 |
commit | 1b30d63aeb3a7dec4084cc6d0a2de91a4be7f805 (patch) | |
tree | 0789a9b0c32f0559a3d6a58192be47517757d809 | |
parent | 4e040287919c339506d6f795e42b41325fd22171 (diff) | |
download | bcm5719-llvm-1b30d63aeb3a7dec4084cc6d0a2de91a4be7f805.tar.gz bcm5719-llvm-1b30d63aeb3a7dec4084cc6d0a2de91a4be7f805.zip |
Rename K_MIPS64 to K_GNU64
This patch renames K_MIPS64 to K_GNU64 as part of a change to add
support for writing archives with 64-bit indexes in the symbol table.
llvm-svn: 313787
-rw-r--r-- | llvm/include/llvm/Object/Archive.h | 2 | ||||
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/Object/ArchiveWriter.cpp | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/llvm/include/llvm/Object/Archive.h b/llvm/include/llvm/Object/Archive.h index e56e8e464de..5a1512bb9d3 100644 --- a/llvm/include/llvm/Object/Archive.h +++ b/llvm/include/llvm/Object/Archive.h @@ -229,7 +229,7 @@ public: enum Kind { K_GNU, - K_MIPS64, + K_GNU64, K_BSD, K_DARWIN, K_DARWIN64, diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 977cccc11dc..20aaa1f2a3e 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -179,7 +179,7 @@ Expected<StringRef> ArchiveMemberHeader::getName(uint64_t Size) const { // GNU long file names end with a "/\n". if (Parent->kind() == Archive::K_GNU || - Parent->kind() == Archive::K_MIPS64) { + Parent->kind() == Archive::K_GNU64) { StringRef::size_type End = StringRef(addr).find('\n'); return StringRef(addr, End - 1); } @@ -338,7 +338,7 @@ Archive::Child::Child(const Archive *Parent, const char *Start, Error *Err) ErrorAsOutParameter ErrAsOutParam(Err); - // If there was an error in the construction of the Header + // If there was an error in the construction of the Header // then just return with the error now set. if (*Err) return; @@ -698,7 +698,7 @@ Archive::Archive(MemoryBufferRef Source, Error &Err) } if (Name == "//") { - Format = has64SymTable ? K_MIPS64 : K_GNU; + Format = has64SymTable ? K_GNU64 : K_GNU; // The string table is never an external member, but we still // must check any Expected<> return value. Expected<StringRef> BufOrErr = C->getBuffer(); @@ -715,7 +715,7 @@ Archive::Archive(MemoryBufferRef Source, Error &Err) } if (Name[0] != '/') { - Format = has64SymTable ? K_MIPS64 : K_GNU; + Format = has64SymTable ? K_GNU64 : K_GNU; setFirstRegular(*C); Err = Error::success(); return; @@ -797,14 +797,14 @@ StringRef Archive::Symbol::getName() const { Expected<Archive::Child> Archive::Symbol::getMember() const { const char *Buf = Parent->getSymbolTable().begin(); const char *Offsets = Buf; - if (Parent->kind() == K_MIPS64 || Parent->kind() == K_DARWIN64) + if (Parent->kind() == K_GNU64 || Parent->kind() == K_DARWIN64) Offsets += sizeof(uint64_t); else Offsets += sizeof(uint32_t); uint32_t Offset = 0; if (Parent->kind() == K_GNU) { Offset = read32be(Offsets + SymbolIndex * 4); - } else if (Parent->kind() == K_MIPS64) { + } else if (Parent->kind() == K_GNU64) { Offset = read64be(Offsets + SymbolIndex * 8); } else if (Parent->kind() == K_BSD) { // The SymbolIndex is an index into the ranlib structs that start at @@ -902,7 +902,7 @@ Archive::symbol_iterator Archive::symbol_begin() const { uint32_t symbol_count = 0; symbol_count = read32be(buf); buf += sizeof(uint32_t) + (symbol_count * (sizeof(uint32_t))); - } else if (kind() == K_MIPS64) { + } else if (kind() == K_GNU64) { uint64_t symbol_count = read64be(buf); buf += sizeof(uint64_t) + (symbol_count * (sizeof(uint64_t))); } else if (kind() == K_BSD) { @@ -959,7 +959,7 @@ uint32_t Archive::getNumberOfSymbols() const { const char *buf = getSymbolTable().begin(); if (kind() == K_GNU) return read32be(buf); - if (kind() == K_MIPS64) + if (kind() == K_GNU64) return read64be(buf); if (kind() == K_BSD) return read32le(buf) / 8; diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp index 91aa3739229..a6b712c1627 100644 --- a/llvm/lib/Object/ArchiveWriter.cpp +++ b/llvm/lib/Object/ArchiveWriter.cpp @@ -133,7 +133,7 @@ static bool isBSDLike(object::Archive::Kind Kind) { case object::Archive::K_BSD: case object::Archive::K_DARWIN: return true; - case object::Archive::K_MIPS64: + case object::Archive::K_GNU64: case object::Archive::K_DARWIN64: case object::Archive::K_COFF: break; |