1 //===-- ARMMCAsmInfo.cpp - ARM asm properties -----------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the ARMMCAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "ARMMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
19 void ARMMCAsmInfoDarwin::anchor() { }
21 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) {
22 if ((TheTriple.getArch() == Triple::armeb) ||
23 (TheTriple.getArch() == Triple::thumbeb))
24 IsLittleEndian = false;
26 Data64bitsDirective = nullptr;
28 Code16Directive = ".code\t16";
29 Code32Directive = ".code\t32";
30 UseDataRegionDirectives = true;
32 SupportsDebugInformation = true;
34 // Conditional Thumb 4-byte instructions can have an implicit IT.
37 // Exceptions handling
38 ExceptionsType = (TheTriple.isOSDarwin() && !TheTriple.isWatchABI())
39 ? ExceptionHandling::SjLj
40 : ExceptionHandling::DwarfCFI;
42 UseIntegratedAssembler = true;
45 void ARMELFMCAsmInfo::anchor() { }
47 ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
48 if ((TheTriple.getArch() == Triple::armeb) ||
49 (TheTriple.getArch() == Triple::thumbeb))
50 IsLittleEndian = false;
52 // ".comm align is in bytes but .align is pow-2."
53 AlignmentIsInBytes = false;
55 Data64bitsDirective = nullptr;
57 Code16Directive = ".code\t16";
58 Code32Directive = ".code\t32";
60 SupportsDebugInformation = true;
62 // Conditional Thumb 4-byte instructions can have an implicit IT.
65 // Exceptions handling
66 switch (TheTriple.getOS()) {
68 ExceptionsType = ExceptionHandling::DwarfCFI;
71 ExceptionsType = ExceptionHandling::ARM;
75 // foo(plt) instead of foo@plt
76 UseParensForSymbolVariant = true;
78 UseIntegratedAssembler = true;
81 void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) {
82 UseIntegratedAssembler = Value;
83 if (!UseIntegratedAssembler) {
84 // gas doesn't handle VFP register names in cfi directives,
85 // so don't use register names with external assembler.
86 // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
87 DwarfRegNumForCFI = true;
91 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
93 ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
94 AlignmentIsInBytes = false;
95 ExceptionsType = ExceptionHandling::WinEH;
96 PrivateGlobalPrefix = "$M";
97 PrivateLabelPrefix = "$M";
100 // Conditional Thumb 4-byte instructions can have an implicit IT.
104 void ARMCOFFMCAsmInfoGNU::anchor() { }
106 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
107 AlignmentIsInBytes = false;
108 HasSingleParameterDotFile = true;
111 Code16Directive = ".code\t16";
112 Code32Directive = ".code\t32";
113 PrivateGlobalPrefix = ".L";
114 PrivateLabelPrefix = ".L";
116 SupportsDebugInformation = true;
117 ExceptionsType = ExceptionHandling::DwarfCFI;
118 UseParensForSymbolVariant = true;
120 UseIntegratedAssembler = true;
121 DwarfRegNumForCFI = false;
123 // Conditional Thumb 4-byte instructions can have an implicit IT.