LLVM 24.0.0git
PISAMCExpr.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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/// \file
10/// This file declares PISA-specific MC expressions for floating-point
11/// immediates.
12///
13/// PISAMCExpr is modeled after ARMMCExpr.
14///
15//===----------------------------------------------------------------------===//
16
17#ifndef LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISAMCEXPR_H
18#define LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISAMCEXPR_H
19
20#include "llvm/ADT/APFloat.h"
21#include "llvm/MC/MCExpr.h"
22#include "llvm/MC/MCSymbol.h"
23#include <utility>
24
25namespace llvm {
26
27/// MCExpr for Global Address.
28/// The operand is the address to a global variable (.e.g. @foo).
29/// It required a prefix "@" for the symbol name
30class PISAGlobalAddressMCExpr : public MCTargetExpr {
31
32private:
33 const MCSymbol *Symbol;
34 explicit PISAGlobalAddressMCExpr(const MCSymbol &Symbol);
35
36public:
37 static const PISAGlobalAddressMCExpr *create(const MCSymbol &Symbol,
38 MCContext &Ctx);
39
40 const MCSymbol &getSymbol() const { return *Symbol; }
41
42 void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override;
43
45 const MCAssembler *Asm) const override {
46 return false;
47 }
48
49 void visitUsedExpr(MCStreamer &Streamer) const override {}
50 MCFragment *findAssociatedFragment() const override { return nullptr; }
51
52 static bool classof(const MCExpr *E) {
53 return E->getKind() == MCExpr::Target;
54 }
55};
56
57} // namespace llvm
58
59#endif // LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISAMCEXPR_H
This file declares a class to represent arbitrary precision floating point values and provide a varie...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
std::unique_ptr< MCStreamer > && Streamer
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition MCAsmInfo.h:69
Context object for machine code objects.
Definition MCContext.h:84
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:31
@ Target
Target specific expression.
Definition MCExpr.h:43
Streaming machine code generation interface.
Definition MCStreamer.h:221
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
static const PISAGlobalAddressMCExpr * create(const MCSymbol &Symbol, MCContext &Ctx)
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm) const override
Definition PISAMCExpr.h:44
static bool classof(const MCExpr *E)
Definition PISAMCExpr.h:52
const MCSymbol & getSymbol() const
Definition PISAMCExpr.h:40
MCFragment * findAssociatedFragment() const override
Definition PISAMCExpr.h:50
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
void visitUsedExpr(MCStreamer &Streamer) const override
Definition PISAMCExpr.h:49
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.