LLVM  15.0.0git
RISCVTargetStreamer.h
Go to the documentation of this file.
1 //===-- RISCVTargetStreamer.h - RISCV 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 
16 namespace llvm {
17 
18 class formatted_raw_ostream;
19 
22 
23 public:
25  void finish() override;
26 
27  virtual void emitDirectiveOptionPush();
28  virtual void emitDirectiveOptionPop();
29  virtual void emitDirectiveOptionPIC();
30  virtual void emitDirectiveOptionNoPIC();
31  virtual void emitDirectiveOptionRVC();
32  virtual void emitDirectiveOptionNoRVC();
33  virtual void emitDirectiveOptionRelax();
34  virtual void emitDirectiveOptionNoRelax();
35  virtual void emitAttribute(unsigned Attribute, unsigned Value);
36  virtual void finishAttributeSection();
37  virtual void emitTextAttribute(unsigned Attribute, StringRef String);
38  virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
39  StringRef StringValue);
40 
41  void emitTargetAttributes(const MCSubtargetInfo &STI);
43  RISCVABI::ABI getTargetABI() const { return TargetABI; }
44 };
45 
46 // This part is for ascii assembly output
49 
50  void finishAttributeSection() override;
51  void emitAttribute(unsigned Attribute, unsigned Value) override;
52  void emitTextAttribute(unsigned Attribute, StringRef String) override;
53  void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
54  StringRef StringValue) override;
55 
56 public:
58 
59  void emitDirectiveOptionPush() override;
60  void emitDirectiveOptionPop() override;
61  void emitDirectiveOptionPIC() override;
62  void emitDirectiveOptionNoPIC() override;
63  void emitDirectiveOptionRVC() override;
64  void emitDirectiveOptionNoRVC() override;
65  void emitDirectiveOptionRelax() override;
66  void emitDirectiveOptionNoRelax() override;
67 };
68 
69 }
70 #endif
llvm::RISCVTargetStreamer::emitAttribute
virtual void emitAttribute(unsigned Attribute, unsigned Value)
Definition: RISCVTargetStreamer.cpp:34
llvm::RISCVTargetStreamer::emitDirectiveOptionRelax
virtual void emitDirectiveOptionRelax()
Definition: RISCVTargetStreamer.cpp:32
ABI
Generic address nodes are lowered to some combination of target independent and machine specific ABI
Definition: Relocation.txt:34
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionRVC
void emitDirectiveOptionRVC() override
Definition: RISCVTargetStreamer.cpp:83
llvm::RISCVTargetStreamer::emitTargetAttributes
void emitTargetAttributes(const MCSubtargetInfo &STI)
Definition: RISCVTargetStreamer.cpp:46
llvm::Attribute
Definition: Attributes.h:52
llvm::RISCVTargetStreamer::emitDirectiveOptionNoRVC
virtual void emitDirectiveOptionNoRVC()
Definition: RISCVTargetStreamer.cpp:31
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:201
llvm::RISCVTargetStreamer::emitTextAttribute
virtual void emitTextAttribute(unsigned Attribute, StringRef String)
Definition: RISCVTargetStreamer.cpp:36
llvm::RISCVTargetStreamer::emitDirectiveOptionPop
virtual void emitDirectiveOptionPop()
Definition: RISCVTargetStreamer.cpp:27
MCSubtargetInfo.h
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:93
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionRelax
void emitDirectiveOptionRelax() override
Definition: RISCVTargetStreamer.cpp:91
llvm::RISCVTargetStreamer::emitDirectiveOptionNoRelax
virtual void emitDirectiveOptionNoRelax()
Definition: RISCVTargetStreamer.cpp:33
llvm::RISCVTargetStreamer::RISCVTargetStreamer
RISCVTargetStreamer(MCStreamer &S)
Definition: RISCVTargetStreamer.cpp:22
llvm::RISCVTargetStreamer::emitDirectiveOptionPIC
virtual void emitDirectiveOptionPIC()
Definition: RISCVTargetStreamer.cpp:28
llvm::formatted_raw_ostream
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Definition: FormattedStream.h:30
llvm::RISCVTargetStreamer::emitDirectiveOptionNoPIC
virtual void emitDirectiveOptionNoPIC()
Definition: RISCVTargetStreamer.cpp:29
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionNoRelax
void emitDirectiveOptionNoRelax() override
Definition: RISCVTargetStreamer.cpp:95
RISCV.h
llvm::RISCVTargetAsmStreamer
Definition: RISCVTargetStreamer.h:47
llvm::RISCVTargetStreamer::finishAttributeSection
virtual void finishAttributeSection()
Definition: RISCVTargetStreamer.cpp:35
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::RISCVTargetAsmStreamer::RISCVTargetAsmStreamer
RISCVTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
Definition: RISCVTargetStreamer.cpp:63
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionPop
void emitDirectiveOptionPop() override
Definition: RISCVTargetStreamer.cpp:71
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::RISCVTargetStreamer::finish
void finish() override
Definition: RISCVTargetStreamer.cpp:24
llvm::RISCVTargetStreamer::emitDirectiveOptionRVC
virtual void emitDirectiveOptionRVC()
Definition: RISCVTargetStreamer.cpp:30
llvm::RISCVTargetStreamer::setTargetABI
void setTargetABI(RISCVABI::ABI ABI)
Definition: RISCVTargetStreamer.cpp:41
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionPIC
void emitDirectiveOptionPIC() override
Definition: RISCVTargetStreamer.cpp:75
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionNoRVC
void emitDirectiveOptionNoRVC() override
Definition: RISCVTargetStreamer.cpp:87
llvm::RISCVTargetStreamer::emitIntTextAttribute
virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue, StringRef StringValue)
Definition: RISCVTargetStreamer.cpp:38
llvm::RISCVABI::ABI_Unknown
@ ABI_Unknown
Definition: RISCVBaseInfo.h:355
MCStreamer.h
llvm::RISCVTargetStreamer
Definition: RISCVTargetStreamer.h:20
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionPush
void emitDirectiveOptionPush() override
Definition: RISCVTargetStreamer.cpp:67
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::RISCVTargetStreamer::getTargetABI
RISCVABI::ABI getTargetABI() const
Definition: RISCVTargetStreamer.h:43
llvm::RISCVABI::ABI
ABI
Definition: RISCVBaseInfo.h:347
llvm::RISCVTargetAsmStreamer::emitDirectiveOptionNoPIC
void emitDirectiveOptionNoPIC() override
Definition: RISCVTargetStreamer.cpp:79
llvm::RISCVTargetStreamer::emitDirectiveOptionPush
virtual void emitDirectiveOptionPush()
Definition: RISCVTargetStreamer.cpp:26