blob: d1178dd7e1ff022134b556d55f641b07a4174560 [file] [log] [blame]
Chris Lattneraf76e592009-08-22 20:48:53 +00001//===-- PPCMCAsmInfo.cpp - PPC asm properties -------------------*- C++ -*-===//
Jim Laskey8e8de8f2006-09-07 22:05:02 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-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 Laskey8e8de8f2006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner2807afa2009-08-22 21:03:30 +000010// This file contains the declarations of the MCAsmInfoDarwin properties.
Jim Laskey8e8de8f2006-09-07 22:05:02 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattneraf76e592009-08-22 20:48:53 +000014#include "PPCMCAsmInfo.h"
Jim Laskey8e8de8f2006-09-07 22:05:02 +000015using namespace llvm;
16
Chris Lattner8eeba352010-01-20 06:34:14 +000017PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
Jim Laskeyb82313f2007-02-01 16:31:34 +000018 PCSymbol = ".";
Jim Laskeybf111822006-12-21 20:26:09 +000019 CommentString = ";";
Anton Korobeynikov3965b5e2011-01-14 21:58:08 +000020 ExceptionsType = ExceptionHandling::DwarfTable;
Jim Grosbach1b747ad2009-08-11 00:09:57 +000021
Daniel Dunbarb42dad42009-08-13 17:03:38 +000022 if (!is64Bit)
Chris Lattner74da6712009-08-11 22:49:34 +000023 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
Rafael Espindola5d4918d2010-12-04 03:21:47 +000024
Chris Lattner6b883e32009-08-11 23:03:40 +000025 AssemblerDialect = 1; // New-Style mnemonics.
Dale Johannesenb7339d02010-01-06 02:21:00 +000026 SupportsDebugInformation= true; // Debug information.
Jim Laskeybf111822006-12-21 20:26:09 +000027}
28
Chris Lattner8eeba352010-01-20 06:34:14 +000029PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
Rafael Espindola2f82ca92010-02-06 03:32:21 +000030 // ".comm align is in bytes but .align is pow-2."
31 AlignmentIsInBytes = false;
32
Jim Laskeybf111822006-12-21 20:26:09 +000033 CommentString = "#";
34 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000035 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000036 WeakRefDirective = "\t.weak\t";
Bruno Cardoso Lopesfdf229e2009-08-13 23:30:21 +000037
38 // Uses '.section' before '.bss' directive
39 UsesELFSectionDirectiveForBSS = true;
Nick Lewyckye2b90522007-07-25 03:48:45 +000040
Nicolas Geoffray616585b2007-12-21 12:19:44 +000041 // Debug Information
Nicolas Geoffray616585b2007-12-21 12:19:44 +000042 SupportsDebugInformation = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000043
Nicolas Geoffray616585b2007-12-21 12:19:44 +000044 PCSymbol = ".";
45
46 // Set up DWARF directives
47 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
48
49 // Exceptions handling
Daniel Dunbarb42dad42009-08-13 17:03:38 +000050 if (!is64Bit)
Anton Korobeynikov3965b5e2011-01-14 21:58:08 +000051 ExceptionsType = ExceptionHandling::DwarfTable;
Chris Lattnerc89ecc52009-08-11 22:06:07 +000052
53 ZeroDirective = "\t.space\t";
Daniel Dunbarb42dad42009-08-13 17:03:38 +000054 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
Chris Lattner9eb158d2010-01-23 07:47:02 +000055 HasLCOMMDirective = true;
Chris Lattner6b883e32009-08-11 23:03:40 +000056 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskeybf111822006-12-21 20:26:09 +000057}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000058