Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===// |
Jim Laskey | 0e83541 | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 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 | 0e83541 | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Chris Lattner | 0545746 | 2009-08-22 21:03:30 +0000 | [diff] [blame] | 10 | // This file contains the declarations of the MCAsmInfoDarwin properties. |
Jim Laskey | 0e83541 | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Chris Lattner | 7b26fce | 2009-08-22 20:48:53 +0000 | [diff] [blame] | 14 | #include "PPCMCAsmInfo.h" |
Jim Laskey | 0e83541 | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 15 | using namespace llvm; |
| 16 | |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 17 | void PPCMCAsmInfoDarwin::anchor() { } |
| 18 | |
Chris Lattner | 2b4364f | 2010-01-20 06:34:14 +0000 | [diff] [blame] | 19 | PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) { |
Eli Bendersky | 32aab22 | 2013-01-23 16:22:04 +0000 | [diff] [blame] | 20 | if (is64Bit) { |
| 21 | PointerSize = CalleeSaveStackSlotSize = 8; |
| 22 | } |
Evan Cheng | a83b37a | 2011-07-15 02:09:41 +0000 | [diff] [blame] | 23 | IsLittleEndian = false; |
| 24 | |
Jim Laskey | c3de9b4 | 2007-02-01 16:31:34 +0000 | [diff] [blame] | 25 | PCSymbol = "."; |
Jim Laskey | 28663c7 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 26 | CommentString = ";"; |
Rafael Espindola | 5164e6e | 2011-05-02 15:58:16 +0000 | [diff] [blame] | 27 | ExceptionsType = ExceptionHandling::DwarfCFI; |
Jim Grosbach | 693e36a | 2009-08-11 00:09:57 +0000 | [diff] [blame] | 28 | |
Daniel Dunbar | 86c065d | 2009-08-13 17:03:38 +0000 | [diff] [blame] | 29 | if (!is64Bit) |
Chris Lattner | e655521 | 2009-08-11 22:49:34 +0000 | [diff] [blame] | 30 | Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. |
Rafael Espindola | 1c8ac8f | 2010-12-04 03:21:47 +0000 | [diff] [blame] | 31 | |
Chris Lattner | 96db1ab | 2009-08-11 23:03:40 +0000 | [diff] [blame] | 32 | AssemblerDialect = 1; // New-Style mnemonics. |
Dale Johannesen | 237b1c1 | 2010-01-06 02:21:00 +0000 | [diff] [blame] | 33 | SupportsDebugInformation= true; // Debug information. |
Jim Laskey | 28663c7 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 34 | } |
| 35 | |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 36 | void PPCLinuxMCAsmInfo::anchor() { } |
| 37 | |
Chris Lattner | 2b4364f | 2010-01-20 06:34:14 +0000 | [diff] [blame] | 38 | PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { |
Eli Bendersky | f759526 | 2013-01-23 17:12:15 +0000 | [diff] [blame] | 39 | if (is64Bit) { |
| 40 | PointerSize = CalleeSaveStackSlotSize = 8; |
| 41 | } |
Evan Cheng | de4ae46 | 2011-08-01 19:43:05 +0000 | [diff] [blame] | 42 | IsLittleEndian = false; |
| 43 | |
Rafael Espindola | 4536b9a | 2010-02-06 03:32:21 +0000 | [diff] [blame] | 44 | // ".comm align is in bytes but .align is pow-2." |
| 45 | AlignmentIsInBytes = false; |
| 46 | |
Jim Laskey | 28663c7 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 47 | CommentString = "#"; |
| 48 | GlobalPrefix = ""; |
Rafael Espindola | 770b4b8 | 2008-12-19 10:55:56 +0000 | [diff] [blame] | 49 | PrivateGlobalPrefix = ".L"; |
Jim Laskey | 28663c7 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 50 | WeakRefDirective = "\t.weak\t"; |
Bruno Cardoso Lopes | 62e6a8b | 2009-08-13 23:30:21 +0000 | [diff] [blame] | 51 | |
| 52 | // Uses '.section' before '.bss' directive |
| 53 | UsesELFSectionDirectiveForBSS = true; |
Nick Lewycky | 5805c46 | 2007-07-25 03:48:45 +0000 | [diff] [blame] | 54 | |
Nicolas Geoffray | 80c741e | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 55 | // Debug Information |
Nicolas Geoffray | 80c741e | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 56 | SupportsDebugInformation = true; |
Nicolas Geoffray | 80c741e | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 57 | |
Nicolas Geoffray | 80c741e | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 58 | PCSymbol = "."; |
| 59 | |
| 60 | // Set up DWARF directives |
| 61 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
Ulrich Weigand | 32d725b | 2013-06-12 14:46:54 +0000 | [diff] [blame^] | 62 | MinInstAlignment = 4; |
Nicolas Geoffray | 80c741e | 2007-12-21 12:19:44 +0000 | [diff] [blame] | 63 | |
| 64 | // Exceptions handling |
Roman Divacky | 10a448d | 2012-09-12 15:29:32 +0000 | [diff] [blame] | 65 | ExceptionsType = ExceptionHandling::DwarfCFI; |
Chris Lattner | 7faf1fd | 2009-08-11 22:06:07 +0000 | [diff] [blame] | 66 | |
| 67 | ZeroDirective = "\t.space\t"; |
Daniel Dunbar | 86c065d | 2009-08-13 17:03:38 +0000 | [diff] [blame] | 68 | Data64bitsDirective = is64Bit ? "\t.quad\t" : 0; |
Chris Lattner | 96db1ab | 2009-08-11 23:03:40 +0000 | [diff] [blame] | 69 | AssemblerDialect = 0; // Old-Style mnemonics. |
Jim Laskey | 28663c7 | 2006-12-21 20:26:09 +0000 | [diff] [blame] | 70 | } |
Anton Korobeynikov | d73396b | 2008-02-27 23:49:15 +0000 | [diff] [blame] | 71 | |