14 #define DEBUG_TYPE "hexagonmcelfstreamer"
35 cl::desc(
"Global Pointer Addressing Size. The default size is 8."),
49 MCB =
const_cast<MCInst *
>(&MCK);
57 bool Extended =
false;
95 unsigned AccessSize) {
97 StringRef sbss[4] = {
".sbss.1",
".sbss.2",
".sbss.4",
".sbss.8"};
99 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
100 if (!ELFSymbol->isBindingSet()) {
102 ELFSymbol->setExternal(
true);
109 ((AccessSize == 0) || (Size == 0) || (Size >
GPSize))
122 if (ELFSymbol->declareCommon(Size, ByteAlignment))
124 " redeclared as different type");
125 if ((AccessSize) && (Size <=
GPSize)) {
126 uint64_t SectionIndex =
130 ELFSymbol->setIndex(SectionIndex);
139 unsigned AccessSize) {
141 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
143 ELFSymbol->setExternal(
false);
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
void AssignSection(MCSymbol *Symbol, MCSection *Section)
Sets the symbol's section.
Instances of this class represent a uniqued identifier for a section in the current translation unit...
bool isDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCSectionELF * getELFSection(StringRef Section, unsigned Type, unsigned Flags)
void padEndloop(MCInst &MCI)
void clampExtended(MCInstrInfo const &MCII, MCInst &MCI)
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
MCContext & getContext() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
bool isImmext(MCInst const &MCI)
#define HEXAGON_PACKET_SIZE
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
static cl::opt< unsigned > GPSize("gpsize", cl::NotHidden, cl::desc("Global Pointer Addressing Size. The default size is 8."), cl::Prefix, cl::init(8))
MCContext & getContext() const
Context object for machine code objects.
Instances of this class represent a single low-level machine instruction.
const MCExpr * getExpr() const
initializer< Ty > init(const Ty &Val)
Streaming machine code generation interface.
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
MCAssembler & getAssembler()
MCCodeEmitter - Generic instruction encoding interface.
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
iterator_range< MCInst::const_iterator > bundleInstructions(MCInst const &MCI)
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
void setOpcode(unsigned Op)
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
bool HexagonMCShuffle(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &)
void EmitSymbol(const MCInst &Inst)
BUNDLE - This instruction represents an instruction bundle.
unsigned getOpcode() const
void visitUsedExpr(const MCExpr &Expr)
MCStreamer * createHexagonELFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *CE)
static MCOperand createInst(const MCInst *Val)
StringRef getName() const
getName - Get the symbol name.
unsigned getNumOperands() const
MCSubtargetInfo - Generic base class for all target subtargets.
const MCInst * getInst() const
size_t bundleSize(MCInst const &MCI)
An abstract base class for streams implementations that also support a pwrite operation.
Generic interface to target specific assembler backends.
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
static MCOperand createImm(int64_t Val)
unsigned Log2_64(uint64_t Value)
Log2_64 - This function returns the floor log base 2 of the specified value, -1 if the value is zero...
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
const MCOperand & getOperand(unsigned i) const
void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)