2006-09-07 22:05:02 +00:00
|
|
|
//===-- SparcTargetAsmInfo.cpp - Sparc asm properties -----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-09-07 22:05:02 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the declarations of the SparcTargetAsmInfo properties.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "SparcTargetAsmInfo.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2008-08-07 09:51:25 +00:00
|
|
|
SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM):
|
|
|
|
ELFTargetAsmInfo(TM) {
|
2006-09-07 22:05:02 +00:00
|
|
|
Data16bitsDirective = "\t.half\t";
|
|
|
|
Data32bitsDirective = "\t.word\t";
|
|
|
|
Data64bitsDirective = 0; // .xword is only supported by V9.
|
|
|
|
ZeroDirective = "\t.skip\t";
|
|
|
|
CommentString = "!";
|
|
|
|
ConstantPoolSection = "\t.section \".rodata\",#alloc\n";
|
2008-08-07 09:51:25 +00:00
|
|
|
COMMDirectiveTakesAlignment = true;
|
2008-08-08 18:25:29 +00:00
|
|
|
CStringSection=".rodata.str";
|
2008-08-16 12:58:12 +00:00
|
|
|
|
|
|
|
// Sparc normally uses named section for BSS.
|
|
|
|
BSSSection_ = getNamedSection("\t.bss",
|
|
|
|
SectionFlags::Writeable | SectionFlags::BSS,
|
|
|
|
/* Override */ true);
|
2008-08-07 09:51:25 +00:00
|
|
|
}
|
|
|
|
|
2008-08-16 12:57:07 +00:00
|
|
|
std::string SparcELFTargetAsmInfo::printSectionFlags(unsigned flags) const {
|
2008-08-07 09:51:25 +00:00
|
|
|
if (flags & SectionFlags::Mergeable)
|
2008-08-16 12:57:07 +00:00
|
|
|
return ELFTargetAsmInfo::printSectionFlags(flags);
|
2008-08-07 09:51:25 +00:00
|
|
|
|
2008-08-08 18:26:10 +00:00
|
|
|
std::string Flags;
|
2008-08-07 09:51:25 +00:00
|
|
|
if (!(flags & SectionFlags::Debug))
|
2008-08-08 18:26:10 +00:00
|
|
|
Flags += ",#alloc";
|
2008-08-07 09:51:25 +00:00
|
|
|
if (flags & SectionFlags::Code)
|
2008-08-08 18:26:10 +00:00
|
|
|
Flags += ",#execinstr";
|
2008-08-07 09:51:25 +00:00
|
|
|
if (flags & SectionFlags::Writeable)
|
2008-08-08 18:26:10 +00:00
|
|
|
Flags += ",#write";
|
2008-08-07 09:51:25 +00:00
|
|
|
if (flags & SectionFlags::TLS)
|
2008-08-08 18:26:10 +00:00
|
|
|
Flags += ",#tls";
|
2008-08-07 09:51:25 +00:00
|
|
|
|
|
|
|
return Flags;
|
2006-09-07 22:05:02 +00:00
|
|
|
}
|