summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-17 07:35:38 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-17 07:35:38 +0000
commit2c66b23d79c9f9a2c0b1113e9eec305600080943 (patch)
tree926289417c112d7910681ca97b8a55dfa94cfcc1
parent75869d57019ddbf93510027c655d46a97eb526f4 (diff)
downloadbcm5719-llvm-2c66b23d79c9f9a2c0b1113e9eec305600080943.tar.gz
bcm5719-llvm-2c66b23d79c9f9a2c0b1113e9eec305600080943.zip
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
-rw-r--r--lld/COFF/InputFiles.cpp1
-rw-r--r--lld/ELF/LTO.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index c167ceb9c57..c4d7028e419 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<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");
diff --git a/lld/ELF/LTO.h b/lld/ELF/LTO.h
index 8f74fb72ade..c06c49e8324 100644
--- a/lld/ELF/LTO.h
+++ b/lld/ELF/LTO.h
@@ -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();
OpenPOWER on IntegriCloud