Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 1 | //===-- PPCTargetAsmInfo.cpp - PPC 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 DarwinTargetAsmInfo properties. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "PPCTargetAsmInfo.h" |
| 15 | #include "PPCTargetMachine.h" |
Chris Lattner | b56dcc4 | 2006-10-05 00:35:50 +0000 | [diff] [blame] | 16 | #include "llvm/Function.h" |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 17 | using namespace llvm; |
| 18 | |
Bill Wendling | eb9a42c | 2007-01-16 03:42:04 +0000 | [diff] [blame] | 19 | // ASM variant to use. |
| 20 | enum { |
| 21 | PPC_OLD_MNEMONICS = 0, |
| 22 | PPC_NEW_MNEMONICS = 1 |
| 23 | }; |
| 24 | |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 25 | PPCTargetAsmInfo::PPCTargetAsmInfo(const PPCTargetMachine &TM) { |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 26 | bool isPPC64 = TM.getSubtargetImpl()->isPPC64(); |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 27 | |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 28 | ZeroDirective = "\t.space\t"; |
| 29 | SetDirective = "\t.set"; |
Jim Laskey | f45c25f | 2006-09-08 13:06:56 +0000 | [diff] [blame] | 30 | Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 31 | AlignmentIsInBytes = false; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 32 | LCOMMDirective = "\t.lcomm\t"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 33 | InlineAsmStart = "# InlineAsm Start"; |
| 34 | InlineAsmEnd = "# InlineAsm End"; |
Bill Wendling | eb9a42c | 2007-01-16 03:42:04 +0000 | [diff] [blame] | 35 | AssemblerDialect = PPC_OLD_MNEMONICS; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 36 | |
| 37 | NeedsSet = true; |
| 38 | AddressSize = isPPC64 ? 8 : 4; |
Jim Laskey | 5059dda | 2006-10-17 11:30:57 +0000 | [diff] [blame] | 39 | DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; |
| 40 | DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; |
| 41 | DwarfLineSection = ".section __DWARF,__debug_line,regular,debug"; |
| 42 | DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug"; |
| 43 | DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug"; |
| 44 | DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug"; |
| 45 | DwarfStrSection = ".section __DWARF,__debug_str,regular,debug"; |
| 46 | DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug"; |
| 47 | DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug"; |
| 48 | DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; |
| 49 | DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 50 | } |
Chris Lattner | b56dcc4 | 2006-10-05 00:35:50 +0000 | [diff] [blame] | 51 | |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 52 | DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) |
| 53 | : PPCTargetAsmInfo(TM) |
| 54 | { |
| 55 | CommentString = ";"; |
| 56 | GlobalPrefix = "_"; |
| 57 | PrivateGlobalPrefix = "L"; |
| 58 | ConstantPoolSection = "\t.const\t"; |
| 59 | JumpTableDataSection = ".const"; |
| 60 | CStringSection = "\t.cstring"; |
| 61 | StaticCtorsSection = ".mod_init_func"; |
| 62 | StaticDtorsSection = ".mod_term_func"; |
| 63 | UsedDirective = "\t.no_dead_strip\t"; |
| 64 | WeakRefDirective = "\t.weak_reference\t"; |
Chris Lattner | 70d4107 | 2007-01-14 06:37:54 +0000 | [diff] [blame] | 65 | HiddenDirective = "\t.private_extern\t"; |
Bill Wendling | eb9a42c | 2007-01-16 03:42:04 +0000 | [diff] [blame] | 66 | AssemblerDialect = PPC_NEW_MNEMONICS; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM) |
| 70 | : PPCTargetAsmInfo(TM) |
| 71 | { |
| 72 | CommentString = "#"; |
| 73 | GlobalPrefix = ""; |
| 74 | PrivateGlobalPrefix = ""; |
| 75 | ConstantPoolSection = "\t.section .rodata.cst4\t"; |
| 76 | JumpTableDataSection = ".section .rodata.cst4"; |
| 77 | CStringSection = "\t.section\t.rodata"; |
| 78 | StaticCtorsSection = ".section\t.ctors,\"aw\",@progbits"; |
| 79 | StaticDtorsSection = ".section\t.dtors,\"aw\",@progbits"; |
| 80 | UsedDirective = "\t# .no_dead_strip\t"; |
| 81 | WeakRefDirective = "\t.weak\t"; |
| 82 | } |