]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / Target / PowerPC / MCTargetDesc / PPCMCAsmInfo.cpp
CommitLineData
223e47cc
LB
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"
1a4d82fc
JJ
15#include "llvm/ADT/Triple.h"
16
223e47cc
LB
17using namespace llvm;
18
19void PPCMCAsmInfoDarwin::anchor() { }
20
1a4d82fc 21PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
970d7e83
LB
22 if (is64Bit) {
23 PointerSize = CalleeSaveStackSlotSize = 8;
24 }
223e47cc
LB
25 IsLittleEndian = false;
26
223e47cc
LB
27 CommentString = ";";
28 ExceptionsType = ExceptionHandling::DwarfCFI;
29
30 if (!is64Bit)
1a4d82fc 31 Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode.
223e47cc
LB
32
33 AssemblerDialect = 1; // New-Style mnemonics.
34 SupportsDebugInformation= true; // Debug information.
1a4d82fc
JJ
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 UseIntegratedAssembler = true;
223e47cc
LB
43}
44
1a4d82fc 45void PPCELFMCAsmInfo::anchor() { }
223e47cc 46
1a4d82fc 47PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
970d7e83
LB
48 if (is64Bit) {
49 PointerSize = CalleeSaveStackSlotSize = 8;
50 }
1a4d82fc 51 IsLittleEndian = T.getArch() == Triple::ppc64le;
223e47cc
LB
52
53 // ".comm align is in bytes but .align is pow-2."
54 AlignmentIsInBytes = false;
55
56 CommentString = "#";
1a4d82fc 57
223e47cc
LB
58 // Uses '.section' before '.bss' directive
59 UsesELFSectionDirectiveForBSS = true;
60
61 // Debug Information
62 SupportsDebugInformation = true;
63
1a4d82fc 64 DollarIsPC = true;
223e47cc
LB
65
66 // Set up DWARF directives
1a4d82fc 67 MinInstAlignment = 4;
223e47cc
LB
68
69 // Exceptions handling
70 ExceptionsType = ExceptionHandling::DwarfCFI;
71
72 ZeroDirective = "\t.space\t";
1a4d82fc
JJ
73 Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;
74 AssemblerDialect = 1; // New-Style mnemonics.
75 LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
76
85aaf69f 77 UseIntegratedAssembler = true;
223e47cc
LB
78}
79