LLVM 24.0.0git
RISCVTargetStreamer.h
Go to the documentation of this file.
1//===-- RISCVTargetStreamer.h - RISC-V Target Streamer ---------*- 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_RISCV_MCTARGETDESC_RISCVTARGETSTREAMER_H
10#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVTARGETSTREAMER_H
11
12#include "RISCV.h"
13#include "RISCVMCOptions.h"
14#include "llvm/MC/MCStreamer.h"
16
17namespace llvm {
18
20
26
34
36 const RISCVMCOptions &CLOpts;
38 bool HasRVC = false;
39 bool HasTSO = false;
40
41public:
43 void finish() override;
44 virtual void reset();
45
47 virtual void emitDirectiveOptionExact();
48 virtual void emitDirectiveOptionNoExact();
49 virtual void emitDirectiveOptionPIC();
50 virtual void emitDirectiveOptionNoPIC();
51 virtual void emitDirectiveOptionPop();
52 virtual void emitDirectiveOptionPush();
53 virtual void emitDirectiveOptionRelax();
54 virtual void emitDirectiveOptionNoRelax();
55 virtual void emitDirectiveOptionRVC();
56 virtual void emitDirectiveOptionNoRVC();
57 virtual void setArchString(StringRef Arch) {}
58 virtual void emitDirectiveVariantCC(MCSymbol &Symbol);
59 virtual void emitAttribute(unsigned Attribute, unsigned Value);
60 virtual void finishAttributeSection();
61 virtual void emitTextAttribute(unsigned Attribute, StringRef String);
62 virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
63 StringRef StringValue);
64
65 void emitTargetAttributes(const MCSubtargetInfo &STI, bool EmitStackAlign);
67 RISCVABI::ABI getTargetABI() const { return TargetABI; }
68 bool hasTargetABI() const { return TargetABI != RISCVABI::ABI_Unknown; }
69 virtual void setFlagsFromFeatures(const MCSubtargetInfo &STI);
70 bool hasRVC() const { return HasRVC; }
71 bool hasTSO() const { return HasTSO; }
72};
73
74// This part is for ascii assembly output
77
78 void finishAttributeSection() override;
79 void emitAttribute(unsigned Attribute, unsigned Value) override;
80 void emitTextAttribute(unsigned Attribute, StringRef String) override;
81 void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
82 StringRef StringValue) override;
83
84public:
86
88 void emitDirectiveOptionExact() override;
89 void emitDirectiveOptionNoExact() override;
90 void emitDirectiveOptionPIC() override;
91 void emitDirectiveOptionNoPIC() override;
92 void emitDirectiveOptionPop() override;
93 void emitDirectiveOptionPush() override;
94 void emitDirectiveOptionRelax() override;
95 void emitDirectiveOptionNoRelax() override;
96 void emitDirectiveOptionRVC() override;
97 void emitDirectiveOptionNoRVC() override;
98 void emitDirectiveVariantCC(MCSymbol &Symbol) override;
99};
100
101}
102#endif
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Definition Attributes.h:106
Streaming machine code generation interface.
Definition MCStreamer.h:222
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
MCTargetStreamer(MCStreamer &S)
void emitDirectiveOptionArch(ArrayRef< RISCVOptionArchArg > Args) override
RISCVTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
void emitDirectiveVariantCC(MCSymbol &Symbol) override
virtual void setArchString(StringRef Arch)
virtual void emitAttribute(unsigned Attribute, unsigned Value)
RISCVABI::ABI getTargetABI() const
virtual void emitTextAttribute(unsigned Attribute, StringRef String)
virtual void emitDirectiveVariantCC(MCSymbol &Symbol)
void emitTargetAttributes(const MCSubtargetInfo &STI, bool EmitStackAlign)
virtual void setFlagsFromFeatures(const MCSubtargetInfo &STI)
virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue, StringRef StringValue)
void setTargetABI(RISCVABI::ABI ABI)
virtual void emitDirectiveOptionArch(ArrayRef< RISCVOptionArchArg > Args)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
LLVM Value Representation.
Definition Value.h:75
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
This is an optimization pass for GlobalISel generic memory operations.
RISCVOptionArchArg(RISCVOptionArchArgType Type, std::string Value)
RISCVOptionArchArgType Type