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.isWatchOS() ? ExceptionHandling::DwarfCFI
37 : ExceptionHandling::SjLj;
39 UseIntegratedAssembler = true;
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 // Exceptions handling
60 switch (TheTriple.getOS()) {
63 ExceptionsType = ExceptionHandling::DwarfCFI;
66 ExceptionsType = ExceptionHandling::ARM;
70 // foo(plt) instead of foo@plt
71 UseParensForSymbolVariant = true;
73 UseIntegratedAssembler = 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;
91 PrivateGlobalPrefix = "$M";
92 PrivateLabelPrefix = "$M";
95 void ARMCOFFMCAsmInfoGNU::anchor() { }
97 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
98 AlignmentIsInBytes = false;
99 HasSingleParameterDotFile = true;
102 Code16Directive = ".code\t16";
103 Code32Directive = ".code\t32";
104 PrivateGlobalPrefix = ".L";
105 PrivateLabelPrefix = ".L";
107 SupportsDebugInformation = true;
108 ExceptionsType = ExceptionHandling::None;
109 UseParensForSymbolVariant = true;
111 UseIntegratedAssembler = false;
112 DwarfRegNumForCFI = true;