LLVM  11.0.0git
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 }
41 
42 void ARMELFMCAsmInfo::anchor() { }
43 
45  if ((TheTriple.getArch() == Triple::armeb) ||
46  (TheTriple.getArch() == Triple::thumbeb))
47  IsLittleEndian = false;
48 
49  // ".comm align is in bytes but .align is pow-2."
50  AlignmentIsInBytes = false;
51 
52  Data64bitsDirective = nullptr;
53  CommentString = "@";
54  Code16Directive = ".code\t16";
55  Code32Directive = ".code\t32";
56 
58 
59  // Conditional Thumb 4-byte instructions can have an implicit IT.
60  MaxInstLength = 6;
61 
62  // Exceptions handling
63  switch (TheTriple.getOS()) {
64  case Triple::NetBSD:
66  break;
67  default:
69  break;
70  }
71 
72  // foo(plt) instead of foo@plt
74 }
75 
79  // gas doesn't handle VFP register names in cfi directives,
80  // so don't use register names with external assembler.
81  // See https://sourceware.org/bugzilla/show_bug.cgi?id=16694
82  DwarfRegNumForCFI = true;
83  }
84 }
85 
86 void ARMCOFFMCAsmInfoMicrosoft::anchor() { }
87 
89  AlignmentIsInBytes = false;
91  PrivateGlobalPrefix = "$M";
92  PrivateLabelPrefix = "$M";
93  CommentString = ";";
94 
95  // Conditional Thumb 4-byte instructions can have an implicit IT.
96  MaxInstLength = 6;
97 }
98 
99 void ARMCOFFMCAsmInfoGNU::anchor() { }
100 
102  AlignmentIsInBytes = false;
104 
105  CommentString = "@";
106  Code16Directive = ".code\t16";
107  Code32Directive = ".code\t32";
108  PrivateGlobalPrefix = ".L";
109  PrivateLabelPrefix = ".L";
110 
114 
115  DwarfRegNumForCFI = false;
116 
117  // Conditional Thumb 4-byte instructions can have an implicit IT.
118  MaxInstLength = 6;
119 }
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:300
const char * Code16Directive
These are assembly directives that tells the assembler to interpret the following instructions differ...
Definition: MCAsmInfo.h:152
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
Definition: Triple.h:475
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:389
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
Definition: MCAsmInfo.h:136
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in .cfi_* directives.
Definition: MCAsmInfo.h:368
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:309
void setUseIntegratedAssembler(bool Value) override
Set whether assembly (inline or otherwise) should be parsed.
setjmp/longjmp based exceptions
const char * Data64bitsDirective
Definition: MCAsmInfo.h:210
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:248
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:118
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:300
const char * Code32Directive
Definition: MCAsmInfo.h:153
ARMMCAsmInfoDarwin(const Triple &TheTriple)
bool isWatchABI() const
Definition: Triple.h:470
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:350
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
ARMELFMCAsmInfo(const Triple &TT)
Windows Exception Handling.
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:353
bool UseDataRegionDirectives
This is true if data region markers should be printed as ".data_region/.end_data_region" directives...
Definition: MCAsmInfo.h:174
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:132
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:102
bool UseParensForSymbolVariant
True if target uses parens to indicate the symbol variant instead of .
Definition: MCAsmInfo.h:372