Path: blob/main/contrib/llvm-project/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h
35294 views
//===-- CSKYMCExpr.h - CSKY 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_LANAI_MCTARGETDESC_LANAIMCEXPR_H9#define LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIMCEXPR_H1011#include "llvm/MC/MCExpr.h"12#include "llvm/MC/MCValue.h"1314namespace llvm {1516class CSKYMCExpr : public MCTargetExpr {17public:18enum VariantKind {19VK_CSKY_None,20VK_CSKY_ADDR,21VK_CSKY_ADDR_HI16,22VK_CSKY_ADDR_LO16,23VK_CSKY_PCREL,24VK_CSKY_GOT,25VK_CSKY_GOT_IMM18_BY4,26VK_CSKY_GOTPC,27VK_CSKY_GOTOFF,28VK_CSKY_PLT,29VK_CSKY_PLT_IMM18_BY4,30VK_CSKY_TLSIE,31VK_CSKY_TLSLE,32VK_CSKY_TLSGD,33VK_CSKY_TLSLDO,34VK_CSKY_TLSLDM,35VK_CSKY_Invalid36};3738private:39const VariantKind Kind;40const MCExpr *Expr;4142explicit CSKYMCExpr(VariantKind Kind, const MCExpr *Expr)43: Kind(Kind), Expr(Expr) {}4445public:46static const CSKYMCExpr *create(const MCExpr *Expr, VariantKind Kind,47MCContext &Ctx);4849// Returns the kind of this expression.50VariantKind getKind() const { return Kind; }5152// Returns the child of this expression.53const MCExpr *getSubExpr() const { return Expr; }5455void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;5657bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,58const MCFixup *Fixup) const override;59void visitUsedExpr(MCStreamer &Streamer) const override;6061MCFragment *findAssociatedFragment() const override {62return getSubExpr()->findAssociatedFragment();63}6465void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;6667static bool classof(const MCExpr *E) {68return E->getKind() == MCExpr::Target;69}7071static StringRef getVariantKindName(VariantKind Kind);72};73} // end namespace llvm7475#endif767778