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" |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/Triple.h" |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 16 | using namespace llvm; |
| 17 | |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 18 | PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple) |
| 19 | : DarwinTargetAsmInfo(TheTriple) { |
Jim Laskey | b82313f | 2007-02-01 16:31:34 +0000 | [diff] [blame] | 20 | PCSymbol = "."; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 21 | CommentString = ";"; |
Jim Grosbach | 1b747ad | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 22 | ExceptionsType = ExceptionHandling::Dwarf; |
| 23 | |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 24 | if (TheTriple.getArch() != Triple::ppc64) |
Chris Lattner | 74da671 | 2009-08-11 22:49:34 +0000 | [diff] [blame] | 25 | Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. |
Chris Lattner | 6b883e3 | 2009-08-11 23:03:40 +0000 | [diff] [blame] | 26 | AssemblerDialect = 1; // New-Style mnemonics. |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 27 | } |
| 28 | |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 29 | PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const Triple &TheTriple) { |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 30 | CommentString = "#"; |
| 31 | GlobalPrefix = ""; |
Rafael Espindola | 2f6fea9 | 2008-12-19 10:55:56 +0000 | [diff] [blame] | 32 | PrivateGlobalPrefix = ".L"; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 33 | UsedDirective = "\t# .no_dead_strip\t"; |
| 34 | WeakRefDirective = "\t.weak\t"; |
Nick Lewycky | e2b9052 | 2007-07-25 03:48:45 +0000 | [diff] [blame] | 35 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 36 | // Debug Information |
| 37 | AbsoluteDebugSectionOffsets = true; |
| 38 | SupportsDebugInformation = true; |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 39 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 40 | PCSymbol = "."; |
| 41 | |
| 42 | // Set up DWARF directives |
| 43 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
| 44 | |
| 45 | // Exceptions handling |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 46 | if (TheTriple.getArch() != Triple::ppc64) { |
Jim Grosbach | 1b747ad | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 47 | ExceptionsType = ExceptionHandling::Dwarf; |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 48 | Data64bitsDirective = 0; |
| 49 | } |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 50 | AbsoluteEHSectionOffsets = false; |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 51 | |
| 52 | ZeroDirective = "\t.space\t"; |
| 53 | SetDirective = "\t.set"; |
Chris Lattner | b2d3169 | 2009-08-13 05:30:22 +0000 | [diff] [blame] | 54 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 55 | AlignmentIsInBytes = false; |
| 56 | LCOMMDirective = "\t.lcomm\t"; |
Chris Lattner | 6b883e3 | 2009-08-11 23:03:40 +0000 | [diff] [blame] | 57 | AssemblerDialect = 0; // Old-Style mnemonics. |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 58 | } |
Anton Korobeynikov | 7b1b7f5 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 59 | |