blob: dfb78e8db9a3b40af65c3db07e20bdb815058adf [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>();
Evan Chenge433ea92007-01-19 19:23:47 +000020 if (Subtarget->isTargetDarwin()) {
Evan Chenga8e29892007-01-19 07:51:42 +000021 GlobalPrefix = "_";
Evan Chenge433ea92007-01-19 19:23:47 +000022 PrivateGlobalPrefix = "L";
23 BSSSection = 0; // no BSS section.
24 ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
Evan Chenga8e29892007-01-19 07:51:42 +000025 SetDirective = "\t.set";
26 WeakRefDirective = "\t.weak_reference\t";
Evan Chenga6f567c2007-01-23 19:06:03 +000027 HiddenDirective = "\t.private_extern\t";
Evan Chenga8e29892007-01-19 07:51:42 +000028 JumpTableDataSection = ".const";
29 CStringSection = "\t.cstring";
Evan Cheng98ded762007-03-08 01:25:25 +000030 FourByteConstantSection = "\t.literal4\n";
31 EightByteConstantSection = "\t.literal8\n";
32 ReadOnlySection = "\t.const\n";
Evan Chenge433ea92007-01-19 19:23:47 +000033 HasDotTypeDotSizeDirective = false;
Evan Chengb267ca12007-01-30 08:04:53 +000034 if (TM.getRelocationModel() == Reloc::Static) {
35 StaticCtorsSection = ".constructor";
36 StaticDtorsSection = ".destructor";
37 } else {
38 StaticCtorsSection = ".mod_init_func";
39 StaticDtorsSection = ".mod_term_func";
40 }
Evan Chenga8e29892007-01-19 07:51:42 +000041
Evan Cheng8e1185b2007-01-19 18:59:56 +000042 // 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
Evan Chenga8e29892007-01-19 07:51:42 +000049 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 {
Lauro Ramos Venancioc33f6742007-02-01 21:43:53 +000062 PrivateGlobalPrefix = ".L";
Evan Chenga8e29892007-01-19 07:51:42 +000063 WeakRefDirective = "\t.weak\t";
Lauro Ramos Venancio6d7dd8e2007-03-05 17:59:58 +000064 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 }
Evan Chenga8e29892007-01-19 07:51:42 +000071 }
Lauro Ramos Venancioea9fc582007-01-26 23:24:43 +000072
73 ZeroDirective = "\t.space\t";
74 AlignmentIsInBytes = false;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000075 Data64bitsDirective = 0;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000076 CommentString = "@";
Evan Chenga8e29892007-01-19 07:51:42 +000077 DataSection = "\t.data";
Jim Laskey8e8de8f2006-09-07 22:05:02 +000078 ConstantPoolSection = "\t.text\n";
Lauro Ramos Venancioea9fc582007-01-26 23:24:43 +000079 COMMDirectiveTakesAlignment = false;
80 InlineAsmStart = "@ InlineAsm Start";
81 InlineAsmEnd = "@ InlineAsm End";
82 LCOMMDirective = "\t.lcomm\t";
Jim Laskey8e8de8f2006-09-07 22:05:02 +000083}