LLVM 24.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/ADT/Enum.h"
11#include "llvm/MC/MCContext.h"
12#include "llvm/MC/MCExpr.h"
13#include "llvm/MC/MCValue.h"
14
15using namespace llvm;
16
18 {{"DTPOFF"}, SystemZ::S_DTPOFF}, {{"GOT"}, SystemZ::S_GOT},
19 {{"GOTENT"}, SystemZ::S_GOTENT}, {{"INDNTPOFF"}, SystemZ::S_INDNTPOFF},
20 {{"NTPOFF"}, SystemZ::S_NTPOFF}, {{"PLT"}, SystemZ::S_PLT},
21 {{"TLSGD"}, SystemZ::S_TLSGD}, {{"TLSLD"}, SystemZ::S_TLSLD},
22 {{"TLSLDM"}, SystemZ::S_TLSLDM},
23};
25
42
63
65 raw_ostream &OS, const MCSpecifierExpr &Expr) const {
66 switch (Expr.getSpecifier()) {
67 case SystemZ::S_None:
68 OS << "AD";
69 break;
70 case SystemZ::S_QCon:
71 OS << "QD";
72 break;
73 case SystemZ::S_RCon:
74 OS << "RD";
75 break;
76 case SystemZ::S_VCon:
77 OS << "VD";
78 break;
79 default:
80 llvm_unreachable("Invalid kind");
81 }
82 OS << '(';
83 printExpr(OS, *Expr.getSubExpr());
84 OS << ')';
85}
86
88 const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const {
89 if (!Expr.getSubExpr()->evaluateAsRelocatable(Res, Asm))
90 return false;
91 Res.setSpecifier(Expr.getSpecifier());
92 return true;
93}
constexpr EnumStringDef< MCAsmInfo::AtSpecifierKind > AtSpecifierDefs[]
constexpr auto atSpecifiers
#define BUILD_ENUM_STRINGS(Tab)
Definition Enum.h:120
static LVOptions Options
Definition LVOptions.cpp:25
MCAsmInfoELF(const MCTargetOptions &Options)
MCAsmInfoGOFF(const MCTargetOptions &Options)
bool AllowAdditionalComments
This indicates whether to allow additional "comment strings" to be lexed as a comment.
Definition MCAsmInfo.h:142
const char * Data64bitsDirective
Definition MCAsmInfo.h:245
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition MCAsmInfo.h:357
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:191
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:198
bool UsesSetToEquateSymbol
Use .set instead of = to equate a symbol to an expression.
Definition MCAsmInfo.h:148
void printExpr(raw_ostream &, const MCExpr &) const
bool AllowAtInName
This is true if the assembler allows @ characters in symbol names.
Definition MCAsmInfo.h:177
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition MCAsmInfo.h:118
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition MCAsmInfo.h:258
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:354
unsigned AssemblerDialect
Which dialect of an assembler variant to use. Defaults to 0.
Definition MCAsmInfo.h:173
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:221
void initializeAtSpecifiers(EnumStrings< AtSpecifierKind, 1 >)
bool IsLittleEndian
True if target is little endian. Default is true.
Definition MCAsmInfo.h:93
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition MCAsmInfo.h:86
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition MCAsmInfo.h:90
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:134
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:494
const MCExpr * getSubExpr() const
Definition MCExpr.h:508
Spec getSpecifier() const
Definition MCExpr.h:507
void setSpecifier(uint32_t S)
Definition MCValue.h:47
SystemZMCAsmInfoELF(const Triple &TT, const MCTargetOptions &Options)
bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const override
SystemZMCAsmInfoGOFF(const Triple &TT, const MCTargetOptions &Options)
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
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.
This is an optimization pass for GlobalISel generic memory operations.
@ ZOS
z/OS MVS Exception Handling.
Definition CodeGen.h:61
@ DwarfCFI
DWARF-like instruction based exceptions.
Definition CodeGen.h:55
Compile-time data representation of enum entries.
Definition Enum.h:47