mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-11 00:39:36 +00:00
use section flags more correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76944 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7da9559c52
commit
c440cc7f2c
@ -123,6 +123,8 @@ namespace llvm {
|
||||
|
||||
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
|
||||
|
@ -1103,9 +1103,8 @@ void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
|
||||
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";
|
||||
|
@ -897,7 +897,8 @@ void PPCDarwinAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
|
||||
!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()) {
|
||||
|
@ -798,9 +798,8 @@ void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
|
||||
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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user