39#define DEBUG_TYPE "hexagonmcelfstreamer"
45 cl::desc(
"Global Pointer Addressing Size. The default size is 8."),
50 MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
51 std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter>
Emitter)
56 MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
57 std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter>
Emitter,
91 unsigned AccessSize) {
93 StringRef sbss[4] = {
".sbss.1",
".sbss.2",
".sbss.4",
".sbss.8"};
95 auto ELFSymbol = cast<MCSymbolELF>(Symbol);
96 if (!ELFSymbol->isBindingSet()) {
98 ELFSymbol->setExternal(
true);
113 if (ELFSymbol->isUndefined()) {
120 Section.ensureMinAlignment(ByteAlignment);
124 if (ELFSymbol->declareCommon(
Size, ByteAlignment))
126 " redeclared as different type");
132 ELFSymbol->setIndex(SectionIndex);
142 unsigned AccessSize) {
144 auto ELFSymbol = cast<MCSymbolELF>(Symbol);
146 ELFSymbol->setExternal(
false);
152 std::unique_ptr<MCAsmBackend> MAB,
153 std::unique_ptr<MCObjectWriter> OW,
154 std::unique_ptr<MCCodeEmitter> CE) {
dxil DXContainer Global Emitter
static cl::opt< unsigned > GPSize("gpsize", cl::NotHidden, cl::desc("Global Pointer Addressing Size. The default size is 8."), cl::Prefix, cl::init(8))
#define HEXAGON_PACKET_SIZE
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment, unsigned AccessSize)
void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment, unsigned AccessSize)
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
void EmitSymbol(const MCInst &Inst)
HexagonMCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
MCContext & getContext() const
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
void emitValueToAlignment(Align, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Instances of this class represent a single low-level machine instruction.
unsigned getNumOperands() const
unsigned getOpcode() const
const MCOperand & getOperand(unsigned i) const
MCAssembler & getAssembler()
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
const MCExpr * getExpr() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
MCContext & getContext() const
virtual void switchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
void visitUsedExpr(const MCExpr &Expr)
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
size_t bundleSize(MCInst const &MCI)
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &MCI)
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
int bit_width(T Value)
Returns the number of bits needed to represent Value if Value is nonzero.
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCInstrInfo * createHexagonMCInstrInfo()
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
MCStreamer * createHexagonELFStreamer(Triple const &TT, MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > CE)
This struct is a compact representation of a valid (non-zero power of two) alignment.