blob: bb7ce6f23c6414b093637373851a0f2e64b86287 [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 Laskeyc3de9b42007-02-01 16:31:34 +000025 PCSymbol = ".";
Jim Laskey28663c72006-12-21 20:26:09 +000026 CommentString = ";";
Rafael Espindola5164e6e2011-05-02 15:58:16 +000027 ExceptionsType = ExceptionHandling::DwarfCFI;
Jim Grosbach693e36a2009-08-11 00:09:57 +000028
Daniel Dunbar86c065d2009-08-13 17:03:38 +000029 if (!is64Bit)
Chris Lattnere6555212009-08-11 22:49:34 +000030 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
Rafael Espindola1c8ac8f2010-12-04 03:21:47 +000031
Chris Lattner96db1ab2009-08-11 23:03:40 +000032 AssemblerDialect = 1; // New-Style mnemonics.
Dale Johannesen237b1c12010-01-06 02:21:00 +000033 SupportsDebugInformation= true; // Debug information.
Jim Laskey28663c72006-12-21 20:26:09 +000034}
35
David Blaikiea379b1812011-12-20 02:50:00 +000036void PPCLinuxMCAsmInfo::anchor() { }
37
Chris Lattner2b4364f2010-01-20 06:34:14 +000038PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
Eli Benderskyf7595262013-01-23 17:12:15 +000039 if (is64Bit) {
40 PointerSize = CalleeSaveStackSlotSize = 8;
41 }
Evan Chengde4ae462011-08-01 19:43:05 +000042 IsLittleEndian = false;
43
Rafael Espindola4536b9a2010-02-06 03:32:21 +000044 // ".comm align is in bytes but .align is pow-2."
45 AlignmentIsInBytes = false;
46
Jim Laskey28663c72006-12-21 20:26:09 +000047 CommentString = "#";
48 GlobalPrefix = "";
Rafael Espindola770b4b82008-12-19 10:55:56 +000049 PrivateGlobalPrefix = ".L";
Jim Laskey28663c72006-12-21 20:26:09 +000050 WeakRefDirective = "\t.weak\t";
Bruno Cardoso Lopes62e6a8b2009-08-13 23:30:21 +000051
52 // Uses '.section' before '.bss' directive
53 UsesELFSectionDirectiveForBSS = true;
Nick Lewycky5805c462007-07-25 03:48:45 +000054
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000055 // Debug Information
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000056 SupportsDebugInformation = true;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000057
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000058 PCSymbol = ".";
59
60 // Set up DWARF directives
61 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
Ulrich Weigand32d725b2013-06-12 14:46:54 +000062 MinInstAlignment = 4;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000063
64 // Exceptions handling
Roman Divacky10a448d2012-09-12 15:29:32 +000065 ExceptionsType = ExceptionHandling::DwarfCFI;
Chris Lattner7faf1fd2009-08-11 22:06:07 +000066
67 ZeroDirective = "\t.space\t";
Daniel Dunbar86c065d2009-08-13 17:03:38 +000068 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
Chris Lattner96db1ab2009-08-11 23:03:40 +000069 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskey28663c72006-12-21 20:26:09 +000070}
Anton Korobeynikovd73396b2008-02-27 23:49:15 +000071