[lld] r267259 - Add comments.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 17:26:36 PDT 2016


Author: ruiu
Date: Fri Apr 22 19:26:32 2016
New Revision: 267259

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

Modified:
    lld/trunk/ELF/SymbolTable.cpp

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=267259&r1=267258&r2=267259&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Fri Apr 22 19:26:32 2016
@@ -114,6 +114,13 @@ void SymbolTable<ELFT>::addFile(std::uni
     resolve(B);
 }
 
+// This function is where all the optimizations of link-time
+// optimization happens. When LTO is in use, some input files are
+// not in native object file format but in the LLVM bitcode format.
+// This function compiles bitcode files into a few big native files
+// using LLVM functions and replaces bitcode symbols with the results.
+// Because all bitcode files that consist of a program are passed
+// to the compiler at once, it can do whole-program optimization.
 template <class ELFT> void SymbolTable<ELFT>::addCombinedLtoObject() {
   if (BitcodeFiles.empty())
     return;




More information about the llvm-commits mailing list