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 19 void PPCMCAsmInfoDarwin::anchor() { } 20 21 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) { 22 if (is64Bit) { 23 PointerSize = CalleeSaveStackSlotSize = 8; 24 } 25 IsLittleEndian = false; 26 27 CommentString = ";"; 28 ExceptionsType = ExceptionHandling::DwarfCFI; 29 30 if (!is64Bit) 31 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. 32 33 AssemblerDialect = 1; // New-Style mnemonics. 34 SupportsDebugInformation= true; // Debug information. 35 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; 41 } 42 43 void PPCLinuxMCAsmInfo::anchor() { } 44 45 PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { 46 if (is64Bit) { 47 PointerSize = CalleeSaveStackSlotSize = 8; 48 } 49 IsLittleEndian = false; 50 51 // ".comm align is in bytes but .align is pow-2." 52 AlignmentIsInBytes = false; 53 54 CommentString = "#"; 55 56 // Uses '.section' before '.bss' directive 57 UsesELFSectionDirectiveForBSS = true; 58 59 // Debug Information 60 SupportsDebugInformation = true; 61 62 DollarIsPC = true; 63 64 // Set up DWARF directives 65 HasLEB128 = true; // Target asm supports leb128 directives (little-endian) 66 MinInstAlignment = 4; 67 68 // Exceptions handling 69 ExceptionsType = ExceptionHandling::DwarfCFI; 70 71 ZeroDirective = "\t.space\t"; 72 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0; 73 AssemblerDialect = 1; // New-Style mnemonics. 74 } 75 76