1234353Sdim//===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===// 2224133Sdim// 3224133Sdim// The LLVM Compiler Infrastructure 4224133Sdim// 5224133Sdim// This file is distributed under the University of Illinois Open Source 6224133Sdim// License. See LICENSE.TXT for details. 7224133Sdim// 8224133Sdim//===----------------------------------------------------------------------===// 9224133Sdim// 10224133Sdim// This file contains the declarations of the MCAsmInfoDarwin properties. 11224133Sdim// 12224133Sdim//===----------------------------------------------------------------------===// 13224133Sdim 14224133Sdim#include "PPCMCAsmInfo.h" 15265925Sdim#include "llvm/ADT/Triple.h" 16265925Sdim 17224133Sdimusing namespace llvm; 18224133Sdim 19234353Sdimvoid PPCMCAsmInfoDarwin::anchor() { } 20234353Sdim 21265925SdimPPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) { 22265925Sdim if (is64Bit) { 23265925Sdim PointerSize = CalleeSaveStackSlotSize = 8; 24265925Sdim } 25265925Sdim IsLittleEndian = false; 26265925Sdim 27265925Sdim CommentString = ";"; 28265925Sdim ExceptionsType = ExceptionHandling::DwarfCFI; 29265925Sdim 30265925Sdim if (!is64Bit) 31276479Sdim Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode. 32265925Sdim 33265925Sdim AssemblerDialect = 1; // New-Style mnemonics. 34265925Sdim SupportsDebugInformation= true; // Debug information. 35265925Sdim 36276479Sdim // The installed assembler for OSX < 10.6 lacks some directives. 37265925Sdim // FIXME: this should really be a check on the assembler characteristics 38265925Sdim // rather than OS version 39265925Sdim if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6)) 40265925Sdim HasWeakDefCanBeHiddenDirective = false; 41276479Sdim 42276479Sdim UseIntegratedAssembler = true; 43265925Sdim} 44265925Sdim 45280031Sdimvoid PPCELFMCAsmInfo::anchor() { } 46234353Sdim 47280031SdimPPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) { 48288943Sdim // FIXME: This is not always needed. For example, it is not needed in the 49288943Sdim // v2 abi. 50288943Sdim NeedsLocalForSize = true; 51288943Sdim 52249423Sdim if (is64Bit) { 53249423Sdim PointerSize = CalleeSaveStackSlotSize = 8; 54249423Sdim } 55276479Sdim IsLittleEndian = T.getArch() == Triple::ppc64le; 56226633Sdim 57224133Sdim // ".comm align is in bytes but .align is pow-2." 58224133Sdim AlignmentIsInBytes = false; 59224133Sdim 60224133Sdim CommentString = "#"; 61261991Sdim 62224133Sdim // Uses '.section' before '.bss' directive 63224133Sdim UsesELFSectionDirectiveForBSS = true; 64224133Sdim 65224133Sdim // Debug Information 66224133Sdim SupportsDebugInformation = true; 67224133Sdim 68261991Sdim DollarIsPC = true; 69224133Sdim 70224133Sdim // Set up DWARF directives 71261991Sdim MinInstAlignment = 4; 72224133Sdim 73224133Sdim // Exceptions handling 74243830Sdim ExceptionsType = ExceptionHandling::DwarfCFI; 75224133Sdim 76224133Sdim ZeroDirective = "\t.space\t"; 77276479Sdim Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr; 78261991Sdim AssemblerDialect = 1; // New-Style mnemonics. 79280031Sdim LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment; 80276479Sdim 81280031Sdim UseIntegratedAssembler = true; 82224133Sdim} 83224133Sdim 84