blob: d70ef6d9013d71eaa31b5bfeac6bdef4a85f5145 [file] [log] [blame]
Jim Laskey8e8de8f2006-09-07 22:05:02 +00001//===-- 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"
Evan Chenga8e29892007-01-19 07:51:42 +000015#include "ARMTargetMachine.h"
Jim Laskey8e8de8f2006-09-07 22:05:02 +000016using namespace llvm;
17
18ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
Evan Chenga8e29892007-01-19 07:51:42 +000019 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
Evan Cheng8e1185b2007-01-19 18:59:56 +000036 // 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
Evan Chenga8e29892007-01-19 07:51:42 +000043 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;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000064 Data64bitsDirective = 0;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000065 CommentString = "@";
Evan Chenga8e29892007-01-19 07:51:42 +000066 DataSection = "\t.data";
Jim Laskey8e8de8f2006-09-07 22:05:02 +000067 ConstantPoolSection = "\t.text\n";
Jim Laskey8e8de8f2006-09-07 22:05:02 +000068}