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 = "_"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 22 | PrivateGlobalPrefix = "L"; |
| 23 | BSSSection = 0; // no BSS section. |
| 24 | ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 25 | SetDirective = "\t.set"; |
| 26 | WeakRefDirective = "\t.weak_reference\t"; |
Evan Cheng | a6f567c | 2007-01-23 19:06:03 +0000 | [diff] [blame] | 27 | HiddenDirective = "\t.private_extern\t"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 28 | JumpTableDataSection = ".const"; |
| 29 | CStringSection = "\t.cstring"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 30 | HasDotTypeDotSizeDirective = false; |
Evan Cheng | b267ca1 | 2007-01-30 08:04:53 +0000 | [diff] [blame] | 31 | 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 Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 38 | |
Evan Cheng | 8e1185b | 2007-01-19 18:59:56 +0000 | [diff] [blame] | 39 | // 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 Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 46 | 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 { |
Lauro Ramos Venancio | c33f674 | 2007-02-01 21:43:53 +0000 | [diff] [blame] | 59 | PrivateGlobalPrefix = ".L"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 60 | WeakRefDirective = "\t.weak\t"; |
| 61 | StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits"; |
| 62 | StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits"; |
| 63 | } |
Lauro Ramos Venancio | ea9fc58 | 2007-01-26 23:24:43 +0000 | [diff] [blame] | 64 | |
| 65 | ZeroDirective = "\t.space\t"; |
| 66 | AlignmentIsInBytes = false; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 67 | Data64bitsDirective = 0; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 68 | CommentString = "@"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 69 | DataSection = "\t.data"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 70 | ConstantPoolSection = "\t.text\n"; |
Lauro Ramos Venancio | ea9fc58 | 2007-01-26 23:24:43 +0000 | [diff] [blame] | 71 | COMMDirectiveTakesAlignment = false; |
| 72 | InlineAsmStart = "@ InlineAsm Start"; |
| 73 | InlineAsmEnd = "@ InlineAsm End"; |
| 74 | LCOMMDirective = "\t.lcomm\t"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 75 | } |