[lld] r266555 - LTO: Merge debug info types when linking bitcode

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 17 00:35:38 PDT 2016


Author: dexonsmith
Date: Sun Apr 17 02:35:38 2016
New Revision: 266555

URL: http://llvm.org/viewvc/llvm-project?rev=266555&view=rev
Log:
LTO: Merge debug info types when linking bitcode

Make sure lld enables ODR type uniquing for debug info when invoking
LTO, as a follow-up to LLVM r266549.

Modified:
    lld/trunk/COFF/InputFiles.cpp
    lld/trunk/ELF/LTO.h

Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=266555&r1=266554&r2=266555&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Sun Apr 17 02:35:38 2016
@@ -321,6 +321,7 @@ void BitcodeFile::parse() {
   // Usually parse() is thread-safe, but bitcode file is an exception.
   std::lock_guard<std::mutex> Lock(Mu);
 
+  Context.ensureDITypeMap();
   ErrorOr<std::unique_ptr<LTOModule>> ModOrErr = LTOModule::createFromBuffer(
       Context, MB.getBufferStart(), MB.getBufferSize(), llvm::TargetOptions());
   error(ModOrErr, "Could not create lto module");

Modified: lld/trunk/ELF/LTO.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.h?rev=266555&r1=266554&r2=266555&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.h (original)
+++ lld/trunk/ELF/LTO.h Sun Apr 17 02:35:38 2016
@@ -40,7 +40,9 @@ public:
   std::vector<std::unique_ptr<InputFile>> compile();
 
   BitcodeCompiler()
-      : Combined(new llvm::Module("ld-temp.o", Context)), Mover(*Combined) {}
+      : Combined(new llvm::Module("ld-temp.o", Context)), Mover(*Combined) {
+    Context.ensureDITypeMap();
+  }
 
 private:
   std::vector<std::unique_ptr<InputFile>> runSplitCodegen();




More information about the llvm-commits mailing list