LLVM  10.0.0svn
ARMMCAsmInfo.cpp
Go to the documentation of this file.
1 //===-- ARMMCAsmInfo.cpp - ARM asm properties -----------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the ARMMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "ARMMCAsmInfo.h"
14 #include "llvm/ADT/Triple.h"
15 
16 using namespace llvm;
17 
18 void ARMMCAsmInfoDarwin::anchor() { }
19 
21  if ((TheTriple.getArch() == Triple::armeb) ||
22  (TheTriple.getArch() == Triple::thumbeb))
23  IsLittleEndian = false;
24 
25  Data64bitsDirective = nullptr;
26  CommentString = "@";
27  Code16Directive = ".code\t16";
28  Code32Directive = ".code\t32";
30 
32 
33  // Conditional Thumb 4-byte instructions can have an implicit IT.
34  MaxInstLength = 6;
35 
36  // Exceptions handling
37  ExceptionsType = (TheTriple.isOSDarwin() && !TheTriple.isWatchABI())
40 
42 }
43 
44 void ARMELFMCAsmInfo::anchor() { }
45 
47  if ((TheTriple.getArch() == Triple::armeb) ||
48  (TheTriple.getArch() == Triple::thumbeb))
49  IsLittleEndian = false;
50 
51  // ".comm align is in bytes but .align is pow-2."
52  AlignmentIsInBytes = false;
53 
54  Data64bitsDirective = nullptr;
55  CommentString = "@";
56  Code16Directive = ".code\t16";
57  Code32Directive = ".code\t32";
58 
60 
61  // Conditional Thumb 4-byte instructions can have an implicit IT.
62  MaxInstLength = 6;
63 
64  // Exceptions handling
65  switch (TheTriple.getOS()) {
66  case Triple::NetBSD:
68  break;
69  default:
71  break;
72  }
73 
74  // foo(plt) instead of foo@plt
76 
78 }
79 
83  // gas doesn't handle VFP register names in cfi directives,
84  // so don't use register names with external assembler.
85  // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
86  DwarfRegNumForCFI = true;
87  }
88 }
89 
90 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
91 
93  AlignmentIsInBytes = false;
95  PrivateGlobalPrefix = "$M";
96  PrivateLabelPrefix = "$M";
97  CommentString = ";";
98 
99  // Conditional Thumb 4-byte instructions can have an implicit IT.
100  MaxInstLength = 6;
101 }
102 
103 void ARMCOFFMCAsmInfoGNU::anchor() { }
104 
106  AlignmentIsInBytes = false;
108 
109  CommentString = "@";
110  Code16Directive = ".code\t16";
111  Code32Directive = ".code\t32";
112  PrivateGlobalPrefix = ".L";
113  PrivateLabelPrefix = ".L";
114 
118 
119  UseIntegratedAssembler = true;
120  DwarfRegNumForCFI = false;
121 
122  // Conditional Thumb 4-byte instructions can have an implicit IT.
123  MaxInstLength = 6;
124 }
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:287
const char * Code16Directive
These are assembly directives that tells the assembler to interpret the following instructions differ...
Definition: MCAsmInfo.h:148
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
Definition: Triple.h:481
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:379
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
Definition: MCAsmInfo.h:132
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in .cfi_* directives.
Definition: MCAsmInfo.h:358
This class represents lattice values for constants.
Definition: AllocatorList.h:23
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
Definition: Triple.h:305
void setUseIntegratedAssembler(bool Value) override
Set whether assembly (inline or otherwise) should be parsed.
setjmp/longjmp based exceptions
const char * Data64bitsDirective
Definition: MCAsmInfo.h:197
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:70
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:235
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:114
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:296
const char * Code32Directive
Definition: MCAsmInfo.h:149
ARMMCAsmInfoDarwin(const Triple &TheTriple)
bool isWatchABI() const
Definition: Triple.h:476
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:340
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
ARMELFMCAsmInfo(const Triple &TT)
Windows Exception Handling.
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:343
bool UseDataRegionDirectives
This is true if data region markers should be printed as ".data_region/.end_data_region" directives...
Definition: MCAsmInfo.h:166
LLVM Value Representation.
Definition: Value.h:74
DWARF-like instruction based exceptions.
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ...
Definition: MCAsmInfo.h:128
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:98
bool UseParensForSymbolVariant
True if target uses parens to indicate the symbol variant instead of .
Definition: MCAsmInfo.h:362