10 #ifndef LLVM_MC_MCOBJECTSTREAMER_H
11 #define LLVM_MC_MCOBJECTSTREAMER_H
21 class MCSubtargetInfo;
27 class raw_pwrite_stream;
54 void reset()
override;
111 unsigned ValueSize = 1,
112 unsigned MaxBytesToEmit = 0)
override;
114 unsigned MaxBytesToEmit = 0)
override;
117 unsigned Column,
unsigned Flags,
118 unsigned Isa,
unsigned Discriminator,
122 unsigned PointerSize);
127 void EmitFill(uint64_t NumBytes, uint8_t FillValue)
override;
128 void EmitZeros(uint64_t NumBytes)
override;
139 unsigned Size)
override;
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void EmitBytes(StringRef Data) override
Emit the bytes in Data into the output.
bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection)
void EmitLabel(MCSymbol *Symbol) override
Emit a label for Symbol into the current section.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &)
Emit an instruction to a special fragment, because this instruction can change its size during relaxa...
void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize)
MCFragment * getCurrentFragment() const
void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
MCSection * getCurrentSectionOnly() const
Base class for the full range of assembler expressions which are needed for parsing.
void EmitFill(uint64_t NumBytes, uint8_t FillValue) override
Emit NumBytes bytes worth of the value specified by FillValue.
bool mayHaveInstructions(MCSection &Sec) const override
void EmitBundleLock(bool AlignToEnd) override
The following instructions are a bundle-locked group.
Context object for machine code objects.
Streaming object file generation interface.
Instances of this class represent a single low-level machine instruction.
void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) override
Emit the absolute difference between two symbols if possible.
void EmitULEB128Value(const MCExpr *Value) override
Streaming machine code generation interface.
void visitUsedSymbol(const MCSymbol &Sym) override
void EmitSLEB128Value(const MCExpr *Value) override
void insert(MCFragment *F)
void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
MCAssembler & getAssembler()
MCCodeEmitter - Generic instruction encoding interface.
iterator insert(iterator where, NodeTy *New)
void EmitValueImpl(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
void EmitFrames(MCAsmBackend *MAB)
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
void EmitCFISections(bool EH, bool Debug) override
void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel, const MCSymbol *Label)
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
~MCObjectStreamer() override
void flushPendingLabels(MCFragment *F, uint64_t FOffset=0)
If any labels have been emitted but not assigned fragments, ensure that they get assigned, either to F if possible or to a new data fragment.
void EmitBundleAlignMode(unsigned AlignPow2) override
Set the bundle alignment mode from now on in the section.
void EmitZeros(uint64_t NumBytes) override
Emit NumBytes worth of zeros.
void EmitBundleUnlock() override
Ends a bundle-locked group.
bool EmitValueToOffset(const MCExpr *Offset, unsigned char Value) override
Emit some number of copies of Value until the byte offset Offset is reached.
void FinishImpl() override
Streamer specific finalization.
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
bool isIntegratedAssemblerRequired() const override
Object streamers require the integrated assembler.
void reset() override
state management
MCSubtargetInfo - Generic base class for all target subtargets.
void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName) override
This implements the DWARF2 '.loc fileno lineno ...' assembler directive.
An abstract base class for streams implementations that also support a pwrite operation.
Fragment for data and encoded instructions.
LLVM Value Representation.
Generic interface to target specific assembler backends.
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
void EmitGPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.
void setParent(MCSection *Value)
MCSection::FragmentListType & getFragmentList()
void EmitGPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
MCDataFragment * getOrCreateDataFragment()
Get a data fragment to write into, creating a new one if the current fragment is not a data fragment...
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter)