LLVM 17.0.0git
RISCVELFStreamer.h
Go to the documentation of this file.
1//===-- RISCVELFStreamer.h - RISC-V ELF 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_RISCVELFSTREAMER_H
10#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVELFSTREAMER_H
11
12#include "RISCVTargetStreamer.h"
14
15using namespace llvm;
16
18 static bool requiresFixups(MCContext &C, const MCExpr *Value,
19 const MCExpr *&LHS, const MCExpr *&RHS);
20 void reset() override;
21
22public:
23 RISCVELFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> MAB,
24 std::unique_ptr<MCObjectWriter> MOW,
25 std::unique_ptr<MCCodeEmitter> MCE)
26 : MCELFStreamer(C, std::move(MAB), std::move(MOW), std::move(MCE)) {}
27
28 void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override;
29};
30
31namespace llvm {
32
34private:
35 StringRef CurrentVendor;
36
37 MCSection *AttributeSection = nullptr;
38 const MCSubtargetInfo &STI;
39
40 void emitAttribute(unsigned Attribute, unsigned Value) override;
41 void emitTextAttribute(unsigned Attribute, StringRef String) override;
42 void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
43 StringRef StringValue) override;
44 void finishAttributeSection() override;
45
46 void reset() override;
47
48public:
51
52 void emitDirectiveOptionPush() override;
53 void emitDirectiveOptionPop() override;
54 void emitDirectiveOptionPIC() override;
55 void emitDirectiveOptionNoPIC() override;
56 void emitDirectiveOptionRVC() override;
57 void emitDirectiveOptionNoRVC() override;
58 void emitDirectiveOptionRelax() override;
59 void emitDirectiveOptionNoRelax() override;
60 void emitDirectiveVariantCC(MCSymbol &Symbol) override;
61
62 void finish() override;
63};
64
66 std::unique_ptr<MCAsmBackend> MAB,
67 std::unique_ptr<MCObjectWriter> MOW,
68 std::unique_ptr<MCCodeEmitter> MCE,
69 bool RelaxAll);
70}
71#endif
uint64_t Size
Value * RHS
Value * LHS
RISCVELFStreamer(MCContext &C, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > MOW, std::unique_ptr< MCCodeEmitter > MCE)
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override
Emit the expression Value into the output as a native integer of the given Size bytes.
Context object for machine code objects.
Definition: MCContext.h:76
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
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:41
void emitDirectiveOptionPop() override
void emitDirectiveOptionPush() override
void emitDirectiveOptionNoPIC() override
void emitDirectiveOptionNoRVC() override
void emitDirectiveVariantCC(MCSymbol &Symbol) override
void emitDirectiveOptionRelax() override
RISCVELFStreamer & getStreamer()
void emitDirectiveOptionNoRelax() override
void emitDirectiveOptionPIC() override
void emitDirectiveOptionRVC() override
Represents a location in source code.
Definition: SMLoc.h:23
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
LLVM Value Representation.
Definition: Value.h:74
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1946
MCELFStreamer * createRISCVELFStreamer(MCContext &C, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > MOW, std::unique_ptr< MCCodeEmitter > MCE, bool RelaxAll)
Definition: BitVector.h:858