| Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 1 | //===-- SparcTargetAsmInfo.cpp - Sparc asm properties -----------*- C++ -*-===// | 
|  | 2 | // | 
|  | 3 | //                     The LLVM Compiler Infrastructure | 
|  | 4 | // | 
| Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source | 
|  | 6 | // License. See LICENSE.TXT for details. | 
| Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 7 | // | 
|  | 8 | //===----------------------------------------------------------------------===// | 
|  | 9 | // | 
|  | 10 | // This file contains the declarations of the SparcTargetAsmInfo properties. | 
|  | 11 | // | 
|  | 12 | //===----------------------------------------------------------------------===// | 
|  | 13 |  | 
|  | 14 | #include "SparcTargetAsmInfo.h" | 
|  | 15 |  | 
|  | 16 | using namespace llvm; | 
|  | 17 |  | 
| Anton Korobeynikov | 5b794b9 | 2008-08-07 09:51:25 +0000 | [diff] [blame] | 18 | SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM): | 
|  | 19 | ELFTargetAsmInfo(TM) { | 
| Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 20 | 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 Korobeynikov | 5b794b9 | 2008-08-07 09:51:25 +0000 | [diff] [blame] | 26 | COMMDirectiveTakesAlignment = true; | 
| Anton Korobeynikov | 25c6a08 | 2008-08-08 18:25:29 +0000 | [diff] [blame^] | 27 | CStringSection=".rodata.str"; | 
| Anton Korobeynikov | 5b794b9 | 2008-08-07 09:51:25 +0000 | [diff] [blame] | 28 | } | 
|  | 29 |  | 
|  | 30 | std::string SparcELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { | 
|  | 31 | std::string Flags = ","; | 
|  | 32 |  | 
|  | 33 | if (flags & SectionFlags::Mergeable) | 
|  | 34 | return ELFTargetAsmInfo::PrintSectionFlags(flags); | 
|  | 35 |  | 
|  | 36 | if (!(flags & SectionFlags::Debug)) | 
|  | 37 | Flags += "#alloc"; | 
|  | 38 | if (flags & SectionFlags::Code) | 
|  | 39 | Flags += "#execinstr"; | 
|  | 40 | if (flags & SectionFlags::Writeable) | 
|  | 41 | Flags += "#write"; | 
|  | 42 | if (flags & SectionFlags::TLS) | 
|  | 43 | Flags += "#tls"; | 
|  | 44 |  | 
|  | 45 | return Flags; | 
| Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 46 | } |