From 2c66b23d79c9f9a2c0b1113e9eec305600080943 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sun, 17 Apr 2016 07:35:38 +0000 Subject: [PATCH] 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. llvm-svn: 266555 --- lld/COFF/InputFiles.cpp | 1 + lld/ELF/LTO.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index c167ceb..c4d7028 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -321,6 +321,7 @@ void BitcodeFile::parse() { // Usually parse() is thread-safe, but bitcode file is an exception. std::lock_guard Lock(Mu); + Context.ensureDITypeMap(); ErrorOr> ModOrErr = LTOModule::createFromBuffer( Context, MB.getBufferStart(), MB.getBufferSize(), llvm::TargetOptions()); error(ModOrErr, "Could not create lto module"); diff --git a/lld/ELF/LTO.h b/lld/ELF/LTO.h index 8f74fb7..c06c49e 100644 --- a/lld/ELF/LTO.h +++ b/lld/ELF/LTO.h @@ -40,7 +40,9 @@ public: std::vector> 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> runSplitCodegen(); -- 2.7.4