blob: 6322a2e68fd937aa7f9235293272ec5b2a58f076 [file] [log] [blame]
Jim Laskey8e8de8f2006-09-07 22:05:02 +00001//===-- PPCTargetAsmInfo.cpp - PPC 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 DarwinTargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "PPCTargetAsmInfo.h"
15#include "PPCTargetMachine.h"
Chris Lattnerb56dcc42006-10-05 00:35:50 +000016#include "llvm/Function.h"
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000017#include "llvm/Support/Dwarf.h"
18
Jim Laskey8e8de8f2006-09-07 22:05:02 +000019using namespace llvm;
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000020using namespace llvm::dwarf;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000021
Chris Lattner4e0f25b2009-06-19 00:08:39 +000022PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) :
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000023 PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
Jim Laskeyb82313f2007-02-01 16:31:34 +000024 PCSymbol = ".";
Jim Laskeybf111822006-12-21 20:26:09 +000025 CommentString = ";";
Jim Laskeybf111822006-12-21 20:26:09 +000026 UsedDirective = "\t.no_dead_strip\t";
Dale Johannesen696f7682007-12-19 21:54:36 +000027 SupportsExceptionHandling = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000028
29 DwarfEHFrameSection =
Chris Lattner4e0f25b2009-06-19 00:08:39 +000030 ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
Dale Johannesen038129d2008-01-10 02:03:30 +000031 GlobalEHDirective = "\t.globl\t";
32 SupportsWeakOmittedEHFrame = false;
Jim Laskeybf111822006-12-21 20:26:09 +000033}
34
Anton Korobeynikov7396e592008-08-08 18:23:49 +000035PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000036 PPCTargetAsmInfo<ELFTargetAsmInfo>(TM) {
Jim Laskeybf111822006-12-21 20:26:09 +000037 CommentString = "#";
38 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000039 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000040 UsedDirective = "\t# .no_dead_strip\t";
41 WeakRefDirective = "\t.weak\t";
Nick Lewyckye2b90522007-07-25 03:48:45 +000042
Nicolas Geoffray616585b2007-12-21 12:19:44 +000043 // Debug Information
44 AbsoluteDebugSectionOffsets = true;
45 SupportsDebugInformation = true;
Nick Lewyckye2b90522007-07-25 03:48:45 +000046 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
47 DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
48 DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
49 DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
50 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
51 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
52 DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
53 DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
54 DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
55 DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
Chris Lattnerb839c3f2009-06-18 23:31:37 +000056 DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
Nicolas Geoffray616585b2007-12-21 12:19:44 +000057
Nicolas Geoffray616585b2007-12-21 12:19:44 +000058 PCSymbol = ".";
59
60 // Set up DWARF directives
61 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
62
63 // Exceptions handling
64 if (!TM.getSubtargetImpl()->isPPC64())
65 SupportsExceptionHandling = true;
66 AbsoluteEHSectionOffsets = false;
67 DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\",@progbits";
Jim Laskeybf111822006-12-21 20:26:09 +000068}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000069
Anton Korobeynikov6381a132008-10-05 08:53:29 +000070
71// Instantiate default implementation.
72TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);