blob: b6d22bb690c4cbb3c81405a051d75ce7dbfd51e3 [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 {
21 GOT,
22 PLT,
23 GOTPCREL
24 };
25private:
26 /// Sym - The symbol being referenced.
27 const MCSymbol * const Sym;
28 /// Kind - The modifier.
29 const VariantKind Kind;
30
31 X86MCTargetExpr(const MCSymbol *S, VariantKind K) : Sym(S), Kind(K) {}
32public:
33 static X86MCTargetExpr *Create(const MCSymbol *Sym, VariantKind K,
34 MCContext &Ctx);
35
36 void PrintImpl(raw_ostream &OS) const;
37 bool EvaluateAsRelocatableImpl(MCValue &Res) const;
38};
39
40} // end namespace llvm
41
42#endif