blob: b6d46dd34fab6c03f0f3f5a9c6929dba917f5be5 [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
Chris Lattner2b4364f2010-01-20 06:34:14 +000017PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
Evan Chenga83b37a2011-07-15 02:09:41 +000018 if (is64Bit)
19 PointerSize = 8;
20 IsLittleEndian = false;
21
Jim Laskeyc3de9b42007-02-01 16:31:34 +000022 PCSymbol = ".";
Jim Laskey28663c72006-12-21 20:26:09 +000023 CommentString = ";";
Rafael Espindola5164e6e2011-05-02 15:58:16 +000024 ExceptionsType = ExceptionHandling::DwarfCFI;
Jim Grosbach693e36a2009-08-11 00:09:57 +000025
Daniel Dunbar86c065d2009-08-13 17:03:38 +000026 if (!is64Bit)
Chris Lattnere6555212009-08-11 22:49:34 +000027 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
Rafael Espindola1c8ac8f2010-12-04 03:21:47 +000028
Chris Lattner96db1ab2009-08-11 23:03:40 +000029 AssemblerDialect = 1; // New-Style mnemonics.
Dale Johannesen237b1c12010-01-06 02:21:00 +000030 SupportsDebugInformation= true; // Debug information.
Jim Laskey28663c72006-12-21 20:26:09 +000031}
32
Chris Lattner2b4364f2010-01-20 06:34:14 +000033PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
Evan Chengde4ae462011-08-01 19:43:05 +000034 if (is64Bit)
35 PointerSize = 8;
36 IsLittleEndian = false;
37
Rafael Espindola4536b9a2010-02-06 03:32:21 +000038 // ".comm align is in bytes but .align is pow-2."
39 AlignmentIsInBytes = false;
40
Jim Laskey28663c72006-12-21 20:26:09 +000041 CommentString = "#";
42 GlobalPrefix = "";
Rafael Espindola770b4b82008-12-19 10:55:56 +000043 PrivateGlobalPrefix = ".L";
Jim Laskey28663c72006-12-21 20:26:09 +000044 WeakRefDirective = "\t.weak\t";
Bruno Cardoso Lopes62e6a8b2009-08-13 23:30:21 +000045
46 // Uses '.section' before '.bss' directive
47 UsesELFSectionDirectiveForBSS = true;
Nick Lewycky5805c462007-07-25 03:48:45 +000048
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000049 // Debug Information
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000050 SupportsDebugInformation = true;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000051
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000052 PCSymbol = ".";
53
54 // Set up DWARF directives
55 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
56
57 // Exceptions handling
Daniel Dunbar86c065d2009-08-13 17:03:38 +000058 if (!is64Bit)
Rafael Espindolabc8e3f82011-05-05 21:34:33 +000059 ExceptionsType = ExceptionHandling::DwarfCFI;
Chris Lattner7faf1fd2009-08-11 22:06:07 +000060
61 ZeroDirective = "\t.space\t";
Daniel Dunbar86c065d2009-08-13 17:03:38 +000062 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
Chris Lattnerb1301f72010-01-23 07:47:02 +000063 HasLCOMMDirective = true;
Chris Lattner96db1ab2009-08-11 23:03:40 +000064 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskey28663c72006-12-21 20:26:09 +000065}
Anton Korobeynikovd73396b2008-02-27 23:49:15 +000066