From 999660761e45f0c17693c5a756af69a4eb0b0b71 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 14 Nov 2017 00:49:16 +0000 Subject: [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 llvm-svn: 318123 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 3e0a39c..0b03d00 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1825,10 +1825,10 @@ Expected BitcodeReader::recordValue(SmallVectorImpl &Record, auto *GO = dyn_cast(V); if (GO) { if (GO->getComdat() == reinterpret_cast(1)) { - if (TT.isOSBinFormatMachO()) - GO->setComdat(nullptr); - else + if (TT.supportsCOMDAT()) GO->setComdat(TheModule->getOrInsertComdat(V->getName())); + else + GO->setComdat(nullptr); } } return V; -- cgit v1.1