blob: b04842782aeb57ac2af8ec20d9037d98b3207ae0 [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) {
Evan Chengde4ae462011-08-01 19:43:05 +000039 if (is64Bit)
40 PointerSize = 8;
41 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";
Jim Laskey28663c72006-12-21 20:26:09 +000049 WeakRefDirective = "\t.weak\t";
Bruno Cardoso Lopes62e6a8b2009-08-13 23:30:21 +000050
51 // Uses '.section' before '.bss' directive
52 UsesELFSectionDirectiveForBSS = true;
Nick Lewycky5805c462007-07-25 03:48:45 +000053
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000054 // Debug Information
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000055 SupportsDebugInformation = true;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000056
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000057 PCSymbol = ".";
58
59 // Set up DWARF directives
60 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
61
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;
Chris Lattner96db1ab2009-08-11 23:03:40 +000067 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskey28663c72006-12-21 20:26:09 +000068}
Anton Korobeynikovd73396b2008-02-27 23:49:15 +000069