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