Path: blob/main/contrib/llvm-project/llvm/lib/Target/Xtensa/MCTargetDesc/XtensaMCExpr.h
35295 views
//===-- XtensaMCExpr.h - Xtensa specific MC expression classes --*- C++ -*-===//1//2// The LLVM Compiler Infrastructure3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9//10// This file describes Xtensa-specific MCExprs11//12//===----------------------------------------------------------------------===//1314#ifndef LLVM_LIB_TARGET_XTENSA_MCTARGETDESC_XTENSAMCEXPR_H15#define LLVM_LIB_TARGET_XTENSA_MCTARGETDESC_XTENSAMCEXPR_H1617#include "llvm/MC/MCExpr.h"1819namespace llvm {2021class StringRef;22class XtensaMCExpr : public MCTargetExpr {23public:24enum VariantKind { VK_Xtensa_None, VK_Xtensa_Invalid };2526private:27const MCExpr *Expr;28const VariantKind Kind;2930explicit XtensaMCExpr(const MCExpr *Expr, VariantKind Kind)31: Expr(Expr), Kind(Kind) {}3233public:34static const XtensaMCExpr *create(const MCExpr *Expr, VariantKind Kind,35MCContext &Ctx);3637VariantKind getKind() const { return Kind; }3839const MCExpr *getSubExpr() const { return Expr; }4041void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;42bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,43const MCFixup *Fixup) const override;44void visitUsedExpr(MCStreamer &Streamer) const override;45MCFragment *findAssociatedFragment() const override {46return getSubExpr()->findAssociatedFragment();47}4849void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override {}5051static VariantKind getVariantKindForName(StringRef name);52static StringRef getVariantKindName(VariantKind Kind);53};5455} // end namespace llvm.5657#endif // LLVM_LIB_TARGET_XTENSA_MCTARGETDESC_XTENSAMCEXPR_H585960