LLVM 19.0.0git
SystemZMCExpr.h
Go to the documentation of this file.
1//===-- SystemZMCExpr.h - SystemZ specific MC expression classes -*- C++-*-===//
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#ifndef LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCEXPR_H
10#define LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCEXPR_H
11
12#include "llvm/MC/MCExpr.h"
13#include "llvm/MC/MCStreamer.h"
14#include "llvm/MC/MCValue.h"
15
16namespace llvm {
17
19public:
20// HLASM docs for address constants:
21// https://www.ibm.com/docs/en/hla-and-tf/1.6?topic=value-address-constants
24 VK_SystemZ_RCon, // Address of ADA of symbol.
25 VK_SystemZ_VCon, // Address of external function symbol.
26 };
27
28private:
29 const VariantKind Kind;
30 const MCExpr *Expr;
31
32 explicit SystemZMCExpr(VariantKind Kind, const MCExpr *Expr)
33 : Kind(Kind), Expr(Expr) {}
34
35public:
36 static const SystemZMCExpr *create(VariantKind Kind, const MCExpr *Expr,
37 MCContext &Ctx);
38
39 /// getOpcode - Get the kind of this expression.
40 VariantKind getKind() const { return Kind; }
41
42 /// getSubExpr - Get the child of this expression.
43 const MCExpr *getSubExpr() const { return Expr; }
44
46
47 void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
48 bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
49 const MCFixup *Fixup) const override;
50 void visitUsedExpr(MCStreamer &Streamer) const override {
51 Streamer.visitUsedExpr(*getSubExpr());
52 }
55 }
56
57 // There are no TLS SystemZMCExprs at the moment.
58 void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override {}
59
60 static bool classof(const MCExpr *E) {
61 return E->getKind() == MCExpr::Target;
62 }
63};
64} // end namespace llvm
65
66#endif
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
PowerPC TLS Dynamic Call Fixup
raw_pwrite_stream & OS
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
@ Target
Target specific expression.
Definition: MCExpr.h:42
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Definition: MCExpr.cpp:1062
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:71
Streaming machine code generation interface.
Definition: MCStreamer.h:212
void visitUsedExpr(const MCExpr &Expr)
This is an extension point for target-specific MCExpr subclasses to implement.
Definition: MCExpr.h:656
This represents an "assembler immediate".
Definition: MCValue.h:36
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override
Definition: SystemZMCExpr.h:58
StringRef getVariantKindName() const
static const SystemZMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
VariantKind getKind() const
getOpcode - Get the kind of this expression.
Definition: SystemZMCExpr.h:40
static bool classof(const MCExpr *E)
Definition: SystemZMCExpr.h:60
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
void visitUsedExpr(MCStreamer &Streamer) const override
Definition: SystemZMCExpr.h:50
MCFragment * findAssociatedFragment() const override
Definition: SystemZMCExpr.h:53
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
Definition: SystemZMCExpr.h:43
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18