[COFF] Remove an unused function, getFileOff
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 15 Mar 2016 09:48:18 +0000 (09:48 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 15 Mar 2016 09:48:18 +0000 (09:48 +0000)
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
lld/COFF/Symbols.h

index d732d76..3d125c9 100644 (file)
@@ -162,32 +162,6 @@ std::string SymbolBody::getDebugName() {
   return N;
 }
 
-uint64_t Defined::getFileOff() {
-  switch (kind()) {
-  case DefinedImportDataKind:
-    return cast<DefinedImportData>(this)->getFileOff();
-  case DefinedImportThunkKind:
-    return cast<DefinedImportThunk>(this)->getFileOff();
-  case DefinedLocalImportKind:
-    return cast<DefinedLocalImport>(this)->getFileOff();
-  case DefinedCommonKind:
-    return cast<DefinedCommon>(this)->getFileOff();
-  case DefinedRegularKind:
-    return cast<DefinedRegular>(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))
index 7059fbc..f96c1fb 100644 (file)
@@ -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();