1 //===-- ARMMCAsmInfo.cpp - ARM asm properties -----------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the ARMMCAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "ARMMCAsmInfo.h"
15 #include "llvm/Support/CommandLine.h"
16 #include "llvm/ADT/Triple.h"
17 
18 using namespace llvm;
19 
20 void ARMMCAsmInfoDarwin::anchor() { }
21 
22 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(StringRef TT) {
23   Triple TheTriple(TT);
24   if ((TheTriple.getArch() == Triple::armeb) ||
25       (TheTriple.getArch() == Triple::thumbeb))
26     IsLittleEndian = false;
27 
28   Data64bitsDirective = 0;
29   CommentString = "@";
30   Code16Directive = ".code\t16";
31   Code32Directive = ".code\t32";
32   UseDataRegionDirectives = true;
33 
34   SupportsDebugInformation = true;
35 
36   // Exceptions handling
37   ExceptionsType = ExceptionHandling::SjLj;
38 
39   UseIntegratedAssembler = true;
40 }
41 
42 void ARMELFMCAsmInfo::anchor() { }
43 
44 ARMELFMCAsmInfo::ARMELFMCAsmInfo(StringRef TT) {
45   Triple TheTriple(TT);
46   if ((TheTriple.getArch() == Triple::armeb) ||
47       (TheTriple.getArch() == Triple::thumbeb))
48     IsLittleEndian = false;
49 
50   // ".comm align is in bytes but .align is pow-2."
51   AlignmentIsInBytes = false;
52 
53   Data64bitsDirective = 0;
54   CommentString = "@";
55   Code16Directive = ".code\t16";
56   Code32Directive = ".code\t32";
57 
58   HasLEB128 = true;
59   SupportsDebugInformation = true;
60 
61   // Exceptions handling
62   ExceptionsType = ExceptionHandling::ARM;
63 
64   // foo(plt) instead of foo@plt
65   UseParensForSymbolVariant = true;
66 
67   UseIntegratedAssembler = true;
68 }
69 
70 void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) {
71   UseIntegratedAssembler = Value;
72   if (!UseIntegratedAssembler) {
73     // gas doesn't handle VFP register names in cfi directives,
74     // so don't use register names with external assembler.
75     // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
76     DwarfRegNumForCFI = true;
77   }
78 }
79 
80 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
81 
82 ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
83   AlignmentIsInBytes = false;
84 
85   PrivateGlobalPrefix = "$M";
86 }
87 
88 void ARMCOFFMCAsmInfoGNU::anchor() { }
89 
90 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
91   AlignmentIsInBytes = false;
92 
93   CommentString = "@";
94   Code16Directive = ".code\t16";
95   Code32Directive = ".code\t32";
96   PrivateGlobalPrefix = ".L";
97 
98   HasLEB128 = true;
99   SupportsDebugInformation = true;
100   ExceptionsType = ExceptionHandling::None;
101   UseParensForSymbolVariant = true;
102 
103   UseIntegratedAssembler = false;
104   DwarfRegNumForCFI = true;
105 }
106 
107