Modify emission of jump tables on darwin to emit an extra "l" label that
[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->isDarwin()) {
21     HasDotTypeDotSizeDirective = false;
22     PrivateGlobalPrefix = "L";
23     GlobalPrefix = "_";
24     ZeroDirective = "\t.space\t";
25     SetDirective = "\t.set";
26     WeakRefDirective = "\t.weak_reference\t";
27     JumpTableDataSection = ".const";
28     CStringSection = "\t.cstring";
29     StaticCtorsSection = ".mod_init_func";
30     StaticDtorsSection = ".mod_term_func";
31     InlineAsmStart = "@ InlineAsm Start";
32     InlineAsmEnd = "@ InlineAsm End";
33     LCOMMDirective = "\t.lcomm\t";
34     COMMDirectiveTakesAlignment = false;
35     
36     // In non-PIC modes, emit a special label before jump tables so that the
37     // linker can perform more accurate dead code stripping.
38     if (TM.getRelocationModel() != Reloc::PIC_) {
39       // Emit a local label that is preserved until the linker runs.
40       JumpTableSpecialLabelPrefix = "l";
41     }
42     
43     NeedsSet = true;
44     DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
45     DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
46     DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
47     DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
48     DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
49     DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
50     DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
51     DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
52     DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
53     DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
54     DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
55   } else {
56     Data16bitsDirective = "\t.half\t";
57     Data32bitsDirective = "\t.word\t";
58     ZeroDirective = "\t.skip\t";
59     WeakRefDirective = "\t.weak\t";
60     StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
61     StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
62   }
63   AlignmentIsInBytes = false; 
64   Data64bitsDirective = 0;
65   CommentString = "@";
66   DataSection = "\t.data";
67   ConstantPoolSection = "\t.text\n";
68 }