summaryrefslogtreecommitdiff
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-11-14 00:49:16 +0000
committerSam Clegg <sbc@chromium.org>2017-11-14 00:49:16 +0000
commit336b4883e2f9e28097973cc9f4eef925b634d565 (patch)
treef90afcd11d54c52a25c949a194a01aa769b6b33a /lib/Bitcode
parent6765e2f47d855d7c9f8d4521e71a9d74a731e3e0 (diff)
[WebAssembly] Explicily disable comdat support for wasm output
For now at least. We clearly need some kind of comdat or linkonce_odr support for wasm but currently COMDAT is not supported. Disable COMDAT support in the same way we do the Mach-O. This also causes clang not to generated COMDATs. Differential Revision: https://reviews.llvm.org/D39873 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 3e0a39c099b..0b03d0062d9 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1825,10 +1825,10 @@ Expected<Value *> BitcodeReader::recordValue(SmallVectorImpl<uint64_t> &Record,
auto *GO = dyn_cast<GlobalObject>(V);
if (GO) {
if (GO->getComdat() == reinterpret_cast<Comdat *>(1)) {
- if (TT.isOSBinFormatMachO())
- GO->setComdat(nullptr);
- else
+ if (TT.supportsCOMDAT())
GO->setComdat(TheModule->getOrInsertComdat(V->getName()));
+ else
+ GO->setComdat(nullptr);
}
}
return V;