LLVM 19.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 "llvm/MC/MCStreamer.h"
15
16namespace llvm {
17
18class formatted_raw_ostream;
19
21 Full,
22 Plus,
23 Minus,
24};
25
28 std::string Value;
29
31 : Type(Type), Value(Value) {}
32};
33
36 bool HasRVC = false;
37 bool HasTSO = false;
38
39public:
41 void finish() override;
42 virtual void reset();
43
44 virtual void emitDirectiveOptionPush();
45 virtual void emitDirectiveOptionPop();
46 virtual void emitDirectiveOptionPIC();
47 virtual void emitDirectiveOptionNoPIC();
48 virtual void emitDirectiveOptionRVC();
49 virtual void emitDirectiveOptionNoRVC();
50 virtual void emitDirectiveOptionRelax();
51 virtual void emitDirectiveOptionNoRelax();
53 virtual void emitDirectiveVariantCC(MCSymbol &Symbol);
54 virtual void emitAttribute(unsigned Attribute, unsigned Value);
55 virtual void finishAttributeSection();
56 virtual void emitTextAttribute(unsigned Attribute, StringRef String);
57 virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
58 StringRef StringValue);
59
60 void emitTargetAttributes(const MCSubtargetInfo &STI, bool EmitStackAlign);
62 RISCVABI::ABI getTargetABI() const { return TargetABI; }
64 bool hasRVC() const { return HasRVC; }
65 bool hasTSO() const { return HasTSO; }
66};
67
68// This part is for ascii assembly output
71
72 void finishAttributeSection() override;
73 void emitAttribute(unsigned Attribute, unsigned Value) override;
74 void emitTextAttribute(unsigned Attribute, StringRef String) override;
75 void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
76 StringRef StringValue) override;
77
78public:
80
81 void emitDirectiveOptionPush() override;
82 void emitDirectiveOptionPop() override;
83 void emitDirectiveOptionPIC() override;
84 void emitDirectiveOptionNoPIC() override;
85 void emitDirectiveOptionRVC() override;
86 void emitDirectiveOptionNoRVC() override;
87 void emitDirectiveOptionRelax() override;
88 void emitDirectiveOptionNoRelax() override;
90 void emitDirectiveVariantCC(MCSymbol &Symbol) override;
91};
92
93}
94#endif
bool HasRVC
Definition: ELF_riscv.cpp:502
raw_pwrite_stream & OS
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Streaming machine code generation interface.
Definition: MCStreamer.h:212
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:40
Target specific streamer interface.
Definition: MCStreamer.h:93
void emitDirectiveOptionArch(ArrayRef< RISCVOptionArchArg > Args) override
void emitDirectiveVariantCC(MCSymbol &Symbol) override
virtual void emitDirectiveOptionNoRelax()
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)
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)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
LLVM Value Representation.
Definition: Value.h:74
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.
Definition: AddressRanges.h:18
RISCVOptionArchArg(RISCVOptionArchArgType Type, std::string Value)
RISCVOptionArchArgType Type