[llvm-commits] [llvm] r76944 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Thu Jul 23 21:08:17 PDT 2009
Author: lattner
Date: Thu Jul 23 23:08:17 2009
New Revision: 76944
URL: http://llvm.org/viewvc/llvm-project?rev=76944&view=rev
Log:
use section flags more correctly.
Modified:
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=76944&r1=76943&r2=76944&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Thu Jul 23 23:08:17 2009
@@ -123,6 +123,8 @@
const std::string& getName() const { return Name; }
unsigned getFlags() const { return Flags; }
+
+ bool hasFlag(unsigned F) const { return (Flags & F) != 0; }
};
/// TargetAsmInfo - This class is intended to be used as a base class for asm
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=76944&r1=76943&r2=76944&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Thu Jul 23 23:08:17 2009
@@ -1103,9 +1103,8 @@
SwitchToSection(TheSection);
if (C->isNullValue() && !GVar->hasSection() && !GVar->isThreadLocal() &&
- !(isDarwin && TheSection->getFlags() == SectionKind::RODataMergeStr)) {
- // FIXME: This seems to be pretty darwin-specific
-
+ // Don't put things that should go in the cstring section into "comm".
+ !TheSection->hasFlag(SectionFlags::Strings)) {
if (GVar->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
O << "\t.globl\t" << name << "\n";
Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=76944&r1=76943&r2=76944&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Thu Jul 23 23:08:17 2009
@@ -897,7 +897,8 @@
!GVar->hasSection() &&
(GVar->hasLocalLinkage() || GVar->hasExternalLinkage() ||
GVar->isWeakForLinker()) &&
- TheSection->getFlags() != SectionKind::RODataMergeStr) {
+ // Don't put things that should go in the cstring section into "comm".
+ !TheSection->hasFlag(SectionFlags::Strings)) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (GVar->hasExternalLinkage()) {
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=76944&r1=76943&r2=76944&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Thu Jul 23 23:08:17 2009
@@ -798,9 +798,8 @@
SwitchToSection(TheSection);
if (C->isNullValue() && !GVar->hasSection() &&
- !(Subtarget->isTargetDarwin() &&
- TAI->SectionKindForGlobal(GVar) == SectionKind::RODataMergeStr)) {
- // FIXME: This seems to be pretty darwin-specific
+ // Don't put things that should go in the cstring section into "comm".
+ !TheSection->hasFlag(SectionFlags::Strings)) {
if (GVar->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
O << "\t.globl " << name << '\n';
More information about the llvm-commits
mailing list