LLVM 20.0.0git
SparcMCExpr.h
Go to the documentation of this file.
1//====- SparcMCExpr.h - Sparc 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// This file describes Sparc-specific MCExprs, used for modifiers like
10// "%hi" or "%lo" etc.,
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCMCEXPR_H
15#define LLVM_LIB_TARGET_SPARC_MCTARGETDESC_SPARCMCEXPR_H
16
17#include "SparcFixupKinds.h"
18#include "llvm/MC/MCExpr.h"
19
20namespace llvm {
21
22class StringRef;
23class SparcMCExpr : public MCTargetExpr {
24public:
67 };
68
69private:
70 const VariantKind Kind;
71 const MCExpr *Expr;
72
73 explicit SparcMCExpr(VariantKind Kind, const MCExpr *Expr)
74 : Kind(Kind), Expr(Expr) {}
75
76public:
77 /// @name Construction
78 /// @{
79
80 static const SparcMCExpr *create(VariantKind Kind, const MCExpr *Expr,
81 MCContext &Ctx);
82 /// @}
83 /// @name Accessors
84 /// @{
85
86 /// getOpcode - Get the kind of this expression.
87 VariantKind getKind() const { return Kind; }
88
89 /// getSubExpr - Get the child of this expression.
90 const MCExpr *getSubExpr() const { return Expr; }
91
92 /// getFixupKind - Get the fixup kind of this expression.
93 Sparc::Fixups getFixupKind() const { return getFixupKind(Kind); }
94
95 /// @}
96 void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
97 bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
98 const MCFixup *Fixup) const override;
99 void visitUsedExpr(MCStreamer &Streamer) const override;
102 }
103
104 void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
105
106 static bool classof(const MCExpr *E) {
107 return E->getKind() == MCExpr::Target;
108 }
109
111 static bool printVariantKind(raw_ostream &OS, VariantKind Kind);
113};
114
115} // end namespace llvm.
116
117#endif
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
PowerPC TLS Dynamic Call Fixup
static const char * name
Definition: SMEABIPass.cpp:46
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
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
Definition: SparcMCExpr.h:90
static bool classof(const MCExpr *E)
Definition: SparcMCExpr.h:106
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup) const override
static const SparcMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: SparcMCExpr.cpp:27
Sparc::Fixups getFixupKind() const
getFixupKind - Get the fixup kind of this expression.
Definition: SparcMCExpr.h:93
void visitUsedExpr(MCStreamer &Streamer) const override
static VariantKind parseVariantKind(StringRef name)
Definition: SparcMCExpr.cpp:93
static bool printVariantKind(raw_ostream &OS, VariantKind Kind)
Definition: SparcMCExpr.cpp:43
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override
MCFragment * findAssociatedFragment() const override
Definition: SparcMCExpr.h:100
VariantKind getKind() const
getOpcode - Get the kind of this expression.
Definition: SparcMCExpr.h:87
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Definition: SparcMCExpr.cpp:32
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
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