diff options
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 2 | ||||
| -rw-r--r-- | lld/ELF/InputFiles.h | 20 | ||||
| -rw-r--r-- | lld/ELF/SymbolTable.cpp | 2 |
3 files changed, 10 insertions, 14 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 26caa4c2f5a..368e111bfd7 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -157,7 +157,7 @@ void ELFFileBase<ELFT>::initSymtab(ArrayRef<Elf_Shdr> Sections, template <class ELFT> ObjFile<ELFT>::ObjFile(MemoryBufferRef M, StringRef ArchiveName) - : ELFFileBase<ELFT>(Base::ObjectKind, M) { + : ELFFileBase<ELFT>(Base::ObjKind, M) { this->ArchiveName = ArchiveName; } diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 75cc0587dc9..a6720e609a8 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -63,9 +63,9 @@ llvm::Optional<MemoryBufferRef> readFile(StringRef Path); class InputFile { public: enum Kind { - ObjectKind, + ObjKind, SharedKind, - LazyObjectKind, + LazyObjKind, ArchiveKind, BitcodeKind, BinaryKind, @@ -79,14 +79,14 @@ public: // Returns sections. It is a runtime error to call this function // on files that don't have the notion of sections. ArrayRef<InputSectionBase *> getSections() const { - assert(FileKind == ObjectKind || FileKind == BinaryKind); + assert(FileKind == ObjKind || FileKind == BinaryKind); return Sections; } // Returns object file symbols. It is a runtime error to call this // function on files of other types. ArrayRef<SymbolBody *> getSymbols() { - assert(FileKind == ObjectKind || FileKind == BitcodeKind || + assert(FileKind == ObjKind || FileKind == BitcodeKind || FileKind == ArchiveKind); return Symbols; } @@ -124,7 +124,7 @@ public: ELFFileBase(Kind K, MemoryBufferRef M); static bool classof(const InputFile *F) { Kind K = F->kind(); - return K == ObjectKind || K == SharedKind; + return K == ObjKind || K == SharedKind; } llvm::object::ELFFile<ELFT> getObj() const { @@ -160,9 +160,7 @@ template <class ELFT> class ObjFile : public ELFFileBase<ELFT> { ArrayRef<Elf_Word> getShtGroupEntries(const Elf_Shdr &Sec); public: - static bool classof(const InputFile *F) { - return F->kind() == Base::ObjectKind; - } + static bool classof(const InputFile *F) { return F->kind() == Base::ObjKind; } static std::vector<ObjFile<ELFT> *> Instances; @@ -236,13 +234,11 @@ class LazyObjFile : public InputFile { public: LazyObjFile(MemoryBufferRef M, StringRef ArchiveName, uint64_t OffsetInArchive) - : InputFile(LazyObjectKind, M), OffsetInArchive(OffsetInArchive) { + : InputFile(LazyObjKind, M), OffsetInArchive(OffsetInArchive) { this->ArchiveName = ArchiveName; } - static bool classof(const InputFile *F) { - return F->kind() == LazyObjectKind; - } + static bool classof(const InputFile *F) { return F->kind() == LazyObjKind; } template <class ELFT> void parse(); MemoryBufferRef getBuffer(); diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index c2a5f96d6de..ec8ae5d75bb 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -250,7 +250,7 @@ std::pair<Symbol *, bool> SymbolTable::insert(StringRef Name, uint8_t Type, uint8_t Visibility, bool CanOmitFromDynSym, InputFile *File) { - bool IsUsedInRegularObj = !File || File->kind() == InputFile::ObjectKind; + bool IsUsedInRegularObj = !File || File->kind() == InputFile::ObjKind; Symbol *S; bool WasInserted; std::tie(S, WasInserted) = insert(Name); |

