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 = ExceptionHandling::SjLj;
38 UseIntegratedAssembler = true;
41 void ARMELFMCAsmInfo::anchor() { }
43 ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
44 if ((TheTriple.getArch() == Triple::armeb) ||
45 (TheTriple.getArch() == Triple::thumbeb))
46 IsLittleEndian = false;
48 // ".comm align is in bytes but .align is pow-2."
49 AlignmentIsInBytes = false;
51 Data64bitsDirective = nullptr;
53 Code16Directive = ".code\t16";
54 Code32Directive = ".code\t32";
56 SupportsDebugInformation = true;
58 // Exceptions handling
59 switch (TheTriple.getOS()) {
62 ExceptionsType = ExceptionHandling::DwarfCFI;
65 ExceptionsType = ExceptionHandling::ARM;
69 // foo(plt) instead of foo@plt
70 UseParensForSymbolVariant = true;
72 UseIntegratedAssembler = true;
75 void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) {
76 UseIntegratedAssembler = Value;
77 if (!UseIntegratedAssembler) {
78 // gas doesn't handle VFP register names in cfi directives,
79 // so don't use register names with external assembler.
80 // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
81 DwarfRegNumForCFI = true;
85 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
87 ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
88 AlignmentIsInBytes = false;
90 PrivateGlobalPrefix = "$M";
91 PrivateLabelPrefix = "$M";
94 void ARMCOFFMCAsmInfoGNU::anchor() { }
96 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
97 AlignmentIsInBytes = false;
98 HasSingleParameterDotFile = true;
101 Code16Directive = ".code\t16";
102 Code32Directive = ".code\t32";
103 PrivateGlobalPrefix = ".L";
104 PrivateLabelPrefix = ".L";
106 SupportsDebugInformation = true;
107 ExceptionsType = ExceptionHandling::None;
108 UseParensForSymbolVariant = true;
110 UseIntegratedAssembler = false;
111 DwarfRegNumForCFI = true;