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 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
23 PointerSize = CalleeSaveStackSlotSize = 8;
25 IsLittleEndian = false;
28 ExceptionsType = ExceptionHandling::DwarfCFI;
31 Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode.
33 AssemblerDialect = 1; // New-Style mnemonics.
34 SupportsDebugInformation= true; // Debug information.
36 // The installed assembler for OSX < 10.6 lacks some directives.
37 // FIXME: this should really be a check on the assembler characteristics
38 // rather than OS version
39 if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6))
40 HasWeakDefCanBeHiddenDirective = false;
42 UseIntegratedAssembler = true;
45 void PPCLinuxMCAsmInfo::anchor() { }
47 PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit, const Triple& T) {
49 PointerSize = CalleeSaveStackSlotSize = 8;
51 IsLittleEndian = T.getArch() == Triple::ppc64le;
53 // ".comm align is in bytes but .align is pow-2."
54 AlignmentIsInBytes = false;
58 // Uses '.section' before '.bss' directive
59 UsesELFSectionDirectiveForBSS = true;
62 SupportsDebugInformation = true;
66 // Set up DWARF directives
67 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
70 // Exceptions handling
71 ExceptionsType = ExceptionHandling::DwarfCFI;
73 ZeroDirective = "\t.space\t";
74 Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;
75 AssemblerDialect = 1; // New-Style mnemonics.
76 LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
78 if (T.getOS() == llvm::Triple::FreeBSD ||
79 (T.getOS() == llvm::Triple::NetBSD && !is64Bit) ||
80 (T.getOS() == llvm::Triple::OpenBSD && !is64Bit))
81 UseIntegratedAssembler = true;