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"
16 #include "llvm/Support/CommandLine.h"
20 void ARMMCAsmInfoDarwin::anchor() { }
22 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) {
23 if ((TheTriple.getArch() == Triple::armeb) ||
24 (TheTriple.getArch() == Triple::thumbeb))
25 IsLittleEndian = false;
27 Data64bitsDirective = nullptr;
29 Code16Directive = ".code\t16";
30 Code32Directive = ".code\t32";
31 UseDataRegionDirectives = true;
33 SupportsDebugInformation = true;
35 // Exceptions handling
36 ExceptionsType = TheTriple.isOSDarwin() && !TheTriple.isWatchOS()
37 ? ExceptionHandling::SjLj
38 : ExceptionHandling::DwarfCFI;
40 UseIntegratedAssembler = true;
43 void ARMELFMCAsmInfo::anchor() { }
45 ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
46 if ((TheTriple.getArch() == Triple::armeb) ||
47 (TheTriple.getArch() == Triple::thumbeb))
48 IsLittleEndian = false;
50 // ".comm align is in bytes but .align is pow-2."
51 AlignmentIsInBytes = false;
53 Data64bitsDirective = nullptr;
55 Code16Directive = ".code\t16";
56 Code32Directive = ".code\t32";
58 SupportsDebugInformation = true;
60 // Exceptions handling
61 switch (TheTriple.getOS()) {
64 ExceptionsType = ExceptionHandling::DwarfCFI;
67 ExceptionsType = ExceptionHandling::ARM;
71 // foo(plt) instead of foo@plt
72 UseParensForSymbolVariant = true;
74 UseIntegratedAssembler = true;
77 void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) {
78 UseIntegratedAssembler = Value;
79 if (!UseIntegratedAssembler) {
80 // gas doesn't handle VFP register names in cfi directives,
81 // so don't use register names with external assembler.
82 // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
83 DwarfRegNumForCFI = true;
87 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
89 ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
90 AlignmentIsInBytes = false;
92 PrivateGlobalPrefix = "$M";
93 PrivateLabelPrefix = "$M";
96 void ARMCOFFMCAsmInfoGNU::anchor() { }
98 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
99 AlignmentIsInBytes = false;
100 HasSingleParameterDotFile = true;
103 Code16Directive = ".code\t16";
104 Code32Directive = ".code\t32";
105 PrivateGlobalPrefix = ".L";
106 PrivateLabelPrefix = ".L";
108 SupportsDebugInformation = true;
109 ExceptionsType = ExceptionHandling::None;
110 UseParensForSymbolVariant = true;
112 UseIntegratedAssembler = false;
113 DwarfRegNumForCFI = true;