PPCMCAsmInfo.cpp revision 266715
1//===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===//
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#include "llvm/ADT/Triple.h"
16
17using namespace llvm;
18
19void PPCMCAsmInfoDarwin::anchor() { }
20
21/// This version of the constructor is here to maintain ABI compatibility with
22/// LLVM 3.4.0
23PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
24  if (is64Bit) {
25    PointerSize = CalleeSaveStackSlotSize = 8;
26  }
27  IsLittleEndian = false;
28
29  CommentString = ";";
30  ExceptionsType = ExceptionHandling::DwarfCFI;
31
32  if (!is64Bit)
33    Data64bitsDirective = 0;      // We can't emit a 64-bit unit in PPC32 mode.
34
35  AssemblerDialect = 1;           // New-Style mnemonics.
36  SupportsDebugInformation= true; // Debug information.
37}
38
39PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
40  if (is64Bit) {
41    PointerSize = CalleeSaveStackSlotSize = 8;
42  }
43  IsLittleEndian = false;
44
45  CommentString = ";";
46  ExceptionsType = ExceptionHandling::DwarfCFI;
47
48  if (!is64Bit)
49    Data64bitsDirective = 0;      // We can't emit a 64-bit unit in PPC32 mode.
50
51  AssemblerDialect = 1;           // New-Style mnemonics.
52  SupportsDebugInformation= true; // Debug information.
53
54  // old assembler lacks some directives
55  // FIXME: this should really be a check on the assembler characteristics
56  // rather than OS version
57  if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6))
58    HasWeakDefCanBeHiddenDirective = false;
59}
60
61void PPCLinuxMCAsmInfo::anchor() { }
62
63PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
64  if (is64Bit) {
65    PointerSize = CalleeSaveStackSlotSize = 8;
66  }
67  IsLittleEndian = false;
68
69  // ".comm align is in bytes but .align is pow-2."
70  AlignmentIsInBytes = false;
71
72  CommentString = "#";
73  GlobalPrefix = "";
74  PrivateGlobalPrefix = ".L";
75
76  // Uses '.section' before '.bss' directive
77  UsesELFSectionDirectiveForBSS = true;
78
79  // Debug Information
80  SupportsDebugInformation = true;
81
82  DollarIsPC = true;
83
84  // Set up DWARF directives
85  HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
86  MinInstAlignment = 4;
87
88  // Exceptions handling
89  ExceptionsType = ExceptionHandling::DwarfCFI;
90
91  ZeroDirective = "\t.space\t";
92  Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
93  AssemblerDialect = 1;           // New-Style mnemonics.
94}
95
96