Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 081ce94 | 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. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +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" |
| 16 | #include "llvm/Function.h" |
Anton Korobeynikov | 0aeac60 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 17 | #include "llvm/Support/Dwarf.h" |
| 18 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 19 | using namespace llvm; |
Anton Korobeynikov | 0aeac60 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 20 | using namespace llvm::dwarf; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 21 | |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 22 | PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 23 | PCSymbol = "."; |
| 24 | CommentString = ";"; |
Jim Grosbach | 29feb6a | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 25 | ExceptionsType = ExceptionHandling::Dwarf; |
| 26 | |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 27 | const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); |
| 28 | bool isPPC64 = Subtarget->isPPC64(); |
| 29 | |
Chris Lattner | 75dabac | 2009-08-11 22:22:44 +0000 | [diff] [blame] | 30 | if (!isPPC64) |
| 31 | Data64bitsDirective = 0; // we can't emit a 64-bit unit |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 32 | InlineAsmStart = "# InlineAsm Start"; |
| 33 | InlineAsmEnd = "# InlineAsm End"; |
| 34 | AssemblerDialect = Subtarget->getAsmFlavor(); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 35 | } |
| 36 | |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 37 | PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) { |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 38 | CommentString = "#"; |
| 39 | GlobalPrefix = ""; |
Rafael Espindola | 1a93184 | 2008-12-19 10:55:56 +0000 | [diff] [blame] | 40 | PrivateGlobalPrefix = ".L"; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 41 | UsedDirective = "\t# .no_dead_strip\t"; |
| 42 | WeakRefDirective = "\t.weak\t"; |
Nick Lewycky | 3246a9c | 2007-07-25 03:48:45 +0000 | [diff] [blame] | 43 | |
Nicolas Geoffray | 6186476 | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 44 | // Debug Information |
| 45 | AbsoluteDebugSectionOffsets = true; |
| 46 | SupportsDebugInformation = true; |
Nicolas Geoffray | 6186476 | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 47 | |
Nicolas Geoffray | 6186476 | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 48 | PCSymbol = "."; |
| 49 | |
| 50 | // Set up DWARF directives |
| 51 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
| 52 | |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 53 | const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>(); |
| 54 | bool isPPC64 = Subtarget->isPPC64(); |
| 55 | |
Nicolas Geoffray | 6186476 | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 56 | // Exceptions handling |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 57 | if (!isPPC64) |
Jim Grosbach | 29feb6a | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 58 | ExceptionsType = ExceptionHandling::Dwarf; |
Nicolas Geoffray | 6186476 | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 59 | AbsoluteEHSectionOffsets = false; |
Chris Lattner | 7fbb0a1 | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 60 | |
| 61 | ZeroDirective = "\t.space\t"; |
| 62 | SetDirective = "\t.set"; |
| 63 | Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0; |
| 64 | AlignmentIsInBytes = false; |
| 65 | LCOMMDirective = "\t.lcomm\t"; |
| 66 | InlineAsmStart = "# InlineAsm Start"; |
| 67 | InlineAsmEnd = "# InlineAsm End"; |
| 68 | AssemblerDialect = Subtarget->getAsmFlavor(); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 69 | } |
Anton Korobeynikov | 0aeac60 | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 70 | |