blob: 5fd99ed003cc8dcbcbf5673cb5649bba9770609a [file] [log] [blame]
Jim Laskey8e8de8f2006-09-07 22:05:02 +00001//===-- SparcTargetAsmInfo.cpp - Sparc asm properties -----------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey8e8de8f2006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declarations of the SparcTargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "SparcTargetAsmInfo.h"
15
16using namespace llvm;
17
Anton Korobeynikov5b794b92008-08-07 09:51:25 +000018SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM):
19 ELFTargetAsmInfo(TM) {
Jim Laskey8e8de8f2006-09-07 22:05:02 +000020 Data16bitsDirective = "\t.half\t";
21 Data32bitsDirective = "\t.word\t";
22 Data64bitsDirective = 0; // .xword is only supported by V9.
23 ZeroDirective = "\t.skip\t";
24 CommentString = "!";
25 ConstantPoolSection = "\t.section \".rodata\",#alloc\n";
Anton Korobeynikov5b794b92008-08-07 09:51:25 +000026 COMMDirectiveTakesAlignment = true;
27}
28
29std::string SparcELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const {
30 std::string Flags = ",";
31
32 if (flags & SectionFlags::Mergeable)
33 return ELFTargetAsmInfo::PrintSectionFlags(flags);
34
35 if (!(flags & SectionFlags::Debug))
36 Flags += "#alloc";
37 if (flags & SectionFlags::Code)
38 Flags += "#execinstr";
39 if (flags & SectionFlags::Writeable)
40 Flags += "#write";
41 if (flags & SectionFlags::TLS)
42 Flags += "#tls";
43
44 return Flags;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000045}