From fad1639a12a60735545a4d59a35c82841131a51a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 14 Jan 2015 20:55:48 +0000 Subject: 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: 226038 --- 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 5e8c64e..960a792 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.1