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;
 
   54    Contents.push_back({AttributeType::Numeric, 
Attribute, 
Value, 
""});
 
   58                        bool OverwriteExisting) {
 
   60    if (AttributeItem *Item = getAttributeItem(
Attribute)) {
 
   61      if (!OverwriteExisting)
 
   63      Item->Type = AttributeType::Text;
 
   64      Item->StringValue = std::string(
Value);
 
   69    Contents.push_back({AttributeType::Text, 
Attribute, 0, 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);
 
   85    Contents.push_back({AttributeType::NumericAndText, 
Attribute, IntValue,
 
   86                        std::string(StringValue)});
 
   92  size_t calculateContentSize() 
const;
 
 
  112                  std::unique_ptr<MCObjectWriter> OW,
 
  113                  std::unique_ptr<MCCodeEmitter> 
Emitter)
 
 
  122    EmitMappingSymbol(
"$d");
 
 
  126    EmitMappingSymbol(
"$d");
 
 
  131    EmitMappingSymbol(
"$t");
 
 
  135    EmitMappingSymbol(
"$d");
 
 
 
dxil DXContainer Global Emitter
Functions, function parameters, and return types can have attributes to indicate how they should be t...
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.
friend class CSKYTargetELFStreamer
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()
CSKYTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
virtual void finishAttributeSection()
CSKYTargetStreamer(MCStreamer &S)
Context object for machine code objects.
void reset() override
state management
MCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
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.
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.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
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.