Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 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" |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 15 | #include "ARMTargetMachine.h" |
Dale Johannesen | 24fb52d | 2007-04-23 20:04:35 +0000 | [diff] [blame] | 16 | #include <cstring> |
| 17 | #include <cctype> |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 18 | using namespace llvm; |
| 19 | |
| 20 | ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) { |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 21 | const ARMSubtarget *Subtarget = &TM.getSubtarget<ARMSubtarget>(); |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 22 | if (Subtarget->isTargetDarwin()) { |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 23 | GlobalPrefix = "_"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 24 | PrivateGlobalPrefix = "L"; |
| 25 | BSSSection = 0; // no BSS section. |
| 26 | ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 27 | SetDirective = "\t.set"; |
| 28 | WeakRefDirective = "\t.weak_reference\t"; |
Evan Cheng | a6f567c | 2007-01-23 19:06:03 +0000 | [diff] [blame] | 29 | HiddenDirective = "\t.private_extern\t"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 30 | JumpTableDataSection = ".const"; |
| 31 | CStringSection = "\t.cstring"; |
Evan Cheng | 98ded76 | 2007-03-08 01:25:25 +0000 | [diff] [blame] | 32 | FourByteConstantSection = "\t.literal4\n"; |
| 33 | EightByteConstantSection = "\t.literal8\n"; |
| 34 | ReadOnlySection = "\t.const\n"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 35 | HasDotTypeDotSizeDirective = false; |
Evan Cheng | b267ca1 | 2007-01-30 08:04:53 +0000 | [diff] [blame] | 36 | if (TM.getRelocationModel() == Reloc::Static) { |
| 37 | StaticCtorsSection = ".constructor"; |
| 38 | StaticDtorsSection = ".destructor"; |
| 39 | } else { |
| 40 | StaticCtorsSection = ".mod_init_func"; |
| 41 | StaticDtorsSection = ".mod_term_func"; |
| 42 | } |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 43 | |
Evan Cheng | 8e1185b | 2007-01-19 18:59:56 +0000 | [diff] [blame] | 44 | // In non-PIC modes, emit a special label before jump tables so that the |
| 45 | // linker can perform more accurate dead code stripping. |
| 46 | if (TM.getRelocationModel() != Reloc::PIC_) { |
| 47 | // Emit a local label that is preserved until the linker runs. |
| 48 | JumpTableSpecialLabelPrefix = "l"; |
| 49 | } |
| 50 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 51 | NeedsSet = true; |
| 52 | DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; |
| 53 | DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; |
| 54 | DwarfLineSection = ".section __DWARF,__debug_line,regular,debug"; |
| 55 | DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug"; |
| 56 | DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug"; |
| 57 | DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug"; |
| 58 | DwarfStrSection = ".section __DWARF,__debug_str,regular,debug"; |
| 59 | DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug"; |
| 60 | DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug"; |
| 61 | DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; |
| 62 | DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; |
| 63 | } else { |
Lauro Ramos Venancio | c33f674 | 2007-02-01 21:43:53 +0000 | [diff] [blame] | 64 | PrivateGlobalPrefix = ".L"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 65 | WeakRefDirective = "\t.weak\t"; |
Lauro Ramos Venancio | 6d7dd8e | 2007-03-05 17:59:58 +0000 | [diff] [blame] | 66 | if (Subtarget->isAAPCS_ABI()) { |
| 67 | StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array"; |
| 68 | StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array"; |
| 69 | } else { |
| 70 | StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits"; |
| 71 | StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits"; |
| 72 | } |
Lauro Ramos Venancio | 64f4fa5 | 2007-04-27 13:54:47 +0000 | [diff] [blame^] | 73 | TLSDataSection = "\t.section .tdata,\"awT\",%progbits"; |
| 74 | TLSBSSSection = "\t.section .tbss,\"awT\",%nobits"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 75 | } |
Lauro Ramos Venancio | ea9fc58 | 2007-01-26 23:24:43 +0000 | [diff] [blame] | 76 | |
| 77 | ZeroDirective = "\t.space\t"; |
| 78 | AlignmentIsInBytes = false; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 79 | Data64bitsDirective = 0; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 80 | CommentString = "@"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 81 | DataSection = "\t.data"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 82 | ConstantPoolSection = "\t.text\n"; |
Lauro Ramos Venancio | ea9fc58 | 2007-01-26 23:24:43 +0000 | [diff] [blame] | 83 | COMMDirectiveTakesAlignment = false; |
| 84 | InlineAsmStart = "@ InlineAsm Start"; |
| 85 | InlineAsmEnd = "@ InlineAsm End"; |
| 86 | LCOMMDirective = "\t.lcomm\t"; |
Dale Johannesen | 24fb52d | 2007-04-23 20:04:35 +0000 | [diff] [blame] | 87 | isThumb = Subtarget->isThumb(); |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 88 | } |