1 //===-- Nios2MCExpr.h - Nios2 specific MC expression classes ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_NIOS2_MCTARGETDESC_NIOS2MCEXPR_H
11 #define LLVM_LIB_TARGET_NIOS2_MCTARGETDESC_NIOS2MCEXPR_H
13 #include "llvm/MC/MCAsmLayout.h"
14 #include "llvm/MC/MCExpr.h"
15 #include "llvm/MC/MCValue.h"
19 class Nios2MCExpr : public MCTargetExpr {
29 const Nios2ExprKind Kind;
32 explicit Nios2MCExpr(Nios2ExprKind Kind, const MCExpr *Expr)
33 : Kind(Kind), Expr(Expr) {}
36 static const Nios2MCExpr *create(Nios2ExprKind Kind, const MCExpr *Expr,
38 static const Nios2MCExpr *create(const MCSymbol *Symbol,
39 Nios2MCExpr::Nios2ExprKind Kind,
42 /// Get the kind of this expression.
43 Nios2ExprKind getKind() const { return Kind; }
45 /// Get the child of this expression.
46 const MCExpr *getSubExpr() const { return Expr; }
48 void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
49 bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
50 const MCFixup *Fixup) const override;
51 void visitUsedExpr(MCStreamer &Streamer) const override;
52 MCFragment *findAssociatedFragment() const override {
53 return getSubExpr()->findAssociatedFragment();
56 void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
58 } // end namespace llvm