blob: f3dddce30120976371f477a8ff3a9e7fb0754eed [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===//
Jim Laskey0e835412006-09-07 22:05:02 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey0e835412006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner05457462009-08-22 21:03:30 +000010// This file contains the declarations of the MCAsmInfoDarwin properties.
Jim Laskey0e835412006-09-07 22:05:02 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner7b26fce2009-08-22 20:48:53 +000014#include "PPCMCAsmInfo.h"
Jim Laskey0e835412006-09-07 22:05:02 +000015using namespace llvm;
16
David Blaikiea379b1812011-12-20 02:50:00 +000017void PPCMCAsmInfoDarwin::anchor() { }
18
Chris Lattner2b4364f2010-01-20 06:34:14 +000019PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
Eli Bendersky32aab222013-01-23 16:22:04 +000020 if (is64Bit) {
21 PointerSize = CalleeSaveStackSlotSize = 8;
22 }
Evan Chenga83b37a2011-07-15 02:09:41 +000023 IsLittleEndian = false;
24
Jim Laskey28663c72006-12-21 20:26:09 +000025 CommentString = ";";
Rafael Espindola5164e6e2011-05-02 15:58:16 +000026 ExceptionsType = ExceptionHandling::DwarfCFI;
Jim Grosbach693e36a2009-08-11 00:09:57 +000027
Daniel Dunbar86c065d2009-08-13 17:03:38 +000028 if (!is64Bit)
Chris Lattnere6555212009-08-11 22:49:34 +000029 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
Rafael Espindola1c8ac8f2010-12-04 03:21:47 +000030
Chris Lattner96db1ab2009-08-11 23:03:40 +000031 AssemblerDialect = 1; // New-Style mnemonics.
Dale Johannesen237b1c12010-01-06 02:21:00 +000032 SupportsDebugInformation= true; // Debug information.
Jim Laskey28663c72006-12-21 20:26:09 +000033}
34
David Blaikiea379b1812011-12-20 02:50:00 +000035void PPCLinuxMCAsmInfo::anchor() { }
36
Chris Lattner2b4364f2010-01-20 06:34:14 +000037PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
Eli Benderskyf7595262013-01-23 17:12:15 +000038 if (is64Bit) {
39 PointerSize = CalleeSaveStackSlotSize = 8;
40 }
Evan Chengde4ae462011-08-01 19:43:05 +000041 IsLittleEndian = false;
42
Rafael Espindola4536b9a2010-02-06 03:32:21 +000043 // ".comm align is in bytes but .align is pow-2."
44 AlignmentIsInBytes = false;
45
Jim Laskey28663c72006-12-21 20:26:09 +000046 CommentString = "#";
47 GlobalPrefix = "";
Rafael Espindola770b4b82008-12-19 10:55:56 +000048 PrivateGlobalPrefix = ".L";
Rafael Espindola43c4e242013-10-16 01:34:32 +000049
Bruno Cardoso Lopes62e6a8b2009-08-13 23:30:21 +000050 // Uses '.section' before '.bss' directive
51 UsesELFSectionDirectiveForBSS = true;
Nick Lewycky5805c462007-07-25 03:48:45 +000052
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000053 // Debug Information
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000054 SupportsDebugInformation = true;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000055
David Majnemer0c58bc62013-09-25 10:47:21 +000056 DollarIsPC = true;
57
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000058 // Set up DWARF directives
59 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
Ulrich Weigand32d725b2013-06-12 14:46:54 +000060 MinInstAlignment = 4;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000061
62 // Exceptions handling
Roman Divacky10a448d2012-09-12 15:29:32 +000063 ExceptionsType = ExceptionHandling::DwarfCFI;
Chris Lattner7faf1fd2009-08-11 22:06:07 +000064
65 ZeroDirective = "\t.space\t";
Daniel Dunbar86c065d2009-08-13 17:03:38 +000066 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
Ulrich Weigand266db7f2013-07-08 20:20:51 +000067 AssemblerDialect = 1; // New-Style mnemonics.
Jim Laskey28663c72006-12-21 20:26:09 +000068}
Anton Korobeynikovd73396b2008-02-27 23:49:15 +000069