blob: e8b1824c3ed2d947474759053a6bdaab9d868e0c [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declarations of the DarwinTargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "PPCTargetAsmInfo.h"
15#include "PPCTargetMachine.h"
16#include "llvm/Function.h"
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000017#include "llvm/Support/Dwarf.h"
18
Dan Gohmanf17a25c2007-07-18 16:29:46 +000019using namespace llvm;
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000020using namespace llvm::dwarf;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021
Chris Lattnerca072172009-06-19 00:08:39 +000022PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) :
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000023 PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024 PCSymbol = ".";
25 CommentString = ";";
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026 UsedDirective = "\t.no_dead_strip\t";
Dale Johannesen15e8f532007-12-19 21:54:36 +000027 SupportsExceptionHandling = true;
Nicolas Geoffray61864762007-12-21 12:19:44 +000028
Dale Johannesenf09b5992008-01-10 02:03:30 +000029 GlobalEHDirective = "\t.globl\t";
30 SupportsWeakOmittedEHFrame = false;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000031}
32
Anton Korobeynikov894be4b2008-08-08 18:23:49 +000033PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
Chris Lattner7dd4ffc2009-08-02 04:27:24 +000034 PPCTargetAsmInfo<TargetAsmInfo>(TM) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000035 CommentString = "#";
36 GlobalPrefix = "";
Rafael Espindola1a931842008-12-19 10:55:56 +000037 PrivateGlobalPrefix = ".L";
Dan Gohmanf17a25c2007-07-18 16:29:46 +000038 UsedDirective = "\t# .no_dead_strip\t";
39 WeakRefDirective = "\t.weak\t";
Nick Lewycky3246a9c2007-07-25 03:48:45 +000040
Nicolas Geoffray61864762007-12-21 12:19:44 +000041 // Debug Information
42 AbsoluteDebugSectionOffsets = true;
43 SupportsDebugInformation = true;
Nick Lewycky3246a9c2007-07-25 03:48:45 +000044 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
45 DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
46 DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
47 DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
48 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
49 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
50 DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
51 DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
52 DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
53 DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
Chris Lattnerecbf73b2009-06-18 23:31:37 +000054 DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
Nicolas Geoffray61864762007-12-21 12:19:44 +000055
Nicolas Geoffray61864762007-12-21 12:19:44 +000056 PCSymbol = ".";
57
58 // Set up DWARF directives
59 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
60
61 // Exceptions handling
62 if (!TM.getSubtargetImpl()->isPPC64())
63 SupportsExceptionHandling = true;
64 AbsoluteEHSectionOffsets = false;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000065}
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000066
Anton Korobeynikov45d1b622008-10-05 08:53:29 +000067
68// Instantiate default implementation.
69TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);