LLVM  8.0.1
LanaiMCExpr.h
Go to the documentation of this file.
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:
21 
22 private:
23  const VariantKind Kind;
24  const MCExpr *Expr;
25 
26  explicit LanaiMCExpr(VariantKind Kind, const MCExpr *Expr)
27  : 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  VariantKind getKind() const { return Kind; }
35 
36  // Returns the child of this expression.
37  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  MCFragment *findAssociatedFragment() const override {
45  }
46 
47  // There are no TLS LanaiMCExprs at the moment.
48  void fixELFSymbolsInTLSFixups(MCAssembler & /*Asm*/) const override {}
49 
50  static bool classof(const MCExpr *E) {
51  return E->getKind() == MCExpr::Target;
52  }
53 };
54 } // end namespace llvm
55 
56 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
This represents an "assembler immediate".
Definition: MCValue.h:40
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
Definition: LanaiMCExpr.cpp:50
static const LanaiMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: LanaiMCExpr.cpp:18
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:74
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:29
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
This is an extension point for target-specific MCExpr subclasses to implement.
Definition: MCExpr.h:581
Context object for machine code objects.
Definition: MCContext.h:63
const MCExpr * getSubExpr() const
Definition: LanaiMCExpr.h:37
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
Streaming machine code generation interface.
Definition: MCStreamer.h:189
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition: LanaiMCExpr.cpp:23
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void fixELFSymbolsInTLSFixups(MCAssembler &) const override
Definition: LanaiMCExpr.h:48
PowerPC TLS Dynamic Call Fixup
ExprKind getKind() const
Definition: MCExpr.h:73
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Definition: MCExpr.cpp:867
MCFragment * findAssociatedFragment() const override
Definition: LanaiMCExpr.h:43
VariantKind getKind() const
Definition: LanaiMCExpr.h:34
void visitUsedExpr(MCStreamer &Streamer) const override
Definition: LanaiMCExpr.cpp:46
static bool classof(const MCExpr *E)
Definition: LanaiMCExpr.h:50
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
Target specific expression.
Definition: MCExpr.h:43