blob: 94465d7205d4e5889a688954f45a819a2292300d [file] [log] [blame]
Chris Lattner7b26fce2009-08-22 20:48:53 +00001//===-- PPCMCAsmInfo.cpp - PPC asm properties -------------------*- C++ -*-===//
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) {
Evan Chenga83b37a2011-07-15 02:09:41 +000020 if (is64Bit)
21 PointerSize = 8;
22 IsLittleEndian = false;
23
Jim Laskeyc3de9b42007-02-01 16:31:34 +000024 PCSymbol = ".";
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) {
Evan Chengde4ae462011-08-01 19:43:05 +000038 if (is64Bit)
39 PointerSize = 8;
40 IsLittleEndian = false;
41
Rafael Espindola4536b9a2010-02-06 03:32:21 +000042 // ".comm align is in bytes but .align is pow-2."
43 AlignmentIsInBytes = false;
44
Jim Laskey28663c72006-12-21 20:26:09 +000045 CommentString = "#";
46 GlobalPrefix = "";
Rafael Espindola770b4b82008-12-19 10:55:56 +000047 PrivateGlobalPrefix = ".L";
Jim Laskey28663c72006-12-21 20:26:09 +000048 WeakRefDirective = "\t.weak\t";
Bruno Cardoso Lopes62e6a8b2009-08-13 23:30:21 +000049
50 // 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
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000056 PCSymbol = ".";
57
58 // Set up DWARF directives
59 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
60
61 // Exceptions handling
Daniel Dunbar86c065d2009-08-13 17:03:38 +000062 if (!is64Bit)
Rafael Espindolabc8e3f82011-05-05 21:34:33 +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;
Benjamin Kramer63970512011-09-01 23:04:27 +000067 LCOMMDirectiveType = LCOMM::NoAlignment;
Chris Lattner96db1ab2009-08-11 23:03:40 +000068 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskey28663c72006-12-21 20:26:09 +000069}
Anton Korobeynikovd73396b2008-02-27 23:49:15 +000070