14 #define DEBUG_TYPE "hexagonmcelfstreamer"
42 cl::desc(
"Global Pointer Addressing Size. The default size is 8."),
51 bool Extended =
false;
90 unsigned AccessSize) {
92 StringRef sbss[4] = {
".sbss.1",
".sbss.2",
".sbss.4",
".sbss.8"};
94 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
95 if (!ELFSymbol->isBindingSet()) {
97 ELFSymbol->setExternal(
true);
104 ((AccessSize == 0) || (Size == 0) || (Size >
GPSize))
112 if (ELFSymbol->isUndefined(
false)) {
119 if (ByteAlignment > Section.getAlignment())
120 Section.setAlignment(ByteAlignment);
124 if (ELFSymbol->declareCommon(Size, ByteAlignment))
126 " redeclared as different type");
127 if ((AccessSize) && (Size <=
GPSize)) {
128 uint64_t SectionIndex =
132 ELFSymbol->setIndex(SectionIndex);
142 unsigned AccessSize) {
144 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
146 ELFSymbol->setExternal(
false);
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 EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool) override
Emit the given Instruction into the current section.
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
MCContext & getContext() const
bool isImmext(MCInst const &MCI)
MCStreamer * createHexagonELFStreamer(Triple const &TT, MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *CE)
#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))
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &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.
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.
void clampExtended(MCInstrInfo const &MCII, MCContext &Context, MCInst &MCI)
Triple - Helper class for working with autoconf configuration names.
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
void EmitSymbol(const MCInst &Inst)
unsigned getOpcode() const
void visitUsedExpr(const MCExpr &Expr)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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)
void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
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.
StringRef - Represent a constant reference to a string, i.e.
unsigned Log2_64(uint64_t Value)
Return 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)
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool=false) override
Emit the given Instruction into the current section.