14 #define DEBUG_TYPE "hexagonmcelfstreamer"
42 cl::desc(
"Global Pointer Addressing Size. The default size is 8."),
54 MCB =
const_cast<MCInst *
>(&MCK);
62 bool Extended =
false;
100 unsigned AccessSize) {
102 StringRef sbss[4] = {
".sbss.1",
".sbss.2",
".sbss.4",
".sbss.8"};
104 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
105 if (!ELFSymbol->isBindingSet()) {
107 ELFSymbol->setExternal(
true);
114 ((AccessSize == 0) || (Size == 0) || (Size >
GPSize))
127 if (ByteAlignment > Section.getAlignment())
128 Section.setAlignment(ByteAlignment);
132 if (ELFSymbol->declareCommon(Size, ByteAlignment))
134 " redeclared as different type");
135 if ((AccessSize) && (Size <=
GPSize)) {
136 uint64_t SectionIndex =
140 ELFSymbol->setIndex(SectionIndex);
149 unsigned AccessSize) {
151 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
153 ELFSymbol->setExternal(
false);
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current 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)
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
MCContext & getContext() const
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))
void EmitLabel(MCSymbol *Symbol) override
Emit a label for Symbol into the current section.
void padEndloop(MCContext &Context, MCInst &MCI)
MCContext & getContext() const
void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Context object for machine code objects.
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Instances of this class represent a single low-level machine instruction.
const MCExpr * getExpr() const
initializer< Ty > init(const Ty &Val)
void EmitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
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.
iterator_range< MCInst::const_iterator > bundleInstructions(MCInst const &MCI)
void clampExtended(MCInstrInfo const &MCII, MCContext &Context, MCInst &MCI)
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
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)
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Generic interface to target specific assembler backends.
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
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)