LLVM API Documentation
00001 //===-- ARMMCAsmInfo.cpp - ARM asm properties -----------------------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains the declarations of the ARMMCAsmInfo properties. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #include "ARMMCAsmInfo.h" 00015 #include "llvm/Support/CommandLine.h" 00016 #include "llvm/ADT/Triple.h" 00017 00018 using namespace llvm; 00019 00020 void ARMMCAsmInfoDarwin::anchor() { } 00021 00022 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(StringRef TT) { 00023 Triple TheTriple(TT); 00024 if ((TheTriple.getArch() == Triple::armeb) || 00025 (TheTriple.getArch() == Triple::thumbeb)) 00026 IsLittleEndian = false; 00027 00028 Data64bitsDirective = nullptr; 00029 CommentString = "@"; 00030 Code16Directive = ".code\t16"; 00031 Code32Directive = ".code\t32"; 00032 UseDataRegionDirectives = true; 00033 00034 SupportsDebugInformation = true; 00035 00036 // Exceptions handling 00037 ExceptionsType = ExceptionHandling::SjLj; 00038 00039 UseIntegratedAssembler = true; 00040 } 00041 00042 void ARMELFMCAsmInfo::anchor() { } 00043 00044 ARMELFMCAsmInfo::ARMELFMCAsmInfo(StringRef TT) { 00045 Triple TheTriple(TT); 00046 if ((TheTriple.getArch() == Triple::armeb) || 00047 (TheTriple.getArch() == Triple::thumbeb)) 00048 IsLittleEndian = false; 00049 00050 // ".comm align is in bytes but .align is pow-2." 00051 AlignmentIsInBytes = false; 00052 00053 Data64bitsDirective = nullptr; 00054 CommentString = "@"; 00055 Code16Directive = ".code\t16"; 00056 Code32Directive = ".code\t32"; 00057 00058 SupportsDebugInformation = true; 00059 00060 // Exceptions handling 00061 switch (TheTriple.getOS()) { 00062 case Triple::NetBSD: 00063 ExceptionsType = ExceptionHandling::DwarfCFI; 00064 break; 00065 default: 00066 ExceptionsType = ExceptionHandling::ARM; 00067 break; 00068 } 00069 00070 // foo(plt) instead of foo@plt 00071 UseParensForSymbolVariant = true; 00072 00073 UseIntegratedAssembler = true; 00074 } 00075 00076 void ARMELFMCAsmInfo::setUseIntegratedAssembler(bool Value) { 00077 UseIntegratedAssembler = Value; 00078 if (!UseIntegratedAssembler) { 00079 // gas doesn't handle VFP register names in cfi directives, 00080 // so don't use register names with external assembler. 00081 // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694 00082 DwarfRegNumForCFI = true; 00083 } 00084 } 00085 00086 void ARMCOFFMCAsmInfoMicrosoft::anchor() { } 00087 00088 ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() { 00089 AlignmentIsInBytes = false; 00090 00091 PrivateGlobalPrefix = "$M"; 00092 } 00093 00094 void ARMCOFFMCAsmInfoGNU::anchor() { } 00095 00096 ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() { 00097 AlignmentIsInBytes = false; 00098 HasSingleParameterDotFile = true; 00099 00100 CommentString = "@"; 00101 Code16Directive = ".code\t16"; 00102 Code32Directive = ".code\t32"; 00103 PrivateGlobalPrefix = ".L"; 00104 00105 SupportsDebugInformation = true; 00106 ExceptionsType = ExceptionHandling::None; 00107 UseParensForSymbolVariant = true; 00108 00109 UseIntegratedAssembler = false; 00110 DwarfRegNumForCFI = true; 00111 } 00112