ARMMCAsmInfo.cpp revision dce4a407a24b04eebc6a376f8e62b41aaa7b071f
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
18using namespace llvm;
19
20void ARMMCAsmInfoDarwin::anchor() { }
21
22ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(StringRef TT) {
23  Triple TheTriple(TT);
24  if ((TheTriple.getArch() == Triple::armeb) ||
25      (TheTriple.getArch() == Triple::thumbeb))
26    IsLittleEndian = false;
27
28  Data64bitsDirective = nullptr;
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
42void ARMELFMCAsmInfo::anchor() { }
43
44ARMELFMCAsmInfo::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 = nullptr;
54  CommentString = "@";
55  Code16Directive = ".code\t16";
56  Code32Directive = ".code\t32";
57
58  HasLEB128 = true;
59  SupportsDebugInformation = true;
60
61  // Exceptions handling
62  switch (TheTriple.getOS()) {
63  case Triple::NetBSD:
64    ExceptionsType = ExceptionHandling::DwarfCFI;
65    break;
66  default:
67    ExceptionsType = ExceptionHandling::ARM;
68    break;
69  }
70
71  // foo(plt) instead of foo@plt
72  UseParensForSymbolVariant = true;
73
74  UseIntegratedAssembler = true;
75}
76
77void 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;
84  }
85}
86
87void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
88
89ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
90  AlignmentIsInBytes = false;
91
92  PrivateGlobalPrefix = "$M";
93}
94
95void ARMCOFFMCAsmInfoGNU::anchor() { }
96
97ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
98  AlignmentIsInBytes = false;
99  HasSingleParameterDotFile = true;
100
101  CommentString = "@";
102  Code16Directive = ".code\t16";
103  Code32Directive = ".code\t32";
104  PrivateGlobalPrefix = ".L";
105
106  HasLEB128 = true;
107  SupportsDebugInformation = true;
108  ExceptionsType = ExceptionHandling::None;
109  UseParensForSymbolVariant = true;
110
111  UseIntegratedAssembler = false;
112  DwarfRegNumForCFI = true;
113}
114
115