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