LLVM 20.0.0git
MipsMCExpr.h
Go to the documentation of this file.
1//===- MipsMCExpr.h - Mips 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_MIPS_MCTARGETDESC_MIPSMCEXPR_H
10#define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSMCEXPR_H
11
12#include "llvm/MC/MCExpr.h"
13#include "llvm/MC/MCValue.h"
14
15namespace llvm {
16
17class MipsMCExpr : public MCTargetExpr {
18public:
47 };
48
49private:
50 const MipsExprKind Kind;
51 const MCExpr *Expr;
52
53 explicit MipsMCExpr(MipsExprKind Kind, const MCExpr *Expr)
54 : Kind(Kind), Expr(Expr) {}
55
56public:
57 static const MipsMCExpr *create(MipsExprKind Kind, const MCExpr *Expr,
58 MCContext &Ctx);
59 static const MipsMCExpr *createGpOff(MipsExprKind Kind, const MCExpr *Expr,
60 MCContext &Ctx);
61
62 /// Get the kind of this expression.
63 MipsExprKind getKind() const { return Kind; }
64
65 /// Get the child of this expression.
66 const MCExpr *getSubExpr() const { return Expr; }
67
68 void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
69 bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
70 const MCFixup *Fixup) const override;
71 void visitUsedExpr(MCStreamer &Streamer) const override;
72
75 }
76
77 void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
78
79 static bool classof(const MCExpr *E) {
80 return E->getKind() == MCExpr::Target;
81 }
82
83 bool isGpOff(MipsExprKind &Kind) const;
84 bool isGpOff() const {
85 MipsExprKind Kind;
86 return isGpOff(Kind);
87 }
88};
89
90} // end namespace llvm
91
92#endif // LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSMCEXPR_H
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
PowerPC TLS Dynamic Call Fixup
raw_pwrite_stream & OS
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
@ Target
Target specific expression.
Definition: MCExpr.h:41
MCFragment * findAssociatedFragment() const
Find the "associated section" for this expression, which is currently defined as the absolute section...
Definition: MCExpr.cpp:1060
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:213
This is an extension point for target-specific MCExpr subclasses to implement.
Definition: MCExpr.h:657
This represents an "assembler immediate".
Definition: MCValue.h:36
static const MipsMCExpr * create(MipsExprKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: MipsMCExpr.cpp:27
MCFragment * findAssociatedFragment() const override
Definition: MipsMCExpr.h:73
static bool classof(const MCExpr *E)
Definition: MipsMCExpr.h:79
const MCExpr * getSubExpr() const
Get the child of this expression.
Definition: MipsMCExpr.h:66
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override
Definition: MipsMCExpr.cpp:248
MipsExprKind getKind() const
Get the kind of this expression.
Definition: MipsMCExpr.h:63
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition: MipsMCExpr.cpp:37
void visitUsedExpr(MCStreamer &Streamer) const override
Definition: MipsMCExpr.cpp:218
bool isGpOff() const
Definition: MipsMCExpr.h:84
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup) const override
Definition: MipsMCExpr.cpp:132
static const MipsMCExpr * createGpOff(MipsExprKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: MipsMCExpr.cpp:32
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