blob: 2868ff7592c24aaf2d569f06e7fd1ea669468396 [file] [log] [blame]
Scott Michel564427e2007-12-05 01:24:05 +00001//===-- SPUTargetAsmInfo.cpp - Cell SPU 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.
Scott Michel564427e2007-12-05 01:24:05 +00007//
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 Micheld03eeaf2008-11-07 04:36:25 +000017#include "llvm/Support/Compiler.h"
Scott Michel9de57a92009-01-26 22:33:37 +000018#include "llvm/Support/Dwarf.h"
Scott Micheld03eeaf2008-11-07 04:36:25 +000019
Scott Michel564427e2007-12-05 01:24:05 +000020using namespace llvm;
Scott Michel9de57a92009-01-26 22:33:37 +000021using namespace llvm::dwarf;
Scott Michel564427e2007-12-05 01:24:05 +000022
Scott Micheld03eeaf2008-11-07 04:36:25 +000023SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const SPUTargetMachine &TM) :
24 SPUTargetAsmInfo<ELFTargetAsmInfo>(TM) {
Scott Michel053c1da2008-01-29 02:16:57 +000025 PCSymbol = ".";
Scott Michel564427e2007-12-05 01:24:05 +000026 CommentString = "#";
27 GlobalPrefix = "";
28 PrivateGlobalPrefix = ".L";
Scott Michel73655bc2008-11-08 18:59:02 +000029 // This corresponds to what the gcc SPU compiler emits, for consistency.
30 CStringSection = ".rodata.str";
Scott Michelf0569be2008-12-27 04:51:36 +000031
Scott Michel9de57a92009-01-26 22:33:37 +000032 // Has leb128, .loc and .file
33 HasLEB128 = true;
34 HasDotLocAndDotFile = true;
35
Scott Michelf0569be2008-12-27 04:51:36 +000036 // 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 Michel9de57a92009-01-26 22:33:37 +000042 SupportsDebugInformation = true;
43 NeedsSet = true;
Scott Michel9de57a92009-01-26 22:33:37 +000044 DwarfAbbrevSection = "\t.section .debug_abbrev,\"\",@progbits";
45 DwarfInfoSection = "\t.section .debug_info,\"\",@progbits";
46 DwarfLineSection = "\t.section .debug_line,\"\",@progbits";
47 DwarfFrameSection = "\t.section .debug_frame,\"\",@progbits";
48 DwarfPubNamesSection = "\t.section .debug_pubnames,\"\",@progbits";
49 DwarfPubTypesSection = "\t.section .debug_pubtypes,\"\",progbits";
50 DwarfStrSection = "\t.section .debug_str,\"MS\",@progbits,1";
51 DwarfLocSection = "\t.section .debug_loc,\"\",@progbits";
52 DwarfARangesSection = "\t.section .debug_aranges,\"\",@progbits";
53 DwarfRangesSection = "\t.section .debug_ranges,\"\",@progbits";
Chris Lattnerb839c3f2009-06-18 23:31:37 +000054 DwarfMacroInfoSection = 0; // macro info not supported.
Scott Michel9de57a92009-01-26 22:33:37 +000055
56 // Exception handling is not supported on CellSPU (think about it: you only
57 // have 256K for code+data. Would you support exception handling?)
58 SupportsExceptionHandling = false;
Scott Michel564427e2007-12-05 01:24:05 +000059}
Scott Micheld03eeaf2008-11-07 04:36:25 +000060
61/// PreferredEHDataFormat - This hook allows the target to select data
62/// format used for encoding pointers in exception handling data. Reason is
63/// 0 for data, 1 for code labels, 2 for function pointers. Global is true
64/// if the symbol can be relocated.
65unsigned
66SPULinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
67 bool Global) const {
68 // We really need to write something here.
69 return TargetAsmInfo::PreferredEHDataFormat(Reason, Global);
70}
71
72// Instantiate default implementation.
73TEMPLATE_INSTANTIATION(class SPUTargetAsmInfo<TargetAsmInfo>);