/src/keystone/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
Line | Count | Source |
1 | | //===-- ARMMCAsmInfo.cpp - ARM 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 ARMMCAsmInfo properties. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #include "ARMMCAsmInfo.h" |
15 | | #include "llvm/ADT/Triple.h" |
16 | | |
17 | | using namespace llvm_ks; |
18 | | |
19 | 0 | ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) { |
20 | 0 | if ((TheTriple.getArch() == Triple::armeb) || |
21 | 0 | (TheTriple.getArch() == Triple::thumbeb)) |
22 | 0 | IsLittleEndian = false; |
23 | |
|
24 | 0 | Data64bitsDirective = nullptr; |
25 | 0 | CommentString = "@"; |
26 | 0 | Code16Directive = ".code\t16"; |
27 | 0 | Code32Directive = ".code\t32"; |
28 | 0 | UseDataRegionDirectives = true; |
29 | |
|
30 | 0 | SupportsDebugInformation = true; |
31 | | |
32 | | // Exceptions handling |
33 | 0 | ExceptionsType = (TheTriple.isOSDarwin() && !TheTriple.isWatchABI()) |
34 | 0 | ? ExceptionHandling::SjLj |
35 | 0 | : ExceptionHandling::DwarfCFI; |
36 | |
|
37 | 0 | UseIntegratedAssembler = true; |
38 | 0 | } |
39 | | |
40 | 60.6k | ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) { |
41 | 60.6k | if ((TheTriple.getArch() == Triple::armeb) || |
42 | 48.4k | (TheTriple.getArch() == Triple::thumbeb)) |
43 | 26.4k | IsLittleEndian = false; |
44 | | |
45 | | // ".comm align is in bytes but .align is pow-2." |
46 | 60.6k | AlignmentIsInBytes = false; |
47 | | |
48 | 60.6k | Data64bitsDirective = nullptr; |
49 | 60.6k | CommentString = "@"; |
50 | 60.6k | Code16Directive = ".code\t16"; |
51 | 60.6k | Code32Directive = ".code\t32"; |
52 | | |
53 | 60.6k | SupportsDebugInformation = true; |
54 | | |
55 | | // Exceptions handling |
56 | 60.6k | switch (TheTriple.getOS()) { |
57 | 0 | case Triple::Bitrig: |
58 | 0 | case Triple::NetBSD: |
59 | 0 | ExceptionsType = ExceptionHandling::DwarfCFI; |
60 | 0 | break; |
61 | 60.6k | default: |
62 | 60.6k | ExceptionsType = ExceptionHandling::ARM; |
63 | 60.6k | break; |
64 | 60.6k | } |
65 | | |
66 | | // foo(plt) instead of foo@plt |
67 | 60.6k | UseParensForSymbolVariant = true; |
68 | | |
69 | 60.6k | UseIntegratedAssembler = true; |
70 | 60.6k | } |
71 | | |
72 | 0 | void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) { |
73 | 0 | UseIntegratedAssembler = Value; |
74 | 0 | if (!UseIntegratedAssembler) { |
75 | | // gas doesn't handle VFP register names in cfi directives, |
76 | | // so don't use register names with external assembler. |
77 | | // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694 |
78 | 0 | DwarfRegNumForCFI = true; |
79 | 0 | } |
80 | 0 | } |
81 | | |
82 | 0 | ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() { |
83 | 0 | AlignmentIsInBytes = false; |
84 | |
|
85 | 0 | PrivateGlobalPrefix = "$M"; |
86 | 0 | PrivateLabelPrefix = "$M"; |
87 | 0 | } |
88 | | |
89 | 0 | ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() { |
90 | 0 | AlignmentIsInBytes = false; |
91 | 0 | HasSingleParameterDotFile = true; |
92 | |
|
93 | 0 | CommentString = "@"; |
94 | 0 | Code16Directive = ".code\t16"; |
95 | 0 | Code32Directive = ".code\t32"; |
96 | 0 | PrivateGlobalPrefix = ".L"; |
97 | 0 | PrivateLabelPrefix = ".L"; |
98 | |
|
99 | 0 | SupportsDebugInformation = true; |
100 | 0 | ExceptionsType = ExceptionHandling::None; |
101 | 0 | UseParensForSymbolVariant = true; |
102 | |
|
103 | 0 | UseIntegratedAssembler = false; |
104 | 0 | DwarfRegNumForCFI = true; |
105 | 0 | } |
106 | | |