LLVM 22.0.0git
SystemZMCAsmInfo.cpp
Go to the documentation of this file.
1//===-- SystemZMCAsmInfo.cpp - SystemZ 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#include "SystemZMCAsmInfo.h"
10#include "llvm/MC/MCContext.h"
11#include "llvm/MC/MCExpr.h"
12#include "llvm/MC/MCValue.h"
13
14using namespace llvm;
15
17 {SystemZ::S_DTPOFF, "DTPOFF"}, {SystemZ::S_GOT, "GOT"},
18 {SystemZ::S_GOTENT, "GOTENT"}, {SystemZ::S_INDNTPOFF, "INDNTPOFF"},
19 {SystemZ::S_NTPOFF, "NTPOFF"}, {SystemZ::S_PLT, "PLT"},
20 {SystemZ::S_TLSGD, "TLSGD"}, {SystemZ::S_TLSLD, "TLSLD"},
21 {SystemZ::S_TLSLDM, "TLSLDM"},
22};
23
28 Data64bitsDirective = "\t.quad\t";
30 IsLittleEndian = false;
31 MaxInstLength = 6;
34 ZeroDirective = "\t.space\t";
35
37}
38
41 AllowAtInName = true;
47 CommentString = "*";
50 IsHLASM = true;
51 IsLittleEndian = false;
52 MaxInstLength = 6;
54
56}
57
59 return MCAsmInfo::isAcceptableChar(C) || C == '#';
60}
61
63 raw_ostream &OS, const MCSpecifierExpr &Expr) const {
64 switch (Expr.getSpecifier()) {
65 case SystemZ::S_None:
66 OS << "A";
67 break;
68 case SystemZ::S_RCon:
69 OS << "R";
70 break;
71 case SystemZ::S_VCon:
72 OS << "V";
73 break;
74 default:
75 llvm_unreachable("Invalid kind");
76 }
77 OS << '(';
78 printExpr(OS, *Expr.getSubExpr());
79 OS << ')';
80}
81
83 const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const {
84 if (!Expr.getSubExpr()->evaluateAsRelocatable(Res, Asm))
85 return false;
86 Res.setSpecifier(Expr.getSpecifier());
87 return true;
88}
const MCAsmInfo::AtSpecifier atSpecifiers[]
raw_pwrite_stream & OS
const MCAsmInfo::AtSpecifier atSpecifiers[]
bool AllowAdditionalComments
This indicates whether to allow additional "comment strings" to be lexed as a comment.
Definition: MCAsmInfo.h:143
void initializeAtSpecifiers(ArrayRef< AtSpecifier >)
Definition: MCAsmInfo.cpp:127
const char * Data64bitsDirective
Definition: MCAsmInfo.h:250
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:359
bool AllowDollarAtStartOfIdentifier
This is true if the assembler allows the "$" character at the start of of a string to be lexed as an ...
Definition: MCAsmInfo.h:196
bool AllowAtAtStartOfIdentifier
This is true if the assembler allows the "@" character at the start of a string to be lexed as an Asm...
Definition: MCAsmInfo.h:203
bool UsesSetToEquateSymbol
Use .set instead of = to equate a symbol to an expression.
Definition: MCAsmInfo.h:149
void printExpr(raw_ostream &, const MCExpr &) const
Definition: MCAsmInfo.cpp:153
bool AllowAtInName
This is true if the assembler allows @ characters in symbol names.
Definition: MCAsmInfo.h:182
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:119
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:263
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:356
virtual bool isAcceptableChar(char C) const
Return true if C is an acceptable character inside a symbol name.
Definition: MCAsmInfo.cpp:100
unsigned AssemblerDialect
Which dialect of an assembler variant to use. Defaults to 0.
Definition: MCAsmInfo.h:178
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
Definition: MCAsmInfo.h:226
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:94
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:87
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:91
StringRef CommentString
This indicates the comment string used by the assembler.
Definition: MCAsmInfo.h:135
LLVM_ABI bool evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm) const
Try to evaluate the expression to a relocatable value, i.e.
Definition: MCExpr.cpp:450
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition: MCExpr.h:495
const MCExpr * getSubExpr() const
Definition: MCExpr.h:509
Spec getSpecifier() const
Definition: MCExpr.h:508
void setSpecifier(uint32_t S)
Definition: MCValue.h:47
SystemZMCAsmInfoELF(const Triple &TT)
bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const override
bool isAcceptableChar(char C) const override
Return true if C is an acceptable character inside a symbol name.
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
SystemZMCAsmInfoGOFF(const Triple &TT)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:47
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ ZOS
z/OS MVS Exception Handling.
@ DwarfCFI
DWARF-like instruction based exceptions.