Silence -Wunused-variable in release builds.
[llvm/stm8.git] / lib / Target / Mips / MipsMCSymbolRefExpr.h
blob3e695963709e7ac064ed1c77eb9e6dd064e0953b
1 //===-- MipsMCSymbolRefExpr.h - Mips specific MCSymbolRefExpr class -------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef MIPSMCSYMBOLREFEXPR_H
11 #define MIPSMCSYMBOLREFEXPR_H
12 #include "llvm/MC/MCExpr.h"
14 namespace llvm {
16 class MipsMCSymbolRefExpr : public MCTargetExpr {
17 public:
18 enum VariantKind {
19 VK_Mips_None,
20 VK_Mips_GPREL,
21 VK_Mips_GOT_CALL,
22 VK_Mips_GOT,
23 VK_Mips_ABS_HI,
24 VK_Mips_ABS_LO,
25 VK_Mips_TLSGD,
26 VK_Mips_GOTTPREL,
27 VK_Mips_TPREL_HI,
28 VK_Mips_TPREL_LO
31 private:
32 const VariantKind Kind;
33 const MCSymbol *Symbol;
34 int Offset;
36 explicit MipsMCSymbolRefExpr(VariantKind _Kind, const MCSymbol *_Symbol,
37 int _Offset)
38 : Kind(_Kind), Symbol(_Symbol), Offset(_Offset) {}
40 public:
41 static const MipsMCSymbolRefExpr *Create(VariantKind Kind,
42 const MCSymbol *Symbol, int Offset,
43 MCContext &Ctx);
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
62 #endif