1 //===-- MipsMCSymbolRefExpr.h - Mips specific MCSymbolRefExpr class -------===//
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 MIPSMCSYMBOLREFEXPR_H
11 #define MIPSMCSYMBOLREFEXPR_H
12 #include "llvm/MC/MCExpr.h"
16 class MipsMCSymbolRefExpr : public MCTargetExpr {
37 const VariantKind Kind;
38 const MCSymbol *Symbol;
41 explicit MipsMCSymbolRefExpr(VariantKind _Kind, const MCSymbol *_Symbol,
43 : Kind(_Kind), Symbol(_Symbol), Offset(_Offset) {}
46 static const MipsMCSymbolRefExpr *Create(VariantKind Kind,
47 const MCSymbol *Symbol, int Offset,
50 void PrintImpl(raw_ostream &OS) const;
51 bool EvaluateAsRelocatableImpl(MCValue &Res,
52 const MCAsmLayout *Layout) const;
53 void AddValueSymbols(MCAssembler *) const;
54 const MCSection *FindAssociatedSection() const;
56 static bool classof(const MCExpr *E) {
57 return E->getKind() == MCExpr::Target;
60 static bool classof(const MipsMCSymbolRefExpr *) { return true; }
62 int getOffset() const { return Offset; }
63 void setOffset(int O) { Offset = O; }
65 } // end namespace llvm