ARMMCAsmInfo.cpp revision 224133
1//===-- ARMMCAsmInfo.cpp - ARM asm properties -------------------*- C++ -*-===//
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
17using namespace llvm;
18
19cl::opt<bool>
20EnableARMEHABI("arm-enable-ehabi", cl::Hidden,
21  cl::desc("Generate ARM EHABI tables"),
22  cl::init(false));
23
24
25static const char *const arm_asm_table[] = {
26  "{r0}", "r0",
27  "{r1}", "r1",
28  "{r2}", "r2",
29  "{r3}", "r3",
30  "{r4}", "r4",
31  "{r5}", "r5",
32  "{r6}", "r6",
33  "{r7}", "r7",
34  "{r8}", "r8",
35  "{r9}", "r9",
36  "{r10}", "r10",
37  "{r11}", "r11",
38  "{r12}", "r12",
39  "{r13}", "r13",
40  "{r14}", "r14",
41  "{lr}", "lr",
42  "{sp}", "sp",
43  "{ip}", "ip",
44  "{fp}", "fp",
45  "{sl}", "sl",
46  "{memory}", "memory",
47  "{cc}", "cc",
48  0,0
49};
50
51ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() {
52  AsmTransCBE = arm_asm_table;
53  Data64bitsDirective = 0;
54  CommentString = "@";
55  SupportsDebugInformation = true;
56
57  // Exceptions handling
58  ExceptionsType = ExceptionHandling::SjLj;
59}
60
61ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
62  // ".comm align is in bytes but .align is pow-2."
63  AlignmentIsInBytes = false;
64
65  Data64bitsDirective = 0;
66  CommentString = "@";
67
68  HasLEB128 = true;
69  PrivateGlobalPrefix = ".L";
70  WeakRefDirective = "\t.weak\t";
71  HasLCOMMDirective = true;
72
73  SupportsDebugInformation = true;
74
75  // Exceptions handling
76  if (EnableARMEHABI)
77    ExceptionsType = ExceptionHandling::ARM;
78}
79