Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/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
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIMCEXPR_H
10
#define LLVM_LIB_TARGET_LANAI_MCTARGETDESC_LANAIMCEXPR_H
11
12
#include "llvm/MC/MCExpr.h"
13
#include "llvm/MC/MCValue.h"
14
15
namespace llvm {
16
17
class LanaiMCExpr : public MCTargetExpr {
18
public:
19
  enum VariantKind { VK_Lanai_None, VK_Lanai_ABS_HI, VK_Lanai_ABS_LO };
20
21
private:
22
  const VariantKind Kind;
23
  const MCExpr *Expr;
24
25
  explicit LanaiMCExpr(VariantKind Kind, const MCExpr *Expr)
26
34
      : Kind(Kind), Expr(Expr) {}
27
28
public:
29
  static const LanaiMCExpr *create(VariantKind Kind, const MCExpr *Expr,
30
                                   MCContext &Ctx);
31
32
  // Returns the kind of this expression.
33
4
  VariantKind getKind() const { return Kind; }
34
35
  // Returns the child of this expression.
36
20
  const MCExpr *getSubExpr() const { return Expr; }
37
38
  void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
39
  bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
40
                                 const MCFixup *Fixup) const override;
41
  void visitUsedExpr(MCStreamer &Streamer) const override;
42
0
  MCFragment *findAssociatedFragment() const override {
43
0
    return getSubExpr()->findAssociatedFragment();
44
0
  }
45
46
  // There are no TLS LanaiMCExprs at the moment.
47
0
  void fixELFSymbolsInTLSFixups(MCAssembler & /*Asm*/) const override {}
48
49
7
  static bool classof(const MCExpr *E) {
50
7
    return E->getKind() == MCExpr::Target;
51
7
  }
52
};
53
} // end namespace llvm
54
55
#endif