9#ifndef LLVM_LIB_TARGET_CSKY_CSKYELFSTREAMER_H
10#define LLVM_LIB_TARGET_CSKY_CSKYELFSTREAMER_H
21 enum class AttributeType { Hidden, Numeric, Text, NumericAndText };
23 struct AttributeItem {
27 std::string StringValue;
35 AttributeItem *getAttributeItem(
unsigned Attribute) {
36 for (
size_t i = 0; i < Contents.
size(); ++i)
43 bool OverwriteExisting) {
45 if (AttributeItem *Item = getAttributeItem(
Attribute)) {
46 if (!OverwriteExisting)
48 Item->Type = AttributeType::Numeric;
49 Item->IntValue =
Value;
58 bool OverwriteExisting) {
60 if (AttributeItem *Item = getAttributeItem(
Attribute)) {
61 if (!OverwriteExisting)
63 Item->Type = AttributeType::Text;
64 Item->StringValue = std::string(
Value);
72 void setAttributeItems(
unsigned Attribute,
unsigned IntValue,
73 StringRef StringValue,
bool OverwriteExisting) {
75 if (AttributeItem *Item = getAttributeItem(
Attribute)) {
76 if (!OverwriteExisting)
78 Item->Type = AttributeType::NumericAndText;
79 Item->IntValue = IntValue;
80 Item->StringValue = std::string(StringValue);
86 std::string(StringValue)});
91 void finishAttributeSection()
override;
92 size_t calculateContentSize()
const;
112 std::unique_ptr<MCObjectWriter> OW,
113 std::unique_ptr<MCCodeEmitter>
Emitter)
121 SMLoc Loc)
override {
122 EmitMappingSymbol(
"$d");
126 EmitMappingSymbol(
"$d");
131 EmitMappingSymbol(
"$t");
135 EmitMappingSymbol(
"$d");
dxil DXContainer Global Emitter
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
CSKYELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
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.
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) override
Emit Size bytes worth of the value specified by FillValue.
~CSKYELFStreamer() override=default
void reset() override
state management
MCELFStreamer & getStreamer()
Context object for machine code objects.
void reset() override
state management
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override
Emit Size bytes worth of the value specified by FillValue.
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
Generic base class for all target subtargets.
Represents a location in source code.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.