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