[llvm-commits] [llvm] r64908 - in /llvm/branches/Apple/Dib: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp test/CodeGen/X86/cstring.ll
Bill Wendling
isanbard at gmail.com
Wed Feb 18 00:34:09 PST 2009
Author: void
Date: Wed Feb 18 02:34:09 2009
New Revision: 64908
URL: http://llvm.org/viewvc/llvm-project?rev=64908&view=rev
Log:
Pull r64877 into Dib:
GV with null value initializer shouldn't go to BSS if it's meant for a mergeable
strings section. Currently it only checks for Darwin. Someone else please check
if it should apply to other targets as well.
Added:
llvm/branches/Apple/Dib/test/CodeGen/X86/cstring.ll
- copied unchanged from r64877, llvm/trunk/test/CodeGen/X86/cstring.ll
Modified:
llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Modified: llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=64908&r1=64907&r2=64908&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Wed Feb 18 02:34:09 2009
@@ -835,7 +835,9 @@
if (Subtarget->isTargetELF())
O << "\t.type " << name << ",%object\n";
- if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal()) {
+ if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal() &&
+ !(isDarwin &&
+ TAI->SectionKindForGlobal(GVar) == SectionKind::RODataMergeStr)) {
// FIXME: This seems to be pretty darwin-specific
if (GVar->hasExternalLinkage()) {
Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=64908&r1=64907&r2=64908&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Wed Feb 18 02:34:09 2009
@@ -915,7 +915,8 @@
if (C->isNullValue() && /* FIXME: Verify correct */
!GVar->hasSection() &&
(GVar->hasLocalLinkage() || GVar->hasExternalLinkage() ||
- GVar->mayBeOverridden())) {
+ GVar->mayBeOverridden()) &&
+ TAI->SectionKindForGlobal(GVar) != SectionKind::RODataMergeStr) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (GVar->hasExternalLinkage()) {
Modified: llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=64908&r1=64907&r2=64908&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Feb 18 02:34:09 2009
@@ -799,7 +799,9 @@
SwitchToSection(TAI->SectionForGlobal(GVar));
- if (C->isNullValue() && !GVar->hasSection()) {
+ if (C->isNullValue() && !GVar->hasSection() &&
+ !(Subtarget->isTargetDarwin() &&
+ TAI->SectionKindForGlobal(GVar) == SectionKind::RODataMergeStr)) {
// FIXME: This seems to be pretty darwin-specific
if (GVar->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
More information about the llvm-commits
mailing list