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