1 //===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the MCAsmInfoDarwin properties.
12 //===----------------------------------------------------------------------===//
14 #include "PPCMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
19 void PPCMCAsmInfoDarwin::anchor() { }
21 /// This version of the constructor is here to maintain ABI compatibility with
23 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
25 PointerSize = CalleeSaveStackSlotSize = 8;
27 IsLittleEndian = false;
30 ExceptionsType = ExceptionHandling::DwarfCFI;
33 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
35 AssemblerDialect = 1; // New-Style mnemonics.
36 SupportsDebugInformation= true; // Debug information.
39 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
41 PointerSize = CalleeSaveStackSlotSize = 8;
43 IsLittleEndian = false;
46 ExceptionsType = ExceptionHandling::DwarfCFI;
49 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
51 AssemblerDialect = 1; // New-Style mnemonics.
52 SupportsDebugInformation= true; // Debug information.
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;
61 void PPCLinuxMCAsmInfo::anchor() { }
63 PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
65 PointerSize = CalleeSaveStackSlotSize = 8;
67 IsLittleEndian = false;
69 // ".comm align is in bytes but .align is pow-2."
70 AlignmentIsInBytes = false;
74 PrivateGlobalPrefix = ".L";
76 // Uses '.section' before '.bss' directive
77 UsesELFSectionDirectiveForBSS = true;
80 SupportsDebugInformation = true;
84 // Set up DWARF directives
85 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
88 // Exceptions handling
89 ExceptionsType = ExceptionHandling::DwarfCFI;
91 ZeroDirective = "\t.space\t";
92 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
93 AssemblerDialect = 1; // New-Style mnemonics.