LLVM API Documentation

SPUTargetAsmInfo.cpp

Go to the documentation of this file.
00001 //===-- SPUTargetAsmInfo.cpp - Cell SPU asm properties ----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the declarations of the SPUTargetAsmInfo properties.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "SPUTargetAsmInfo.h"
00015 #include "SPUTargetMachine.h"
00016 #include "llvm/Function.h"
00017 #include "llvm/Support/Compiler.h"
00018 #include "llvm/Support/Dwarf.h"
00019 
00020 using namespace llvm;
00021 using namespace llvm::dwarf;
00022 
00023 SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const SPUTargetMachine &TM) :
00024     SPUTargetAsmInfo<ELFTargetAsmInfo>(TM) {
00025   PCSymbol = ".";
00026   CommentString = "#";
00027   GlobalPrefix = "";
00028   PrivateGlobalPrefix = ".L";
00029   // This corresponds to what the gcc SPU compiler emits, for consistency.
00030   CStringSection = ".rodata.str";
00031 
00032   // Has leb128, .loc and .file
00033   HasLEB128 = true;
00034   HasDotLocAndDotFile = true;
00035 
00036   // BSS section needs to be emitted as ".section"
00037   BSSSection = "\t.section\t.bss";
00038   BSSSection_ = getUnnamedSection("\t.section\t.bss",
00039                                   SectionFlags::Writeable | SectionFlags::BSS,
00040                                   true);
00041 
00042   SupportsDebugInformation = true;
00043   NeedsSet = true;
00044   SupportsMacInfoSection = false;
00045   DwarfAbbrevSection =  "\t.section        .debug_abbrev,\"\",@progbits";
00046   DwarfInfoSection =    "\t.section        .debug_info,\"\",@progbits";
00047   DwarfLineSection =    "\t.section        .debug_line,\"\",@progbits";
00048   DwarfFrameSection =   "\t.section        .debug_frame,\"\",@progbits";
00049   DwarfPubNamesSection = "\t.section        .debug_pubnames,\"\",@progbits";
00050   DwarfPubTypesSection = "\t.section        .debug_pubtypes,\"\",progbits";
00051   DwarfStrSection =     "\t.section        .debug_str,\"MS\",@progbits,1";
00052   DwarfLocSection =     "\t.section        .debug_loc,\"\",@progbits";
00053   DwarfARangesSection = "\t.section        .debug_aranges,\"\",@progbits";
00054   DwarfRangesSection =  "\t.section        .debug_ranges,\"\",@progbits";
00055   DwarfMacInfoSection = "\t.section        .debug_macinfo,\"\",progbits";
00056 
00057   // Exception handling is not supported on CellSPU (think about it: you only
00058   // have 256K for code+data. Would you support exception handling?)
00059   SupportsExceptionHandling = false;
00060 }
00061 
00062 /// PreferredEHDataFormat - This hook allows the target to select data
00063 /// format used for encoding pointers in exception handling data. Reason is
00064 /// 0 for data, 1 for code labels, 2 for function pointers. Global is true
00065 /// if the symbol can be relocated.
00066 unsigned
00067 SPULinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
00068                                              bool Global) const {
00069   // We really need to write something here.
00070   return TargetAsmInfo::PreferredEHDataFormat(Reason, Global);
00071 }
00072 
00073 // Instantiate default implementation.
00074 TEMPLATE_INSTANTIATION(class SPUTargetAsmInfo<TargetAsmInfo>);