blob: d1804a2e45b1e74790c4fabd14e5eb9fe2f02d7a [file] [log] [blame]
Chris Lattner7b26fce2009-08-22 20:48:53 +00001//===-- ARMMCAsmInfo.cpp - ARM asm properties -------------------*- C++ -*-===//
Jim Laskey0e835412006-09-07 22:05:02 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey0e835412006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner7b26fce2009-08-22 20:48:53 +000010// This file contains the declarations of the ARMMCAsmInfo properties.
Jim Laskey0e835412006-09-07 22:05:02 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner7b26fce2009-08-22 20:48:53 +000014#include "ARMMCAsmInfo.h"
Anton Korobeynikova7ec2dc2011-03-05 18:43:15 +000015#include "llvm/Support/CommandLine.h"
16
Jim Laskey0e835412006-09-07 22:05:02 +000017using namespace llvm;
18
Anton Korobeynikove7410dd2011-03-05 18:43:32 +000019cl::opt<bool>
Anton Korobeynikova7ec2dc2011-03-05 18:43:15 +000020EnableARMEHABI("arm-enable-ehabi", cl::Hidden,
21 cl::desc("Generate ARM EHABI tables"),
22 cl::init(false));
23
24
Chris Lattnerf710f712009-08-11 22:14:59 +000025static const char *const arm_asm_table[] = {
Chris Lattnerb8476452009-06-18 23:41:35 +000026 "{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};
Lauro Ramos Venancioc7ebbaa2007-06-08 21:06:23 +000050
David Blaikiea379b1812011-12-20 02:50:00 +000051void ARMMCAsmInfoDarwin::anchor() { }
52
Chris Lattner2b4364f2010-01-20 06:34:14 +000053ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() {
Chris Lattnerf710f712009-08-11 22:14:59 +000054 AsmTransCBE = arm_asm_table;
Chris Lattnerf710f712009-08-11 22:14:59 +000055 Data64bitsDirective = 0;
56 CommentString = "@";
Evan Cheng481ebb02011-07-27 00:38:12 +000057 Code16Directive = ".code\t16";
58 Code32Directive = ".code\t32";
59
Devang Patel33f4eb42009-06-19 21:54:26 +000060 SupportsDebugInformation = true;
Jim Grosbach693e36a2009-08-11 00:09:57 +000061
62 // Exceptions handling
63 ExceptionsType = ExceptionHandling::SjLj;
Anton Korobeynikov04083522008-08-07 09:54:23 +000064}
65
David Blaikiea379b1812011-12-20 02:50:00 +000066void ARMELFMCAsmInfo::anchor() { }
67
Chris Lattner2b4364f2010-01-20 06:34:14 +000068ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
Rafael Espindoladcb03f02010-01-26 20:21:43 +000069 // ".comm align is in bytes but .align is pow-2."
70 AlignmentIsInBytes = false;
71
Chris Lattnerf710f712009-08-11 22:14:59 +000072 Data64bitsDirective = 0;
73 CommentString = "@";
Anton Korobeynikov04083522008-08-07 09:54:23 +000074 PrivateGlobalPrefix = ".L";
Evan Cheng481ebb02011-07-27 00:38:12 +000075 Code16Directive = ".code\t16";
76 Code32Directive = ".code\t32";
77
Anton Korobeynikov04083522008-08-07 09:54:23 +000078 WeakRefDirective = "\t.weak\t";
Benjamin Kramer63970512011-09-01 23:04:27 +000079 LCOMMDirectiveType = LCOMM::NoAlignment;
Chris Lattner7faf1fd2009-08-11 22:06:07 +000080
Evan Cheng481ebb02011-07-27 00:38:12 +000081 HasLEB128 = true;
Devang Patel33f4eb42009-06-19 21:54:26 +000082 SupportsDebugInformation = true;
Anton Korobeynikova7ec2dc2011-03-05 18:43:15 +000083
84 // Exceptions handling
85 if (EnableARMEHABI)
86 ExceptionsType = ExceptionHandling::ARM;
Anton Korobeynikov04083522008-08-07 09:54:23 +000087}