blob: 690f56beec864cc9e0a7e7a348b540e01f7bdfe3 [file] [log] [blame]
Chris Lattnerbd0764b2010-02-08 22:09:08 +00001//===- X86MCTargetExpr.h - X86 Target Specific MCExpr -----------*- C++ -*-===//
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//===----------------------------------------------------------------------===//
9
10#ifndef X86_MCTARGETEXPR_H
11#define X86_MCTARGETEXPR_H
12
13#include "llvm/MC/MCExpr.h"
14
15namespace llvm {
16
17/// X86MCTargetExpr - This class represents symbol variants, like foo@GOT.
18class X86MCTargetExpr : public MCTargetExpr {
19public:
20 enum VariantKind {
Chris Lattner4625c9b2010-02-08 22:33:55 +000021 Invalid,
Chris Lattnerbd0764b2010-02-08 22:09:08 +000022 GOT,
23 PLT,
Chris Lattner4625c9b2010-02-08 22:33:55 +000024 GOTPCREL,
25 GOTOFF
Chris Lattnerbd0764b2010-02-08 22:09:08 +000026 };
27private:
28 /// Sym - The symbol being referenced.
29 const MCSymbol * const Sym;
30 /// Kind - The modifier.
31 const VariantKind Kind;
32
33 X86MCTargetExpr(const MCSymbol *S, VariantKind K) : Sym(S), Kind(K) {}
34public:
35 static X86MCTargetExpr *Create(const MCSymbol *Sym, VariantKind K,
36 MCContext &Ctx);
37
38 void PrintImpl(raw_ostream &OS) const;
39 bool EvaluateAsRelocatableImpl(MCValue &Res) const;
40};
41
42} // end namespace llvm
43
44#endif