LLVM 17.0.0git
CSKYMCExpr.h
Go to the documentation of this file.
1//===-- CSKYMCExpr.h - CSKY 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
15namespace llvm {
16
17class CSKYMCExpr : public MCTargetExpr {
18public:
37 };
38
39private:
40 const VariantKind Kind;
41 const MCExpr *Expr;
42
43 explicit CSKYMCExpr(VariantKind Kind, const MCExpr *Expr)
44 : Kind(Kind), Expr(Expr) {}
45
46public:
47 static const CSKYMCExpr *create(const MCExpr *Expr, VariantKind Kind,
48 MCContext &Ctx);
49
50 // Returns the kind of this expression.
51 VariantKind getKind() const { return Kind; }
52
53 // Returns the child of this expression.
54 const MCExpr *getSubExpr() const { return Expr; }
55
56 void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
57
58 bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
59 const MCFixup *Fixup) const override;
60 void visitUsedExpr(MCStreamer &Streamer) const override;
61
64 }
65
66 void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
67
68 static bool classof(const MCExpr *E) {
69 return E->getKind() == MCExpr::Target;
70 }
71
73};
74} // end namespace llvm
75
76#endif
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
PowerPC TLS Dynamic Call Fixup
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override
Definition: CSKYMCExpr.cpp:99
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition: CSKYMCExpr.cpp:65
const MCExpr * getSubExpr() const
Definition: CSKYMCExpr.h:54
static const CSKYMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
Definition: CSKYMCExpr.cpp:22
void visitUsedExpr(MCStreamer &Streamer) const override
Definition: CSKYMCExpr.cpp:61
static bool classof(const MCExpr *E)
Definition: CSKYMCExpr.h:68
static StringRef getVariantKindName(VariantKind Kind)
Definition: CSKYMCExpr.cpp:27
VariantKind getKind() const
Definition: CSKYMCExpr.h:51
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
Definition: CSKYMCExpr.cpp:112
MCFragment * findAssociatedFragment() const override
Definition: CSKYMCExpr.h:62
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
@ Target
Target specific expression.
Definition: MCExpr.h:42
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Definition: MCExpr.cpp:987
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:71
Streaming machine code generation interface.
Definition: MCStreamer.h:212
This is an extension point for target-specific MCExpr subclasses to implement.
Definition: MCExpr.h:645
This represents an "assembler immediate".
Definition: MCValue.h:36
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18