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 17 using namespace llvm; 18 anchor()19void PPCMCAsmInfoDarwin::anchor() { } 20 PPCMCAsmInfoDarwin(bool is64Bit,const Triple & T)21PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) { 22 if (is64Bit) { 23 CodePointerSize = CalleeSaveStackSlotSize = 8; 24 } 25 IsLittleEndian = false; 26 27 SeparatorString = "@"; 28 CommentString = ";"; 29 ExceptionsType = ExceptionHandling::DwarfCFI; 30 31 if (!is64Bit) 32 Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode. 33 34 AssemblerDialect = 1; // New-Style mnemonics. 35 SupportsDebugInformation= true; // Debug information. 36 37 // The installed assembler for OSX < 10.6 lacks some directives. 38 // FIXME: this should really be a check on the assembler characteristics 39 // rather than OS version 40 if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6)) 41 HasWeakDefCanBeHiddenDirective = false; 42 43 UseIntegratedAssembler = true; 44 } 45 anchor()46void PPCELFMCAsmInfo::anchor() { } 47 PPCELFMCAsmInfo(bool is64Bit,const Triple & T)48PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) { 49 // FIXME: This is not always needed. For example, it is not needed in the 50 // v2 abi. 51 NeedsLocalForSize = true; 52 53 if (is64Bit) { 54 CodePointerSize = CalleeSaveStackSlotSize = 8; 55 } 56 IsLittleEndian = T.getArch() == Triple::ppc64le; 57 58 // ".comm align is in bytes but .align is pow-2." 59 AlignmentIsInBytes = false; 60 61 CommentString = "#"; 62 63 // Uses '.section' before '.bss' directive 64 UsesELFSectionDirectiveForBSS = true; 65 66 // Debug Information 67 SupportsDebugInformation = true; 68 69 DollarIsPC = true; 70 71 // Set up DWARF directives 72 MinInstAlignment = 4; 73 74 // Exceptions handling 75 ExceptionsType = ExceptionHandling::DwarfCFI; 76 77 ZeroDirective = "\t.space\t"; 78 Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr; 79 AssemblerDialect = 1; // New-Style mnemonics. 80 LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment; 81 82 UseIntegratedAssembler = true; 83 } 84 85