blob: 7de8a5c57380e8b1ff074aded9027c0879520de8 [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,
Chris Lattner86ecc412010-02-08 22:52:47 +000023 GOTOFF,
Chris Lattner4625c9b2010-02-08 22:33:55 +000024 GOTPCREL,
Chris Lattner86ecc412010-02-08 22:52:47 +000025 GOTTPOFF,
26 INDNTPOFF,
27 NTPOFF,
28 PLT,
29 TLSGD,
30 TPOFF
Chris Lattnerbd0764b2010-02-08 22:09:08 +000031 };
32private:
33 /// Sym - The symbol being referenced.
34 const MCSymbol * const Sym;
35 /// Kind - The modifier.
36 const VariantKind Kind;
37
38 X86MCTargetExpr(const MCSymbol *S, VariantKind K) : Sym(S), Kind(K) {}
39public:
40 static X86MCTargetExpr *Create(const MCSymbol *Sym, VariantKind K,
41 MCContext &Ctx);
42
43 void PrintImpl(raw_ostream &OS) const;
44 bool EvaluateAsRelocatableImpl(MCValue &Res) const;
45};
46
47} // end namespace llvm
48
49#endif