From 12ca34f53ff8449283fc6a0e1c6ab1f739f3158f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 19 Jan 2015 15:16:06 +0000 Subject: Bring r226038 back. No change in this commit, but clang was changed to also produce trivial comdats when needed. Original message: Don't create new comdats in CodeGen. This patch stops the implicit creation of comdats during codegen. Clang now sets the comdat explicitly when it is required. With this patch clang and gcc now produce the same result in pr19848. llvm-svn: 226467 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 5e8c64ee9cd..960a7922cd8 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -480,13 +480,13 @@ static unsigned getEncodedLinkage(const GlobalValue &GV) { case GlobalValue::ExternalLinkage: return 0; case GlobalValue::WeakAnyLinkage: - return 1; + return 16; case GlobalValue::AppendingLinkage: return 2; case GlobalValue::InternalLinkage: return 3; case GlobalValue::LinkOnceAnyLinkage: - return 4; + return 18; case GlobalValue::ExternalWeakLinkage: return 7; case GlobalValue::CommonLinkage: @@ -494,9 +494,9 @@ static unsigned getEncodedLinkage(const GlobalValue &GV) { case GlobalValue::PrivateLinkage: return 9; case GlobalValue::WeakODRLinkage: - return 10; + return 17; case GlobalValue::LinkOnceODRLinkage: - return 11; + return 19; case GlobalValue::AvailableExternallyLinkage: return 12; } @@ -629,7 +629,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Log2_32_Ceil(MaxGlobalType+1))); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Constant. Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Initializer. - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // Linkage. + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5)); // Linkage. if (MaxAlignment == 0) // Alignment. Abbv->Add(BitCodeAbbrevOp(0)); else { -- cgit v1.2.3