Specify S registers as D registers' sub-registers.
[oota-llvm.git] / lib / Target / ARM / ARMTargetAsmInfo.cpp
1 //===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the ARMTargetAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "ARMTargetAsmInfo.h"
15 #include "ARMTargetMachine.h"
16 using namespace llvm;
17
18 ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
19   const ARMSubtarget *Subtarget = &TM.getSubtarget<ARMSubtarget>();
20   if (Subtarget->isTargetDarwin()) {
21     GlobalPrefix = "_";
22     PrivateGlobalPrefix = "L";
23     BSSSection = 0;                       // no BSS section.
24     ZeroFillDirective = "\t.zerofill\t";  // Uses .zerofill
25     SetDirective = "\t.set";
26     WeakRefDirective = "\t.weak_reference\t";
27     HiddenDirective = "\t.private_extern\t";
28     JumpTableDataSection = ".const";
29     CStringSection = "\t.cstring";
30     FourByteConstantSection = "\t.literal4\n";
31     EightByteConstantSection = "\t.literal8\n";
32     ReadOnlySection = "\t.const\n";
33     HasDotTypeDotSizeDirective = false;
34     if (TM.getRelocationModel() == Reloc::Static) {
35       StaticCtorsSection = ".constructor";
36       StaticDtorsSection = ".destructor";
37     } else {
38       StaticCtorsSection = ".mod_init_func";
39       StaticDtorsSection = ".mod_term_func";
40     }
41     
42     // In non-PIC modes, emit a special label before jump tables so that the
43     // linker can perform more accurate dead code stripping.
44     if (TM.getRelocationModel() != Reloc::PIC_) {
45       // Emit a local label that is preserved until the linker runs.
46       JumpTableSpecialLabelPrefix = "l";
47     }
48     
49     NeedsSet = true;
50     DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
51     DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
52     DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
53     DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
54     DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
55     DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
56     DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
57     DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
58     DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
59     DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
60     DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
61   } else {
62     PrivateGlobalPrefix = ".L";
63     WeakRefDirective = "\t.weak\t";
64     if (Subtarget->isAAPCS_ABI()) {
65       StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array";
66       StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array";
67     } else {
68       StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
69       StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
70     }
71   }
72
73   ZeroDirective = "\t.space\t";
74   AlignmentIsInBytes = false;
75   Data64bitsDirective = 0;
76   CommentString = "@";
77   DataSection = "\t.data";
78   ConstantPoolSection = "\t.text\n";
79   COMMDirectiveTakesAlignment = false;
80   InlineAsmStart = "@ InlineAsm Start";
81   InlineAsmEnd = "@ InlineAsm End";
82   LCOMMDirective = "\t.lcomm\t";
83 }