blob: 56da6d9f05ae90e24c46c6ac5c11abce263a6fdd [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 Chenge433ea92007-01-19 19:23:47 +000030 HasDotTypeDotSizeDirective = false;
Evan Chengb267ca12007-01-30 08:04:53 +000031 if (TM.getRelocationModel() == Reloc::Static) {
32 StaticCtorsSection = ".constructor";
33 StaticDtorsSection = ".destructor";
34 } else {
35 StaticCtorsSection = ".mod_init_func";
36 StaticDtorsSection = ".mod_term_func";
37 }
Evan Chenga8e29892007-01-19 07:51:42 +000038
Evan Cheng8e1185b2007-01-19 18:59:56 +000039 // In non-PIC modes, emit a special label before jump tables so that the
40 // linker can perform more accurate dead code stripping.
41 if (TM.getRelocationModel() != Reloc::PIC_) {
42 // Emit a local label that is preserved until the linker runs.
43 JumpTableSpecialLabelPrefix = "l";
44 }
45
Evan Chenga8e29892007-01-19 07:51:42 +000046 NeedsSet = true;
47 DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
48 DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
49 DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
50 DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
51 DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
52 DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
53 DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
54 DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
55 DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
56 DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
57 DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
58 } else {
Evan Chenga8e29892007-01-19 07:51:42 +000059 WeakRefDirective = "\t.weak\t";
60 StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
61 StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
62 }
Lauro Ramos Venancioea9fc582007-01-26 23:24:43 +000063
64 ZeroDirective = "\t.space\t";
65 AlignmentIsInBytes = false;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000066 Data64bitsDirective = 0;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000067 CommentString = "@";
Evan Chenga8e29892007-01-19 07:51:42 +000068 DataSection = "\t.data";
Jim Laskey8e8de8f2006-09-07 22:05:02 +000069 ConstantPoolSection = "\t.text\n";
Lauro Ramos Venancioea9fc582007-01-26 23:24:43 +000070 COMMDirectiveTakesAlignment = false;
71 InlineAsmStart = "@ InlineAsm Start";
72 InlineAsmEnd = "@ InlineAsm End";
73 LCOMMDirective = "\t.lcomm\t";
Jim Laskey8e8de8f2006-09-07 22:05:02 +000074}