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 {
32 const VariantKind Kind;
33 const MCSymbol *Symbol;
36 explicit MipsMCSymbolRefExpr(VariantKind _Kind, const MCSymbol *_Symbol,
38 : Kind(_Kind), Symbol(_Symbol), Offset(_Offset) {}
41 static const MipsMCSymbolRefExpr *Create(VariantKind Kind,
42 const MCSymbol *Symbol, int Offset,
45 void PrintImpl(raw_ostream &OS) const;
46 bool EvaluateAsRelocatableImpl(MCValue &Res,
47 const MCAsmLayout *Layout) const;
48 void AddValueSymbols(MCAssembler *) const;
49 const MCSection *FindAssociatedSection() const;
51 static bool classof(const MCExpr *E) {
52 return E->getKind() == MCExpr::Target;
55 static bool classof(const MipsMCSymbolRefExpr *) { return true; }
57 int getOffset() const { return Offset; }
58 void setOffset(int O) { Offset = O; }
60 } // end namespace llvm