[lld] r285235 - Add comments.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 13:26:30 PDT 2016


Author: ruiu
Date: Wed Oct 26 15:26:29 2016
New Revision: 285235

URL: http://llvm.org/viewvc/llvm-project?rev=285235&view=rev
Log:
Add comments.

Modified:
    lld/trunk/ELF/Relocations.cpp
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=285235&r1=285234&r2=285235&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Wed Oct 26 15:26:29 2016
@@ -550,12 +550,14 @@ static std::string getLocation(SymbolBod
   if (SrcFile.empty())
     SrcFile = Sym.File ? getFilename(Sym.File) : getFilename(File);
 
-  DefinedRegular<ELFT> *Encl = getSymbolAt(&S, Offset);
-  if (Encl && Encl->Type == STT_FUNC) {
-    StringRef Func = getSymbolName(*File, *Encl);
+  // Find a symbol at a given location.
+  DefinedRegular<ELFT> *Sym = getSymbolAt(&S, Offset);
+  if (Sym && Sym->Type == STT_FUNC) {
+    StringRef Func = getSymbolName(*File, *Sym);
     return SrcFile + " (function " + maybeDemangle(Func) + ")";
   }
 
+  // If there's no symbol, print out the offset instead of a symbol name.
   return (SrcFile + " (" + S.Name + "+0x" + Twine::utohexstr(Offset) + ")")
       .str();
 }

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=285235&r1=285234&r2=285235&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Oct 26 15:26:29 2016
@@ -323,7 +323,7 @@ template <class ELFT> void Writer<ELFT>:
   if (Config->ExitEarly) {
     // Flush the output streams and exit immediately.  A full shutdown is a good
     // test that we are keeping track of all allocated memory, but actually
-    // freeing it is a wast of time in a regular linker run.
+    // freeing it is a waste of time in a regular linker run.
     outs().flush();
     errs().flush();
     _exit(0);




More information about the llvm-commits mailing list