Path: blob/main/contrib/llvm-project/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCExpr.h
35294 views
//===-- SystemZMCExpr.h - SystemZ specific MC expression classes -*- C++-*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCEXPR_H9#define LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCEXPR_H1011#include "llvm/MC/MCExpr.h"12#include "llvm/MC/MCStreamer.h"13#include "llvm/MC/MCValue.h"1415namespace llvm {1617class SystemZMCExpr : public MCTargetExpr {18public:19// HLASM docs for address constants:20// https://www.ibm.com/docs/en/hla-and-tf/1.6?topic=value-address-constants21enum VariantKind {22VK_SystemZ_None,23VK_SystemZ_RCon, // Address of ADA of symbol.24VK_SystemZ_VCon, // Address of external function symbol.25};2627private:28const VariantKind Kind;29const MCExpr *Expr;3031explicit SystemZMCExpr(VariantKind Kind, const MCExpr *Expr)32: Kind(Kind), Expr(Expr) {}3334public:35static const SystemZMCExpr *create(VariantKind Kind, const MCExpr *Expr,36MCContext &Ctx);3738/// getOpcode - Get the kind of this expression.39VariantKind getKind() const { return Kind; }4041/// getSubExpr - Get the child of this expression.42const MCExpr *getSubExpr() const { return Expr; }4344StringRef getVariantKindName() const;4546void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;47bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,48const MCFixup *Fixup) const override;49void visitUsedExpr(MCStreamer &Streamer) const override {50Streamer.visitUsedExpr(*getSubExpr());51}52MCFragment *findAssociatedFragment() const override {53return getSubExpr()->findAssociatedFragment();54}5556// There are no TLS SystemZMCExprs at the moment.57void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override {}5859static bool classof(const MCExpr *E) {60return E->getKind() == MCExpr::Target;61}62};63} // end namespace llvm6465#endif666768