This breaks AddressSanitizer again, same error messages:<div><pre style="font-family:'Courier New',courier,monotype,monospace;color:rgb(0,0,0);font-size:medium;line-height:normal"><span class="stdout">ASAN_NOINST_TEST_OBJECTS.asan_fake_stack_test.cc.i386-inline.o : error LNK2005: "`string'" (??_C@_00CNPNBAHC@?$AA@) already defined in ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.i386-inline.o
</span></pre><div><span class="stdout">etc</span></div><br><div><span style="line-height:19.7999992370605px">Please make sure "ninja check-asan" works before recommitting the change next time and coordinate with David and Kostya if you have any questions on how COMDATs interplay with AddressSanitizer.</span><br></div><br><div class="gmail_quote">On Fri Jan 16 2015 at 5:27:22 AM Rafael Espindola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Thu Jan 15 20:22:55 2015<br>
New Revision: 226242<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226242&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project?rev=226242&view=rev</a><br>
Log:<br>
Revert "Revert Don't create new comdats in CodeGen"<br>
<br>
This reverts commit r226173, adding r226038 back.<br>
<br>
No change in this commit, but clang was changed to also produce trivial comdats for<br>
costructors, destructors and vtables when needed.<br>
<br>
Original message:<br>
<br>
Don't create new comdats in CodeGen.<br>
<br>
This patch stops the implicit creation of comdats during codegen.<br>
<br>
Clang now sets the comdat explicitly when it is required. With this patch clang and gcc<br>
now produce the same result in pr19848.<br>
<br>
Removed:<br>
llvm/trunk/test/CodeGen/ARM/<u></u>odr_comdat.ll<br>
llvm/trunk/test/CodeGen/X86/<u></u>odr_comdat.ll<br>
llvm/trunk/test/MC/COFF/weak-<u></u>symbol.ll<br>
Modified:<br>
llvm/trunk/lib/Bitcode/Reader/<u></u>BitcodeReader.cpp<br>
llvm/trunk/lib/Bitcode/Writer/<u></u>BitcodeWriter.cpp<br>
llvm/trunk/lib/CodeGen/<u></u>TargetLoweringObjectFileImpl.<u></u>cpp<br>
llvm/trunk/lib/Target/XCore/<u></u>XCoreAsmPrinter.cpp<br>
llvm/trunk/test/Bitcode/<u></u>linkage-types-3.2.ll<br>
llvm/trunk/test/CodeGen/ARM/<u></u>section-name.ll<br>
llvm/trunk/test/CodeGen/X86/<u></u>dllexport-x86_64.ll<br>
llvm/trunk/test/CodeGen/X86/<u></u>dllexport.ll<br>
llvm/trunk/test/CodeGen/X86/<u></u>global-sections.ll<br>
llvm/trunk/test/CodeGen/X86/<u></u>pic_jumptable.ll<br>
llvm/trunk/test/MC/COFF/bss_<u></u>section.ll<br>
llvm/trunk/test/MC/COFF/const-<u></u>gv-with-rel-init.ll<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Reader/<u></u>BitcodeReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>Bitcode/Reader/BitcodeReader.<u></u>cpp?rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Bitcode/Reader/<u></u>BitcodeReader.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Reader/<u></u>BitcodeReader.cpp Thu Jan 15 20:22:55 2015<br>
@@ -156,19 +156,27 @@ static bool ConvertToString(ArrayRef<uin<br>
return false;<br>
}<br>
<br>
+static bool hasImplicitComdat(size_t Val) {<br>
+ switch (Val) {<br>
+ default:<br>
+ return false;<br>
+ case 1: // Old WeakAnyLinkage<br>
+ case 4: // Old LinkOnceAnyLinkage<br>
+ case 10: // Old WeakODRLinkage<br>
+ case 11: // Old LinkOnceODRLinkage<br>
+ return true;<br>
+ }<br>
+}<br>
+<br>
static GlobalValue::LinkageTypes getDecodedLinkage(unsigned Val) {<br>
switch (Val) {<br>
default: // Map unknown/new linkages to external<br>
case 0:<br>
return GlobalValue::ExternalLinkage;<br>
- case 1:<br>
- return GlobalValue::WeakAnyLinkage;<br>
case 2:<br>
return GlobalValue::AppendingLinkage;<br>
case 3:<br>
return GlobalValue::InternalLinkage;<br>
- case 4:<br>
- return GlobalValue::<u></u>LinkOnceAnyLinkage;<br>
case 5:<br>
return GlobalValue::ExternalLinkage; // Obsolete DLLImportLinkage<br>
case 6:<br>
@@ -179,10 +187,6 @@ static GlobalValue::LinkageTypes getDeco<br>
return GlobalValue::CommonLinkage;<br>
case 9:<br>
return GlobalValue::PrivateLinkage;<br>
- case 10:<br>
- return GlobalValue::WeakODRLinkage;<br>
- case 11:<br>
- return GlobalValue::<u></u>LinkOnceODRLinkage;<br>
case 12:<br>
return GlobalValue::<u></u>AvailableExternallyLinkage;<br>
case 13:<br>
@@ -191,6 +195,18 @@ static GlobalValue::LinkageTypes getDeco<br>
return GlobalValue::PrivateLinkage; // Obsolete LinkerPrivateWeakLinkage<br>
case 15:<br>
return GlobalValue::ExternalLinkage; // Obsolete LinkOnceODRAutoHideLinkage<br>
+ case 1: // Old value with implicit comdat.<br>
+ case 16:<br>
+ return GlobalValue::WeakAnyLinkage;<br>
+ case 10: // Old value with implicit comdat.<br>
+ case 17:<br>
+ return GlobalValue::WeakODRLinkage;<br>
+ case 4: // Old value with implicit comdat.<br>
+ case 18:<br>
+ return GlobalValue::<u></u>LinkOnceAnyLinkage;<br>
+ case 11: // Old value with implicit comdat.<br>
+ case 19:<br>
+ return GlobalValue::<u></u>LinkOnceODRLinkage;<br>
}<br>
}<br>
<br>
@@ -1118,6 +1134,10 @@ std::error_code BitcodeReader::ParseValu<br>
Value *V = ValueList[ValueID];<br>
<br>
V->setName(StringRef(<u></u>ValueName.data(), ValueName.size()));<br>
+ if (auto *GO = dyn_cast<GlobalObject>(V)) {<br>
+ if (GO->getComdat() == reinterpret_cast<Comdat *>(1))<br>
+ GO->setComdat(TheModule-><u></u>getOrInsertComdat(V->getName()<u></u>));<br>
+ }<br>
ValueName.clear();<br>
break;<br>
}<br>
@@ -2140,7 +2160,8 @@ std::error_code BitcodeReader::ParseModu<br>
Ty = cast<PointerType>(Ty)-><u></u>getElementType();<br>
<br>
bool isConstant = Record[1];<br>
- GlobalValue::LinkageTypes Linkage = getDecodedLinkage(Record[3]);<br>
+ uint64_t RawLinkage = Record[3];<br>
+ GlobalValue::LinkageTypes Linkage = getDecodedLinkage(RawLinkage);<br>
unsigned Alignment = (1 << Record[4]) >> 1;<br>
std::string Section;<br>
if (Record[5]) {<br>
@@ -2178,7 +2199,7 @@ std::error_code BitcodeReader::ParseModu<br>
if (Record.size() > 10)<br>
NewGV->setDLLStorageClass(<u></u>GetDecodedDLLStorageClass(<u></u>Record[10]));<br>
else<br>
- UpgradeDLLImportExportLinkage(<u></u>NewGV, Record[3]);<br>
+ UpgradeDLLImportExportLinkage(<u></u>NewGV, RawLinkage);<br>
<br>
ValueList.push_back(NewGV);<br>
<br>
@@ -2186,11 +2207,14 @@ std::error_code BitcodeReader::ParseModu<br>
if (unsigned InitID = Record[2])<br>
GlobalInits.push_back(std::<u></u>make_pair(NewGV, InitID-1));<br>
<br>
- if (Record.size() > 11)<br>
+ if (Record.size() > 11) {<br>
if (unsigned ComdatID = Record[11]) {<br>
assert(ComdatID <= ComdatList.size());<br>
NewGV->setComdat(ComdatList[<u></u>ComdatID - 1]);<br>
}<br>
+ } else if (hasImplicitComdat(RawLinkage)<u></u>) {<br>
+ NewGV->setComdat(reinterpret_<u></u>cast<Comdat *>(1));<br>
+ }<br>
break;<br>
}<br>
// FUNCTION: [type, callingconv, isproto, linkage, paramattr,<br>
@@ -2214,7 +2238,8 @@ std::error_code BitcodeReader::ParseModu<br>
<br>
Func->setCallingConv(static_<u></u>cast<CallingConv::ID>(Record[<u></u>1]));<br>
bool isProto = Record[2];<br>
- Func->setLinkage(<u></u>getDecodedLinkage(Record[3]));<br>
+ uint64_t RawLinkage = Record[3];<br>
+ Func->setLinkage(<u></u>getDecodedLinkage(RawLinkage))<u></u>;<br>
Func->setAttributes(<u></u>getAttributes(Record[4]));<br>
<br>
Func->setAlignment((1 << Record[5]) >> 1);<br>
@@ -2242,13 +2267,16 @@ std::error_code BitcodeReader::ParseModu<br>
if (Record.size() > 11)<br>
Func->setDLLStorageClass(<u></u>GetDecodedDLLStorageClass(<u></u>Record[11]));<br>
else<br>
- UpgradeDLLImportExportLinkage(<u></u>Func, Record[3]);<br>
+ UpgradeDLLImportExportLinkage(<u></u>Func, RawLinkage);<br>
<br>
- if (Record.size() > 12)<br>
+ if (Record.size() > 12) {<br>
if (unsigned ComdatID = Record[12]) {<br>
assert(ComdatID <= ComdatList.size());<br>
Func->setComdat(ComdatList[<u></u>ComdatID - 1]);<br>
}<br>
+ } else if (hasImplicitComdat(RawLinkage)<u></u>) {<br>
+ Func->setComdat(reinterpret_<u></u>cast<Comdat *>(1));<br>
+ }<br>
<br>
if (Record.size() > 13 && Record[13] != 0)<br>
FunctionPrefixes.push_back(<u></u>std::make_pair(Func, Record[13]-1));<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Writer/<u></u>BitcodeWriter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>Bitcode/Writer/BitcodeWriter.<u></u>cpp?rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Bitcode/Writer/<u></u>BitcodeWriter.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Writer/<u></u>BitcodeWriter.cpp Thu Jan 15 20:22:55 2015<br>
@@ -480,13 +480,13 @@ static unsigned getEncodedLinkage(const<br>
case GlobalValue::ExternalLinkage:<br>
return 0;<br>
case GlobalValue::WeakAnyLinkage:<br>
- return 1;<br>
+ return 16;<br>
case GlobalValue::AppendingLinkage:<br>
return 2;<br>
case GlobalValue::InternalLinkage:<br>
return 3;<br>
case GlobalValue::<u></u>LinkOnceAnyLinkage:<br>
- return 4;<br>
+ return 18;<br>
case GlobalValue::<u></u>ExternalWeakLinkage:<br>
return 7;<br>
case GlobalValue::CommonLinkage:<br>
@@ -494,9 +494,9 @@ static unsigned getEncodedLinkage(const<br>
case GlobalValue::PrivateLinkage:<br>
return 9;<br>
case GlobalValue::WeakODRLinkage:<br>
- return 10;<br>
+ return 17;<br>
case GlobalValue::<u></u>LinkOnceODRLinkage:<br>
- return 11;<br>
+ return 19;<br>
case GlobalValue::<u></u>AvailableExternallyLinkage:<br>
return 12;<br>
}<br>
@@ -629,7 +629,7 @@ static void WriteModuleInfo(const Module<br>
Log2_32_Ceil(MaxGlobalType+1))<u></u>);<br>
Abbv->Add(BitCodeAbbrevOp(<u></u>BitCodeAbbrevOp::Fixed, 1)); // Constant.<br>
Abbv->Add(BitCodeAbbrevOp(<u></u>BitCodeAbbrevOp::VBR, 6)); // Initializer.<br>
- Abbv->Add(BitCodeAbbrevOp(<u></u>BitCodeAbbrevOp::Fixed, 4)); // Linkage.<br>
+ Abbv->Add(BitCodeAbbrevOp(<u></u>BitCodeAbbrevOp::Fixed, 5)); // Linkage.<br>
if (MaxAlignment == 0) // Alignment.<br>
Abbv->Add(BitCodeAbbrevOp(0));<br>
else {<br>
<br>
Modified: llvm/trunk/lib/CodeGen/<u></u>TargetLoweringObjectFileImpl.<u></u>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/<u></u>CodeGen/<u></u>TargetLoweringObjectFileImpl.<u></u>cpp?rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/CodeGen/<u></u>TargetLoweringObjectFileImpl.<u></u>cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/<u></u>TargetLoweringObjectFileImpl.<u></u>cpp Thu Jan 15 20:22:55 2015<br>
@@ -257,8 +257,7 @@ SelectSectionForGlobal(const GlobalValue<br>
<br>
// If this global is linkonce/weak and the target handles this by emitting it<br>
// into a 'uniqued' section name, create and return the section now.<br>
- if ((GV->isWeakForLinker() || EmitUniquedSection || GV->hasComdat()) &&<br>
- !Kind.isCommon()) {<br>
+ if ((EmitUniquedSection && !Kind.isCommon()) || GV->hasComdat()) {<br>
StringRef Prefix = getSectionPrefixForGlobal(<u></u>Kind);<br>
<br>
SmallString<128> Name(Prefix);<br>
@@ -266,12 +265,9 @@ SelectSectionForGlobal(const GlobalValue<br>
<br>
StringRef Group = "";<br>
unsigned Flags = getELFSectionFlags(Kind);<br>
- if (GV->isWeakForLinker() || GV->hasComdat()) {<br>
- if (const Comdat *C = getELFComdat(GV))<br>
- Group = C->getName();<br>
- else<br>
- Group = Name.substr(Prefix.size());<br>
+ if (const Comdat *C = getELFComdat(GV)) {<br>
Flags |= ELF::SHF_GROUP;<br>
+ Group = C->getName();<br>
}<br>
<br>
return getContext().getELFSection(<u></u>Name.str(),<br>
@@ -801,7 +797,7 @@ const MCSection *TargetLoweringObjectFil<br>
unsigned Characteristics = getCOFFSectionFlags(Kind);<br>
StringRef Name = GV->getSection();<br>
StringRef COMDATSymName = "";<br>
- if ((GV->isWeakForLinker() || GV->hasComdat()) && !Kind.isCommon()) {<br>
+ if (GV->hasComdat()) {<br>
Selection = getSelectionForCOFF(GV);<br>
const GlobalValue *ComdatGV;<br>
if (Selection == COFF::IMAGE_COMDAT_SELECT_<u></u>ASSOCIATIVE)<br>
@@ -848,12 +844,7 @@ SelectSectionForGlobal(const GlobalValue<br>
else<br>
EmitUniquedSection = TM.getDataSections();<br>
<br>
- // If this global is linkonce/weak and the target handles this by emitting it<br>
- // into a 'uniqued' section name, create and return the section now.<br>
- // Section names depend on the name of the symbol which is not feasible if the<br>
- // symbol has private linkage.<br>
- if ((GV->isWeakForLinker() || EmitUniquedSection || GV->hasComdat()) &&<br>
- !Kind.isCommon()) {<br>
+ if ((EmitUniquedSection && !Kind.isCommon()) || GV->hasComdat()) {<br>
const char *Name = getCOFFSectionNameForUniqueGlo<u></u>bal(Kind);<br>
unsigned Characteristics = getCOFFSectionFlags(Kind);<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/XCore/<u></u>XCoreAsmPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/Target/<u></u>XCore/XCoreAsmPrinter.cpp?rev=<u></u>226242&r1=226241&r2=226242&<u></u>view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/lib/Target/XCore/<u></u>XCoreAsmPrinter.cpp (original)<br>
+++ llvm/trunk/lib/Target/XCore/<u></u>XCoreAsmPrinter.cpp Thu Jan 15 20:22:55 2015<br>
@@ -105,7 +105,6 @@ void XCoreAsmPrinter::<u></u>emitArrayBound(MCS<br>
OutContext));<br>
if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||<br>
GV->hasCommonLinkage()) {<br>
- // TODO Use COMDAT groups for LinkOnceLinkage<br>
OutStreamer.<u></u>EmitSymbolAttribute(SymGlob, MCSA_Weak);<br>
}<br>
}<br>
@@ -140,7 +139,6 @@ void XCoreAsmPrinter::<u></u>EmitGlobalVariable<br>
emitArrayBound(GVSym, GV);<br>
OutStreamer.<u></u>EmitSymbolAttribute(GVSym, MCSA_Global);<br>
<br>
- // TODO Use COMDAT groups for LinkOnceLinkage<br>
if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||<br>
GV->hasCommonLinkage())<br>
OutStreamer.<u></u>EmitSymbolAttribute(GVSym, MCSA_Weak);<br>
<br>
Modified: llvm/trunk/test/Bitcode/<u></u>linkage-types-3.2.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/linkage-types-3.2.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>Bitcode/linkage-types-3.2.ll?<u></u>rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/Bitcode/<u></u>linkage-types-3.2.ll (original)<br>
+++ llvm/trunk/test/Bitcode/<u></u>linkage-types-3.2.ll Thu Jan 15 20:22:55 2015<br>
@@ -33,13 +33,13 @@<br>
; CHECK: @available_externally.var = available_externally constant i32 0{{$}}<br>
<br>
@linkonce.var = linkonce constant i32 0<br>
-; CHECK: @linkonce.var = linkonce constant i32 0{{$}}<br>
+; CHECK: @linkonce.var = linkonce constant i32 0, comdat{{$}}<br>
<br>
@weak.var = weak constant i32 0<br>
-; CHECK: @weak.var = weak constant i32 0{{$}}<br>
+; CHECK: @weak.var = weak constant i32 0, comdat{{$}}<br>
<br>
@linkonce_odr.var = linkonce_odr constant i32 0<br>
-; CHECK: @linkonce_odr.var = linkonce_odr constant i32 0{{$}}<br>
+; CHECK: @linkonce_odr.var = linkonce_odr constant i32 0, comdat{{$}}<br>
<br>
@linkonce_odr_auto_hide.var = linkonce_odr_auto_hide constant i32 0<br>
; CHECK: @linkonce_odr_auto_hide.var = constant i32 0{{$}}<br>
@@ -90,19 +90,19 @@ define available_externally void @availa<br>
}<br>
<br>
define linkonce void @linkonce()<br>
-; CHECK: define linkonce void @linkonce() {<br>
+; CHECK: define linkonce void @linkonce() comdat {<br>
{<br>
ret void<br>
}<br>
<br>
define weak void @weak()<br>
-; CHECK: define weak void @weak() {<br>
+; CHECK: define weak void @weak() comdat {<br>
{<br>
ret void<br>
}<br>
<br>
define linkonce_odr void @linkonce_odr()<br>
-; CHECK: define linkonce_odr void @linkonce_odr() {<br>
+; CHECK: define linkonce_odr void @linkonce_odr() comdat {<br>
{<br>
ret void<br>
}<br>
<br>
Removed: llvm/trunk/test/CodeGen/ARM/<u></u>odr_comdat.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/odr_comdat.ll?rev=226241&view=auto" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/ARM/odr_comdat.ll?rev=<u></u>226241&view=auto</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/ARM/<u></u>odr_comdat.ll (original)<br>
+++ llvm/trunk/test/CodeGen/ARM/<u></u>odr_comdat.ll (removed)<br>
@@ -1,16 +0,0 @@<br>
-; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s -check-prefix=ARMGNUEABI<br>
-<br>
-; Checking that a comdat group gets generated correctly for a static member<br>
-; of instantiated C++ templates.<br>
-; see <a href="http://sourcery.mentor.com/public/cxx-abi/abi.html#vague-itemplate" target="_blank" class="cremed">http://sourcery.mentor.com/<u></u>public/cxx-abi/abi.html#vague-<u></u>itemplate</a><br>
-; section 5.2.6 Instantiated templates<br>
-; "Any static member data object is emitted in a COMDAT identified by its mangled<br>
-; name, in any object file with a reference to its name symbol."<br>
-<br>
-; Case 1: variable is not explicitly initialized, and ends up in a .bss section<br>
-; ARMGNUEABI: .section .bss._ZN1CIiE1iE,"aGw",%<u></u>nobits,_ZN1CIiE1iE,comdat<br>
-@_ZN1CIiE1iE = weak_odr global i32 0, align 4<br>
-<br>
-; Case 2: variable is explicitly initialized, and ends up in a .data section<br>
-; ARMGNUEABI: .section .data._ZN1CIiE1jE,"aGw",%<u></u>progbits,_ZN1CIiE1jE,comdat<br>
-@_ZN1CIiE1jE = weak_odr global i32 12, align 4<br>
<br>
Modified: llvm/trunk/test/CodeGen/ARM/<u></u>section-name.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/section-name.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/ARM/section-name.ll?<u></u>rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/ARM/<u></u>section-name.ll (original)<br>
+++ llvm/trunk/test/CodeGen/ARM/<u></u>section-name.ll Thu Jan 15 20:22:55 2015<br>
@@ -16,7 +16,7 @@ entry:<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text.test3,"axG",%progbits,<u></u>test3,comdat<br>
+; CHECK: .text<br>
; CHECK: .weak test3<br>
; CHECK: .type test3,%function<br>
define linkonce_odr void @test3() {<br>
<br>
Modified: llvm/trunk/test/CodeGen/X86/<u></u>dllexport-x86_64.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dllexport-x86_64.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/X86/dllexport-x86_64.<u></u>ll?rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/X86/<u></u>dllexport-x86_64.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/<u></u>dllexport-x86_64.ll Thu Jan 15 20:22:55 2015<br>
@@ -17,19 +17,16 @@ define dllexport void @f2() unnamed_addr<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text,"xr",discard,lnk1<br>
; CHECK: .globl lnk1<br>
define linkonce_odr dllexport void @lnk1() {<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text,"xr",discard,lnk2<br>
; CHECK: .globl lnk2<br>
define linkonce_odr dllexport void @lnk2() alwaysinline {<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text,"xr",discard,weak1<br>
; CHECK: .globl weak1<br>
define weak_odr dllexport void @weak1() {<br>
ret void<br>
@@ -47,11 +44,9 @@ define weak_odr dllexport void @weak1()<br>
; CHECK: .comm Var3<br>
@Var3 = common dllexport global i32 0, align 4<br>
<br>
-; CHECK: .section .data,"wd",discard,WeakVar1<br>
; CHECK: .globl WeakVar1<br>
@WeakVar1 = weak_odr dllexport global i32 1, align 4<br>
<br>
-; CHECK: .section .rdata,"rd",discard,WeakVar2<br>
; CHECK: .globl WeakVar2<br>
@WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1<br>
<br>
<br>
Modified: llvm/trunk/test/CodeGen/X86/<u></u>dllexport.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dllexport.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/X86/dllexport.ll?rev=<u></u>226242&r1=226241&r2=226242&<u></u>view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/X86/<u></u>dllexport.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/<u></u>dllexport.ll Thu Jan 15 20:22:55 2015<br>
@@ -36,19 +36,16 @@ define dllexport x86_thiscallcc void @th<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text,"xr",discard,_lnk1<br>
; CHECK: .globl _lnk1<br>
define linkonce_odr dllexport void @lnk1() {<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text,"xr",discard,_lnk2<br>
; CHECK: .globl _lnk2<br>
define linkonce_odr dllexport void @lnk2() alwaysinline {<br>
ret void<br>
}<br>
<br>
-; CHECK: .section .text,"xr",discard,_weak1<br>
; CHECK: .globl _weak1<br>
define weak_odr dllexport void @weak1() {<br>
ret void<br>
@@ -66,11 +63,9 @@ define weak_odr dllexport void @weak1()<br>
; CHECK: .comm _Var3<br>
@Var3 = common dllexport global i32 0, align 4<br>
<br>
-; CHECK: .section .data,"wd",discard,_WeakVar1<br>
; CHECK: .globl _WeakVar1<br>
@WeakVar1 = weak_odr dllexport global i32 1, align 4<br>
<br>
-; CHECK: .section .rdata,"rd",discard,_WeakVar2<br>
; CHECK: .globl _WeakVar2<br>
@WeakVar2 = weak_odr dllexport unnamed_addr constant i32 1<br>
<br>
<br>
Modified: llvm/trunk/test/CodeGen/X86/<u></u>global-sections.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/global-sections.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/X86/global-sections.<u></u>ll?rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/X86/<u></u>global-sections.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/<u></u>global-sections.ll Thu Jan 15 20:22:55 2015<br>
@@ -85,7 +85,6 @@ define void @F1() {<br>
@"foo bar" = linkonce global i32 42<br>
<br>
; LINUX: .type "foo bar",@object<br>
-; LINUX: .section ".data.foo bar","aGw",@progbits,"foo bar",comdat<br>
; LINUX: .weak "foo bar"<br>
; LINUX: "foo bar":<br>
<br>
@@ -98,7 +97,6 @@ define void @F1() {<br>
@G6 = weak_odr unnamed_addr constant [1 x i8] c"\01"<br>
<br>
; LINUX: .type G6,@object<br>
-; LINUX: .section .rodata.G6,"aG",@progbits,G6,<u></u>comdat<br>
; LINUX: .weak G6<br>
; LINUX: G6:<br>
; LINUX: .byte 1<br>
<br>
Removed: llvm/trunk/test/CodeGen/X86/<u></u>odr_comdat.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/odr_comdat.ll?rev=226241&view=auto" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/X86/odr_comdat.ll?rev=<u></u>226241&view=auto</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/X86/<u></u>odr_comdat.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/<u></u>odr_comdat.ll (removed)<br>
@@ -1,16 +0,0 @@<br>
-; RUN: llc < %s -mtriple=x86_64-unknown-linux-<u></u>gnu | FileCheck %s -check-prefix=X86LINUX<br>
-<br>
-; Checking that a comdat group gets generated correctly for a static member<br>
-; of instantiated C++ templates.<br>
-; see <a href="http://sourcery.mentor.com/public/cxx-abi/abi.html#vague-itemplate" target="_blank" class="cremed">http://sourcery.mentor.com/<u></u>public/cxx-abi/abi.html#vague-<u></u>itemplate</a><br>
-; section 5.2.6 Instantiated templates<br>
-; "Any static member data object is emitted in a COMDAT identified by its mangled<br>
-; name, in any object file with a reference to its name symbol."<br>
-<br>
-; Case 1: variable is not explicitly initialized, and ends up in a .bss section<br>
-; X86LINUX: .section .bss._ZN1CIiE1iE,"aGw",@<u></u>nobits,_ZN1CIiE1iE,comdat<br>
-@_ZN1CIiE1iE = weak_odr global i32 0, align 4<br>
-<br>
-; Case 2: variable is explicitly initialized, and ends up in a .data section<br>
-; X86LINUX: .section .data._ZN1CIiE1jE,"aGw",@<u></u>progbits,_ZN1CIiE1jE,comdat<br>
-@_ZN1CIiE1jE = weak_odr global i32 12, align 4<br>
<br>
Modified: llvm/trunk/test/CodeGen/X86/<u></u>pic_jumptable.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic_jumptable.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/<u></u>CodeGen/X86/pic_jumptable.ll?<u></u>rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/CodeGen/X86/<u></u>pic_jumptable.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/<u></u>pic_jumptable.ll Thu Jan 15 20:22:55 2015<br>
@@ -10,7 +10,7 @@<br>
<br>
declare void @_Z3bari(i32)<br>
<br>
-; CHECK-LINUX: .text._Z3fooILi1EEvi,"axG",@<u></u>progbits,_Z3fooILi1EEvi,comdat<br>
+; CHECK-LINUX: _Z3fooILi1EEvi:<br>
define linkonce void @_Z3fooILi1EEvi(i32 %Y) nounwind {<br>
entry:<br>
; CHECK: L0$pb<br>
<br>
Modified: llvm/trunk/test/MC/COFF/bss_<u></u>section.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/bss_section.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/MC/<u></u>COFF/bss_section.ll?rev=<u></u>226242&r1=226241&r2=226242&<u></u>view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/MC/COFF/bss_<u></u>section.ll (original)<br>
+++ llvm/trunk/test/MC/COFF/bss_<u></u>section.ll Thu Jan 15 20:22:55 2015<br>
@@ -5,5 +5,6 @@<br>
@"\01?thingy@@3Ufoo@@B" = global %struct.foo zeroinitializer, align 4<br>
; CHECK: .bss<br>
<br>
-@thingy_linkonce = linkonce_odr global %struct.foo zeroinitializer, align 4<br>
+$thingy_linkonce = comdat any<br>
+@thingy_linkonce = linkonce_odr global %struct.foo zeroinitializer, comdat, align 4<br>
; CHECK: .section .bss,"wb",discard,_thingy_<u></u>linkonce<br>
<br>
Modified: llvm/trunk/test/MC/COFF/const-<u></u>gv-with-rel-init.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/const-gv-with-rel-init.ll?rev=226242&r1=226241&r2=226242&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/MC/<u></u>COFF/const-gv-with-rel-init.<u></u>ll?rev=226242&r1=226241&r2=<u></u>226242&view=diff</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/MC/COFF/const-<u></u>gv-with-rel-init.ll (original)<br>
+++ llvm/trunk/test/MC/COFF/const-<u></u>gv-with-rel-init.ll Thu Jan 15 20:22:55 2015<br>
@@ -8,4 +8,4 @@ define void @f() {<br>
; CHECK: .section .CRT$XLB,"rd"<br>
<br>
@weak_array = weak_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @f to i8*)]<br>
-; CHECK: .section .rdata,"rd",discard,weak_array<br>
+; CHECK: .section .rdata,"rd"<br>
<br>
Removed: llvm/trunk/test/MC/COFF/weak-<u></u>symbol.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/weak-symbol.ll?rev=226241&view=auto" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/test/MC/<u></u>COFF/weak-symbol.ll?rev=<u></u>226241&view=auto</a><br>
==============================<u></u>==============================<u></u>==================<br>
--- llvm/trunk/test/MC/COFF/weak-<u></u>symbol.ll (original)<br>
+++ llvm/trunk/test/MC/COFF/weak-<u></u>symbol.ll (removed)<br>
@@ -1,48 +0,0 @@<br>
-; Test that weak functions and globals are placed into selectany COMDAT<br>
-; sections with the mangled name as suffix. Ensure that the weak linkage<br>
-; type is not ignored by the backend if the section was specialized.<br>
-;<br>
-; RUN: llc -mtriple=i686-pc-win32 %s -o - | FileCheck %s --check-prefix=X86<br>
-; RUN: llc -mtriple=i686-pc-mingw32 %s -o - | FileCheck %s --check-prefix=X86<br>
-; RUN: llc -mtriple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=X64<br>
-; RUN: llc -mtriple=x86_64-pc-mingw32 %s -o - | FileCheck %s --check-prefix=X64<br>
-<br>
-; Mangled function<br>
-; X86: .section .text,"xr",discard,__Z3foo<br>
-; X86: .globl __Z3foo<br>
-;<br>
-; X64: .section .text,"xr",discard,_Z3foo<br>
-; X64: .globl _Z3foo<br>
-define weak void @_Z3foo() {<br>
- ret void<br>
-}<br>
-<br>
-; Unmangled function<br>
-; X86: .section .sect,"xr",discard,_f<br>
-; X86: .globl _f<br>
-;<br>
-; X64: .section .sect,"xr",discard,f<br>
-; X64: .globl f<br>
-define weak void @f() section ".sect" {<br>
- ret void<br>
-}<br>
-<br>
-; Weak global<br>
-; X86: .section .data,"rd",discard,_a<br>
-; X86: .globl _a<br>
-; X86: .zero 12<br>
-;<br>
-; X64: .section .data,"rd",discard,a<br>
-; X64: .globl a<br>
-; X64: .zero 12<br>
-@a = weak unnamed_addr constant { i32, i32, i32 } { i32 0, i32 0, i32 0}, section ".data"<br>
-<br>
-; X86: .section .tls$,"wd",discard,_b<br>
-; X86: .globl _b<br>
-; X86: .long 0<br>
-;<br>
-; X64: .section .tls$,"wd",discard,b<br>
-; X64: .globl b<br>
-; X64: .long 0<br>
-<br>
-@b = weak_odr thread_local global i32 0, align 4<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>