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 Grosbach | 1b747ad | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 25 | ExceptionsType = ExceptionHandling::Dwarf; |
| 26 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 27 | const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); |
| 28 | bool isPPC64 = Subtarget->isPPC64(); |
| 29 | |
Chris Lattner | e2811a7 | 2009-08-11 22:22:44 +0000 | [diff] [blame] | 30 | if (!isPPC64) |
Chris Lattner | 74da671 | 2009-08-11 22:49:34 +0000 | [diff] [blame^] | 31 | Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. |
| 32 | AssemblerDialect = 0; // Old-Style mnemonics. |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 33 | } |
| 34 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 35 | PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) { |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 36 | CommentString = "#"; |
| 37 | GlobalPrefix = ""; |
Rafael Espindola | 2f6fea9 | 2008-12-19 10:55:56 +0000 | [diff] [blame] | 38 | PrivateGlobalPrefix = ".L"; |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 39 | UsedDirective = "\t# .no_dead_strip\t"; |
| 40 | WeakRefDirective = "\t.weak\t"; |
Nick Lewycky | e2b9052 | 2007-07-25 03:48:45 +0000 | [diff] [blame] | 41 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 42 | // Debug Information |
| 43 | AbsoluteDebugSectionOffsets = true; |
| 44 | SupportsDebugInformation = true; |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 45 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 46 | PCSymbol = "."; |
| 47 | |
| 48 | // Set up DWARF directives |
| 49 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
| 50 | |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 51 | const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); |
| 52 | bool isPPC64 = Subtarget->isPPC64(); |
| 53 | |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 54 | // Exceptions handling |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 55 | if (!isPPC64) |
Jim Grosbach | 1b747ad | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 56 | ExceptionsType = ExceptionHandling::Dwarf; |
Nicolas Geoffray | 616585b | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 57 | AbsoluteEHSectionOffsets = false; |
Chris Lattner | c89ecc5 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 58 | |
| 59 | ZeroDirective = "\t.space\t"; |
| 60 | SetDirective = "\t.set"; |
| 61 | Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; |
| 62 | AlignmentIsInBytes = false; |
| 63 | LCOMMDirective = "\t.lcomm\t"; |
Chris Lattner | 74da671 | 2009-08-11 22:49:34 +0000 | [diff] [blame^] | 64 | AssemblerDialect = 1; // New-Style mnemonics. |
Jim Laskey | bf11182 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 65 | } |
Anton Korobeynikov | 7b1b7f5 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 66 | |