[lld] r263057 - Update for Rui's comments on D18006

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 12:06:24 PST 2016


Author: silvas
Date: Wed Mar  9 14:06:24 2016
New Revision: 263057

URL: http://llvm.org/viewvc/llvm-project?rev=263057&view=rev
Log:
Update for Rui's comments on D18006

Somehow I missed them.

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=263057&r1=263056&r2=263057&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Wed Mar  9 14:06:24 2016
@@ -147,9 +147,11 @@ static void addBitcodeFile(IRMover &Move
   Mover.move(std::move(M), Keep, [](GlobalValue &, IRMover::ValueAdder) {});
 }
 
-static void saveBCFile(std::string Path, Module &M) {
+// This is for use when debugging LTO.
+static void saveBCFile(Module &M) {
   std::error_code EC;
-  raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None);
+  raw_fd_ostream OS(Config->OutputFile.str() + ".lto.bc", EC,
+                    sys::fs::OpenFlags::F_None);
   check(EC);
   WriteBitcodeToFile(&M, OS, /* ShouldPreserveUseListOrder */ true);
 }
@@ -164,7 +166,7 @@ ObjectFile<ELFT> *SymbolTable<ELFT>::cre
   for (const std::unique_ptr<BitcodeFile> &F : BitcodeFiles)
     addBitcodeFile(Mover, *F, Context);
   if (Config->SaveTemps)
-    saveBCFile(Config->OutputFile.str() + ".lto.bc", Combined);
+    saveBCFile(Combined);
   std::unique_ptr<InputFile> F = codegen(Combined);
   ObjectFiles.emplace_back(cast<ObjectFile<ELFT>>(F.release()));
   return &*ObjectFiles.back();




More information about the llvm-commits mailing list