LLVM  14.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;
92  PrivateGlobalPrefix = "$M";
93  PrivateLabelPrefix = "$M";
94  CommentString = "@";
95 
96  // Conditional Thumb 4-byte instructions can have an implicit IT.
97  MaxInstLength = 6;
98 }
99 
100 void ARMCOFFMCAsmInfoGNU::anchor() { }
101 
103  AlignmentIsInBytes = false;
105 
106  CommentString = "@";
107  Code16Directive = ".code\t16";
108  Code32Directive = ".code\t32";
109  PrivateGlobalPrefix = ".L";
110  PrivateLabelPrefix = ".L";
111 
115 
116  DwarfRegNumForCFI = false;
117 
118  // Conditional Thumb 4-byte instructions can have an implicit IT.
119  MaxInstLength = 6;
120 }
llvm::ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft
ARMCOFFMCAsmInfoMicrosoft()
Definition: ARMMCAsmInfo.cpp:88
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::ExceptionHandling::SjLj
@ SjLj
setjmp/longjmp based exceptions
llvm::MCAsmInfo::SupportsDebugInformation
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:445
llvm::MCAsmInfo::AlignmentIsInBytes
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:329
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::ExceptionHandling::ARM
@ ARM
ARM EHABI.
llvm::MCAsmInfo::Data64bitsDirective
const char * Data64bitsDirective
Definition: MCAsmInfo.h:288
llvm::MCAsmInfo::Code32Directive
const char * Code32Directive
Definition: MCAsmInfo.h:189
llvm::MCAsmInfo::PrivateLabelPrefix
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
Definition: MCAsmInfo.h:172
llvm::MCAsmInfo::UseDataRegionDirectives
bool UseDataRegionDirectives
This is true if data region markers should be printed as ".data_region/.end_data_region" directives.
Definition: MCAsmInfo.h:234
llvm::MCAsmInfo::UseParensForSymbolVariant
bool UseParensForSymbolVariant
True if target uses parens to indicate the symbol variant instead of .
Definition: MCAsmInfo.h:479
llvm::ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU
ARMCOFFMCAsmInfoGNU()
Definition: ARMMCAsmInfo.cpp:102
llvm::MCAsmInfo::Code16Directive
const char * Code16Directive
These are assembly directives that tells the assembler to interpret the following instructions differ...
Definition: MCAsmInfo.h:188
llvm::MCAsmInfo::PrivateGlobalPrefix
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ....
Definition: MCAsmInfo.h:168
llvm::Triple::isOSDarwin
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
Definition: Triple.h:484
llvm::MCAsmInfo::HasSingleParameterDotFile
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:391
llvm::Triple::NetBSD
@ NetBSD
Definition: Triple.h:178
llvm::MCAsmInfo::UseIntegratedAssembler
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:502
llvm::Triple::getArch
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:307
llvm::MCAsmInfo::CommentString
StringRef CommentString
This indicates the comment string used by the assembler.
Definition: MCAsmInfo.h:135
llvm::Triple::getOS
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
Definition: Triple.h:316
llvm::MCAsmInfo::DwarfRegNumForCFI
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in ....
Definition: MCAsmInfo.h:475
llvm::Triple::isWatchABI
bool isWatchABI() const
Definition: Triple.h:477
llvm::Triple::armeb
@ armeb
Definition: Triple.h:51
Triple.h
llvm::ARMELFMCAsmInfo::ARMELFMCAsmInfo
ARMELFMCAsmInfo(const Triple &TT)
Definition: ARMMCAsmInfo.cpp:44
llvm::ARMELFMCAsmInfo::setUseIntegratedAssembler
void setUseIntegratedAssembler(bool Value) override
Set whether assembly (inline or otherwise) should be parsed.
Definition: ARMMCAsmInfo.cpp:76
llvm::ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin
ARMMCAsmInfoDarwin(const Triple &TheTriple)
Definition: ARMMCAsmInfo.cpp:20
llvm::ExceptionHandling::WinEH
@ WinEH
Windows Exception Handling.
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::MCAsmInfo::MaxInstLength
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:111
llvm::Triple::thumbeb
@ thumbeb
Definition: Triple.h:82
llvm::MCAsmInfo::ExceptionsType
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:448
llvm::ExceptionHandling::DwarfCFI
@ DwarfCFI
DWARF-like instruction based exceptions.
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MCAsmInfo::IsLittleEndian
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:79
ARMMCAsmInfo.h