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 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 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" |
Anton Korobeynikov | 7b1b7f5 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 17 | #include "llvm/Support/Dwarf.h" |
| 18 | |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 19 | using namespace llvm; |
Anton Korobeynikov | 7b1b7f5 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 20 | using namespace llvm::dwarf; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 21 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 22 | PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) { |
Jim Laskey | b82313f | 2007-02-01 16:31:34 +0000 | [diff] [blame] | 23 | PCSymbol = "."; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 24 | CommentString = ";"; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 25 | UsedDirective = "\t.no_dead_strip\t"; |
Jim Grosbach | 1b747ad | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 26 | ExceptionsType = ExceptionHandling::Dwarf; |
| 27 | |
Dale Johannesen | 038129d | 2008-01-10 02:03:30 +0000 | [diff] [blame] | 28 | GlobalEHDirective = "\t.globl\t"; |
| 29 | SupportsWeakOmittedEHFrame = false; |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 30 | |
| 31 | const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); |
| 32 | bool isPPC64 = Subtarget->isPPC64(); |
| 33 | |
Chris Lattner | e2811a7 | 2009-08-11 22:22:44 +0000 | [diff] [blame^] | 34 | if (!isPPC64) |
| 35 | Data64bitsDirective = 0; // we can't emit a 64-bit unit |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 36 | AlignmentIsInBytes = false; |
| 37 | LCOMMDirective = "\t.lcomm\t"; |
| 38 | InlineAsmStart = "# InlineAsm Start"; |
| 39 | InlineAsmEnd = "# InlineAsm End"; |
| 40 | AssemblerDialect = Subtarget->getAsmFlavor(); |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 41 | } |
| 42 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 43 | PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) { |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 44 | CommentString = "#"; |
| 45 | GlobalPrefix = ""; |
Rafael Espindola | 2f6fea9 | 2008-12-19 10:55:56 +0000 | [diff] [blame] | 46 | PrivateGlobalPrefix = ".L"; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 47 | UsedDirective = "\t# .no_dead_strip\t"; |
| 48 | WeakRefDirective = "\t.weak\t"; |
Nick Lewycky | e2b9052 | 2007-07-25 03:48:45 +0000 | [diff] [blame] | 49 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 50 | // Debug Information |
| 51 | AbsoluteDebugSectionOffsets = true; |
| 52 | SupportsDebugInformation = true; |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 53 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 54 | PCSymbol = "."; |
| 55 | |
| 56 | // Set up DWARF directives |
| 57 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
| 58 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 59 | const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); |
| 60 | bool isPPC64 = Subtarget->isPPC64(); |
| 61 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 62 | // Exceptions handling |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 63 | if (!isPPC64) |
Jim Grosbach | 1b747ad | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 64 | ExceptionsType = ExceptionHandling::Dwarf; |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 65 | AbsoluteEHSectionOffsets = false; |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 66 | |
| 67 | ZeroDirective = "\t.space\t"; |
| 68 | SetDirective = "\t.set"; |
| 69 | Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; |
| 70 | AlignmentIsInBytes = false; |
| 71 | LCOMMDirective = "\t.lcomm\t"; |
| 72 | InlineAsmStart = "# InlineAsm Start"; |
| 73 | InlineAsmEnd = "# InlineAsm End"; |
| 74 | AssemblerDialect = Subtarget->getAsmFlavor(); |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 75 | } |
Anton Korobeynikov | 7b1b7f5 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 76 | |