/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- LanaiMCExpr.h - Lanai specific MC expression classes ----*- 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 LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIMCEXPR_H |
11 | | #define LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIMCEXPR_H |
12 | | |
13 | | #include "llvm/MC/MCExpr.h" |
14 | | #include "llvm/MC/MCValue.h" |
15 | | |
16 | | namespace llvm { |
17 | | |
18 | | class LanaiMCExpr : public MCTargetExpr { |
19 | | public: |
20 | | enum VariantKind { VK_Lanai_None, VK_Lanai_ABS_HI, VK_Lanai_ABS_LO }; |
21 | | |
22 | | private: |
23 | | const VariantKind Kind; |
24 | | const MCExpr *Expr; |
25 | | |
26 | | explicit LanaiMCExpr(VariantKind Kind, const MCExpr *Expr) |
27 | 34 | : Kind(Kind), Expr(Expr) {} |
28 | | |
29 | | public: |
30 | | static const LanaiMCExpr *create(VariantKind Kind, const MCExpr *Expr, |
31 | | MCContext &Ctx); |
32 | | |
33 | | // Returns the kind of this expression. |
34 | 4 | VariantKind getKind() const { return Kind; } |
35 | | |
36 | | // Returns the child of this expression. |
37 | 20 | const MCExpr *getSubExpr() const { return Expr; } |
38 | | |
39 | | void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override; |
40 | | bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, |
41 | | const MCFixup *Fixup) const override; |
42 | | void visitUsedExpr(MCStreamer &Streamer) const override; |
43 | 0 | MCFragment *findAssociatedFragment() const override { |
44 | 0 | return getSubExpr()->findAssociatedFragment(); |
45 | 0 | } |
46 | | |
47 | | // There are no TLS LanaiMCExprs at the moment. |
48 | 0 | void fixELFSymbolsInTLSFixups(MCAssembler & /*Asm*/) const override {} |
49 | | |
50 | 7 | static bool classof(const MCExpr *E) { |
51 | 7 | return E->getKind() == MCExpr::Target; |
52 | 7 | } |
53 | | }; |
54 | | } // end namespace llvm |
55 | | |
56 | | #endif |