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" |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 16 | using namespace llvm; |
| 17 | |
| 18 | ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) { |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 19 | const ARMSubtarget *Subtarget = &TM.getSubtarget<ARMSubtarget>(); |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 20 | if (Subtarget->isTargetDarwin()) { |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 21 | GlobalPrefix = "_"; |
| 22 | ZeroDirective = "\t.space\t"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 23 | PrivateGlobalPrefix = "L"; |
| 24 | BSSSection = 0; // no BSS section. |
| 25 | ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 26 | SetDirective = "\t.set"; |
| 27 | WeakRefDirective = "\t.weak_reference\t"; |
| 28 | JumpTableDataSection = ".const"; |
| 29 | CStringSection = "\t.cstring"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 30 | LCOMMDirective = "\t.lcomm\t"; |
| 31 | COMMDirectiveTakesAlignment = false; |
| 32 | HasDotTypeDotSizeDirective = false; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 33 | StaticCtorsSection = ".mod_init_func"; |
| 34 | StaticDtorsSection = ".mod_term_func"; |
| 35 | InlineAsmStart = "@ InlineAsm Start"; |
| 36 | InlineAsmEnd = "@ InlineAsm End"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 37 | |
Evan Cheng | 8e1185b | 2007-01-19 18:59:56 +0000 | [diff] [blame] | 38 | // In non-PIC modes, emit a special label before jump tables so that the |
| 39 | // linker can perform more accurate dead code stripping. |
| 40 | if (TM.getRelocationModel() != Reloc::PIC_) { |
| 41 | // Emit a local label that is preserved until the linker runs. |
| 42 | JumpTableSpecialLabelPrefix = "l"; |
| 43 | } |
| 44 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 45 | NeedsSet = true; |
| 46 | DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; |
| 47 | DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; |
| 48 | DwarfLineSection = ".section __DWARF,__debug_line,regular,debug"; |
| 49 | DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug"; |
| 50 | DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug"; |
| 51 | DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug"; |
| 52 | DwarfStrSection = ".section __DWARF,__debug_str,regular,debug"; |
| 53 | DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug"; |
| 54 | DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug"; |
| 55 | DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; |
| 56 | DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; |
| 57 | } else { |
| 58 | Data16bitsDirective = "\t.half\t"; |
| 59 | Data32bitsDirective = "\t.word\t"; |
| 60 | ZeroDirective = "\t.skip\t"; |
| 61 | WeakRefDirective = "\t.weak\t"; |
| 62 | StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits"; |
| 63 | StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits"; |
| 64 | } |
| 65 | AlignmentIsInBytes = false; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 66 | Data64bitsDirective = 0; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 67 | CommentString = "@"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 68 | DataSection = "\t.data"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 69 | ConstantPoolSection = "\t.text\n"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 70 | } |