There are two reasons why we might want to use
[oota-llvm.git] / lib / Target / PowerPC / PPCMCAsmInfo.cpp
1 //===-- PPCMCAsmInfo.cpp - PPC asm properties -------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the MCAsmInfoDarwin properties.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "PPCMCAsmInfo.h"
15 using namespace llvm;
16
17 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
18   PCSymbol = ".";
19   CommentString = ";";
20   ExceptionsType = ExceptionHandling::Dwarf;
21
22   if (!is64Bit)
23     Data64bitsDirective = 0;      // We can't emit a 64-bit unit in PPC32 mode.
24
25   if (is64Bit)
26     NeedsSetToChangeDiffSize = true;
27
28   AssemblerDialect = 1;           // New-Style mnemonics.
29   SupportsDebugInformation= true; // Debug information.
30 }
31
32 PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
33   // ".comm align is in bytes but .align is pow-2."
34   AlignmentIsInBytes = false;
35
36   CommentString = "#";
37   GlobalPrefix = "";
38   PrivateGlobalPrefix = ".L";
39   WeakRefDirective = "\t.weak\t";
40   
41   // Uses '.section' before '.bss' directive
42   UsesELFSectionDirectiveForBSS = true;  
43
44   // Debug Information
45   SupportsDebugInformation = true;
46
47   PCSymbol = ".";
48
49   // Set up DWARF directives
50   HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
51
52   // Exceptions handling
53   if (!is64Bit)
54     ExceptionsType = ExceptionHandling::Dwarf;
55     
56   ZeroDirective = "\t.space\t";
57   Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
58   HasLCOMMDirective = true;
59   AssemblerDialect = 0;           // Old-Style mnemonics.
60 }
61