1 //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the DarwinTargetAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "PPCTargetAsmInfo.h"
15 #include "PPCTargetMachine.h"
16 #include "llvm/Function.h"
17 #include "llvm/Support/Dwarf.h"
20 using namespace llvm::dwarf;
22 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) :
23 PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
26 UsedDirective = "\t.no_dead_strip\t";
27 SupportsExceptionHandling = true;
30 ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
31 DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
32 GlobalEHDirective = "\t.globl\t";
33 SupportsWeakOmittedEHFrame = false;
36 const char *PPCDarwinTargetAsmInfo::getEHGlobalPrefix() const {
37 const PPCSubtarget* Subtarget = &TM.getSubtarget<PPCSubtarget>();
38 if (Subtarget->getDarwinVers() > 9)
39 return PrivateGlobalPrefix;
43 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
44 PPCTargetAsmInfo<ELFTargetAsmInfo>(TM) {
47 PrivateGlobalPrefix = ".L";
48 UsedDirective = "\t# .no_dead_strip\t";
49 WeakRefDirective = "\t.weak\t";
52 AbsoluteDebugSectionOffsets = true;
53 SupportsDebugInformation = true;
54 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
55 DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
56 DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
57 DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
58 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
59 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
60 DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
61 DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
62 DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
63 DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
64 DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
68 // Set up DWARF directives
69 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
71 // Exceptions handling
72 if (!TM.getSubtargetImpl()->isPPC64())
73 SupportsExceptionHandling = true;
74 AbsoluteEHSectionOffsets = false;
75 DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\",@progbits";
76 DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\",@progbits";
80 // Instantiate default implementation.
81 TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);