[lld] r338713 - [LLD][ELF] - Remove dead code. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 06:18:49 PDT 2018


Author: grimar
Date: Thu Aug  2 06:18:49 2018
New Revision: 338713

URL: http://llvm.org/viewvc/llvm-project?rev=338713&view=rev
Log:
[LLD][ELF] - Remove dead code. NFC.

It does not seem that this code is alive.
I seems was needed previously but we fixed it.

If it is still needed, it needs new tests,
but for now I do not know how to trigger it,
and so I removed it.

Modified:
    lld/trunk/ELF/InputSection.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=338713&r1=338712&r2=338713&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Aug  2 06:18:49 2018
@@ -259,9 +259,6 @@ std::string InputSectionBase::getLocatio
 //
 //  Returns an empty string if there's no way to get line info.
 std::string InputSectionBase::getSrcMsg(const Symbol &Sym, uint64_t Offset) {
-  // Synthetic sections don't have input files.
-  if (!File)
-    return "";
   return File->getSrcMsg(Sym, *this, Offset);
 }
 
@@ -275,9 +272,6 @@ std::string InputSectionBase::getSrcMsg(
 //
 //   path/to/foo.o:(function bar) in archive path/to/bar.a
 std::string InputSectionBase::getObjMsg(uint64_t Off) {
-  // Synthetic sections don't have input files.
-  if (!File)
-    return ("<internal>:(" + Name + "+0x" + utohexstr(Off) + ")").str();
   std::string Filename = File->getName();
 
   std::string Archive;




More information about the llvm-commits mailing list