Scott Michel | 564427e | 2007-12-05 01:24:05 +0000 | [diff] [blame] | 1 | //===-- SPUTargetAsmInfo.cpp - Cell SPU 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. |
Scott Michel | 564427e | 2007-12-05 01:24:05 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the declarations of the SPUTargetAsmInfo properties. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "SPUTargetAsmInfo.h" |
| 15 | #include "SPUTargetMachine.h" |
| 16 | #include "llvm/Function.h" |
Scott Michel | d03eeaf | 2008-11-07 04:36:25 +0000 | [diff] [blame] | 17 | #include "llvm/Support/Compiler.h" |
Scott Michel | 9de57a9 | 2009-01-26 22:33:37 +0000 | [diff] [blame^] | 18 | #include "llvm/Support/Dwarf.h" |
Scott Michel | d03eeaf | 2008-11-07 04:36:25 +0000 | [diff] [blame] | 19 | |
Scott Michel | 564427e | 2007-12-05 01:24:05 +0000 | [diff] [blame] | 20 | using namespace llvm; |
Scott Michel | 9de57a9 | 2009-01-26 22:33:37 +0000 | [diff] [blame^] | 21 | using namespace llvm::dwarf; |
Scott Michel | 564427e | 2007-12-05 01:24:05 +0000 | [diff] [blame] | 22 | |
Scott Michel | d03eeaf | 2008-11-07 04:36:25 +0000 | [diff] [blame] | 23 | SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const SPUTargetMachine &TM) : |
| 24 | SPUTargetAsmInfo<ELFTargetAsmInfo>(TM) { |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 25 | PCSymbol = "."; |
Scott Michel | 564427e | 2007-12-05 01:24:05 +0000 | [diff] [blame] | 26 | CommentString = "#"; |
| 27 | GlobalPrefix = ""; |
| 28 | PrivateGlobalPrefix = ".L"; |
Scott Michel | 73655bc | 2008-11-08 18:59:02 +0000 | [diff] [blame] | 29 | // This corresponds to what the gcc SPU compiler emits, for consistency. |
| 30 | CStringSection = ".rodata.str"; |
Scott Michel | f0569be | 2008-12-27 04:51:36 +0000 | [diff] [blame] | 31 | |
Scott Michel | 9de57a9 | 2009-01-26 22:33:37 +0000 | [diff] [blame^] | 32 | // Has leb128, .loc and .file |
| 33 | HasLEB128 = true; |
| 34 | HasDotLocAndDotFile = true; |
| 35 | |
Scott Michel | f0569be | 2008-12-27 04:51:36 +0000 | [diff] [blame] | 36 | // BSS section needs to be emitted as ".section" |
| 37 | BSSSection = "\t.section\t.bss"; |
| 38 | BSSSection_ = getUnnamedSection("\t.section\t.bss", |
| 39 | SectionFlags::Writeable | SectionFlags::BSS, |
| 40 | true); |
| 41 | |
Scott Michel | 9de57a9 | 2009-01-26 22:33:37 +0000 | [diff] [blame^] | 42 | SupportsDebugInformation = true; |
| 43 | NeedsSet = true; |
| 44 | SupportsMacInfoSection = false; |
| 45 | DwarfAbbrevSection = "\t.section .debug_abbrev,\"\",@progbits"; |
| 46 | DwarfInfoSection = "\t.section .debug_info,\"\",@progbits"; |
| 47 | DwarfLineSection = "\t.section .debug_line,\"\",@progbits"; |
| 48 | DwarfFrameSection = "\t.section .debug_frame,\"\",@progbits"; |
| 49 | DwarfPubNamesSection = "\t.section .debug_pubnames,\"\",@progbits"; |
| 50 | DwarfPubTypesSection = "\t.section .debug_pubtypes,\"\",progbits"; |
| 51 | DwarfStrSection = "\t.section .debug_str,\"MS\",@progbits,1"; |
| 52 | DwarfLocSection = "\t.section .debug_loc,\"\",@progbits"; |
| 53 | DwarfARangesSection = "\t.section .debug_aranges,\"\",@progbits"; |
| 54 | DwarfRangesSection = "\t.section .debug_ranges,\"\",@progbits"; |
| 55 | DwarfMacInfoSection = "\t.section .debug_macinfo,\"\",progbits"; |
| 56 | |
| 57 | // Exception handling is not supported on CellSPU (think about it: you only |
| 58 | // have 256K for code+data. Would you support exception handling?) |
| 59 | SupportsExceptionHandling = false; |
Scott Michel | 564427e | 2007-12-05 01:24:05 +0000 | [diff] [blame] | 60 | } |
Scott Michel | d03eeaf | 2008-11-07 04:36:25 +0000 | [diff] [blame] | 61 | |
| 62 | /// PreferredEHDataFormat - This hook allows the target to select data |
| 63 | /// format used for encoding pointers in exception handling data. Reason is |
| 64 | /// 0 for data, 1 for code labels, 2 for function pointers. Global is true |
| 65 | /// if the symbol can be relocated. |
| 66 | unsigned |
| 67 | SPULinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 68 | bool Global) const { |
| 69 | // We really need to write something here. |
| 70 | return TargetAsmInfo::PreferredEHDataFormat(Reason, Global); |
| 71 | } |
| 72 | |
| 73 | // Instantiate default implementation. |
| 74 | TEMPLATE_INSTANTIATION(class SPUTargetAsmInfo<TargetAsmInfo>); |