From 17067199724060bffaa8c9effd7bd8f7db87bb8f Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Tue, 15 Mar 2016 09:48:18 +0000 Subject: [PATCH] [COFF] Remove an unused function, getFileOff The function was not used and was not functional: all paths would lead to report_fatal_error or endless stack recursion. llvm-svn: 263542 --- lld/COFF/Symbols.cpp | 26 -------------------------- lld/COFF/Symbols.h | 4 ---- 2 files changed, 30 deletions(-) diff --git a/lld/COFF/Symbols.cpp b/lld/COFF/Symbols.cpp index d732d76..3d125c9 100644 --- a/lld/COFF/Symbols.cpp +++ b/lld/COFF/Symbols.cpp @@ -162,32 +162,6 @@ std::string SymbolBody::getDebugName() { return N; } -uint64_t Defined::getFileOff() { - switch (kind()) { - case DefinedImportDataKind: - return cast(this)->getFileOff(); - case DefinedImportThunkKind: - return cast(this)->getFileOff(); - case DefinedLocalImportKind: - return cast(this)->getFileOff(); - case DefinedCommonKind: - return cast(this)->getFileOff(); - case DefinedRegularKind: - return cast(this)->getFileOff(); - - case DefinedBitcodeKind: - llvm_unreachable("There is no file offset for a bitcode symbol."); - case DefinedAbsoluteKind: - llvm_unreachable("Cannot get a file offset for an absolute symbol."); - case DefinedRelativeKind: - llvm_unreachable("Cannot get a file offset for a relative symbol."); - case LazyKind: - case UndefinedKind: - llvm_unreachable("Cannot get a file offset for an undefined symbol."); - } - llvm_unreachable("unknown symbol kind"); -} - COFFSymbolRef DefinedCOFF::getCOFFSymbol() { size_t SymSize = File->getCOFFObj()->getSymbolTableEntrySize(); if (SymSize == sizeof(coff_symbol16)) diff --git a/lld/COFF/Symbols.h b/lld/COFF/Symbols.h index 7059fbc..f96c1fb 100644 --- a/lld/COFF/Symbols.h +++ b/lld/COFF/Symbols.h @@ -125,10 +125,6 @@ public: // writer sets and uses RVAs. uint64_t getRVA(); - // Returns the file offset of this symbol in the final executable. - // The writer uses this information to apply relocations. - uint64_t getFileOff(); - // Returns the RVA relative to the beginning of the output section. // Used to implement SECREL relocation type. uint64_t getSecrel(); -- 2.7.4