1 //===-- ARMMCAsmInfo.cpp - ARM asm properties -----------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains the declarations of the ARMMCAsmInfo properties.
11 //===----------------------------------------------------------------------===//
13 #include "ARMMCAsmInfo.h"
14 #include "llvm/ADT/Triple.h"
18 void ARMMCAsmInfoDarwin::anchor() { }
20 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple
&TheTriple
) {
21 if ((TheTriple
.getArch() == Triple::armeb
) ||
22 (TheTriple
.getArch() == Triple::thumbeb
))
23 IsLittleEndian
= false;
25 Data64bitsDirective
= nullptr;
27 Code16Directive
= ".code\t16";
28 Code32Directive
= ".code\t32";
29 UseDataRegionDirectives
= true;
31 SupportsDebugInformation
= true;
33 // Conditional Thumb 4-byte instructions can have an implicit IT.
36 // Exceptions handling
37 ExceptionsType
= (TheTriple
.isOSDarwin() && !TheTriple
.isWatchABI())
38 ? ExceptionHandling::SjLj
39 : ExceptionHandling::DwarfCFI
;
42 void ARMELFMCAsmInfo::anchor() { }
44 ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple
&TheTriple
) {
45 if ((TheTriple
.getArch() == Triple::armeb
) ||
46 (TheTriple
.getArch() == Triple::thumbeb
))
47 IsLittleEndian
= false;
49 // ".comm align is in bytes but .align is pow-2."
50 AlignmentIsInBytes
= false;
52 Data64bitsDirective
= nullptr;
54 Code16Directive
= ".code\t16";
55 Code32Directive
= ".code\t32";
57 SupportsDebugInformation
= true;
59 // Conditional Thumb 4-byte instructions can have an implicit IT.
62 // Exceptions handling
63 switch (TheTriple
.getOS()) {
65 ExceptionsType
= ExceptionHandling::DwarfCFI
;
68 ExceptionsType
= ExceptionHandling::ARM
;
72 // foo(plt) instead of foo@plt
73 UseParensForSymbolVariant
= true;
76 void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value
) {
77 UseIntegratedAssembler
= Value
;
78 if (!UseIntegratedAssembler
) {
79 // gas doesn't handle VFP register names in cfi directives,
80 // so don't use register names with external assembler.
81 // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
82 DwarfRegNumForCFI
= true;
86 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
88 ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
89 AlignmentIsInBytes
= false;
90 SupportsDebugInformation
= true;
91 ExceptionsType
= ExceptionHandling::WinEH
;
92 PrivateGlobalPrefix
= "$M";
93 PrivateLabelPrefix
= "$M";
96 // Conditional Thumb 4-byte instructions can have an implicit IT.
100 void ARMCOFFMCAsmInfoGNU::anchor() { }
102 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
103 AlignmentIsInBytes
= false;
104 HasSingleParameterDotFile
= true;
107 Code16Directive
= ".code\t16";
108 Code32Directive
= ".code\t32";
109 PrivateGlobalPrefix
= ".L";
110 PrivateLabelPrefix
= ".L";
112 SupportsDebugInformation
= true;
113 ExceptionsType
= ExceptionHandling::DwarfCFI
;
114 UseParensForSymbolVariant
= true;
116 DwarfRegNumForCFI
= false;
118 // Conditional Thumb 4-byte instructions can have an implicit IT.