1 //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by James M. Laskey and is distributed under the
6 // University of Illinois Open Source 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"
19 PPCTargetAsmInfo::PPCTargetAsmInfo(const PPCTargetMachine &TM) {
20 bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
22 ZeroDirective = "\t.space\t";
23 SetDirective = "\t.set";
24 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
25 AlignmentIsInBytes = false;
26 LCOMMDirective = "\t.lcomm\t";
27 InlineAsmStart = "# InlineAsm Start";
28 InlineAsmEnd = "# InlineAsm End";
29 AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor();
33 ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
34 DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
37 DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
38 : PPCTargetAsmInfo(TM)
43 PrivateGlobalPrefix = "L";
44 ConstantPoolSection = "\t.const\t";
45 JumpTableDataSection = ".const";
46 GlobalDirective = "\t.globl\t";
47 CStringSection = "\t.cstring";
48 FourByteConstantSection = "\t.literal4\n";
49 EightByteConstantSection = "\t.literal8\n";
50 ReadOnlySection = "\t.const\n";
51 if (TM.getRelocationModel() == Reloc::Static) {
52 StaticCtorsSection = ".constructor";
53 StaticDtorsSection = ".destructor";
55 StaticCtorsSection = ".mod_init_func";
56 StaticDtorsSection = ".mod_term_func";
58 UsedDirective = "\t.no_dead_strip\t";
59 WeakRefDirective = "\t.weak_reference\t";
60 HiddenDirective = "\t.private_extern\t";
61 SupportsExceptionHandling = false;
62 NeedsIndirectEncoding = true;
64 DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
65 DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
66 DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
67 DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
68 DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
69 DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
70 DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
71 DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
72 DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
73 DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
74 DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
76 // In non-PIC modes, emit a special label before jump tables so that the
77 // linker can perform more accurate dead code stripping.
78 if (TM.getRelocationModel() != Reloc::PIC_) {
79 // Emit a local label that is preserved until the linker runs.
80 JumpTableSpecialLabelPrefix = "l";
84 LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM)
85 : PPCTargetAsmInfo(TM)
89 PrivateGlobalPrefix = "";
90 ConstantPoolSection = "\t.section .rodata.cst4\t";
91 JumpTableDataSection = ".section .rodata.cst4";
92 CStringSection = "\t.section\t.rodata";
93 StaticCtorsSection = ".section\t.ctors,\"aw\",@progbits";
94 StaticDtorsSection = ".section\t.dtors,\"aw\",@progbits";
95 UsedDirective = "\t# .no_dead_strip\t";
96 WeakRefDirective = "\t.weak\t";
98 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
99 DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
100 DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
101 DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
102 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
103 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
104 DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
105 DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
106 DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
107 DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
108 DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";