Home | History | Annotate | Download | only in MCTargetDesc
      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 
     17 using namespace llvm;
     18 
     19 cl::opt<bool>
     20 EnableARMEHABI("arm-enable-ehabi", cl::Hidden,
     21   cl::desc("Generate ARM EHABI tables"),
     22   cl::init(false));
     23 
     24 
     25 static 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 
     51 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() {
     52   AsmTransCBE = arm_asm_table;
     53   Data64bitsDirective = 0;
     54   CommentString = "@";
     55   Code16Directive = ".code\t16";
     56   Code32Directive = ".code\t32";
     57 
     58   SupportsDebugInformation = true;
     59 
     60   // Exceptions handling
     61   ExceptionsType = ExceptionHandling::SjLj;
     62 }
     63 
     64 ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
     65   // ".comm align is in bytes but .align is pow-2."
     66   AlignmentIsInBytes = false;
     67 
     68   Data64bitsDirective = 0;
     69   CommentString = "@";
     70   PrivateGlobalPrefix = ".L";
     71   Code16Directive = ".code\t16";
     72   Code32Directive = ".code\t32";
     73 
     74   WeakRefDirective = "\t.weak\t";
     75   LCOMMDirectiveType = LCOMM::NoAlignment;
     76 
     77   HasLEB128 = true;
     78   SupportsDebugInformation = true;
     79 
     80   // Exceptions handling
     81   if (EnableARMEHABI)
     82     ExceptionsType = ExceptionHandling::ARM;
     83 }
     84