10 #ifndef LLVM_MC_MCOBJECTSTREAMER_H 11 #define LLVM_MC_MCOBJECTSTREAMER_H 21 class MCSubtargetInfo;
27 class raw_pwrite_stream;
37 std::unique_ptr<MCAssembler> Assembler;
42 struct PendingMCFixup {
47 : Sym(McSym), Fixup(McFixup), DF(F) {}
56 void resolvePendingFixups();
60 std::unique_ptr<MCObjectWriter> OW,
61 std::unique_ptr<MCCodeEmitter> Emitter);
66 void reset()
override;
120 bool =
false)
override;
131 unsigned ValueSize = 1,
132 unsigned MaxBytesToEmit = 0)
override;
134 unsigned MaxBytesToEmit = 0)
override;
142 unsigned Column,
unsigned Flags,
143 unsigned Isa,
unsigned Discriminator,
147 unsigned PointerSize);
151 unsigned Column,
bool PrologueEnd,
bool IsStmt,
156 unsigned SourceFileId,
157 unsigned SourceLineNum,
161 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
178 void emitFill(
const MCExpr &NumValues, int64_t Size, int64_t Expr,
197 unsigned Size)
override;
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Fragment for adding required padding.
void EmitBytes(StringRef Data) override
Emit the bytes in Data into the output.
bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection)
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void EmitCodePaddingBasicBlockStart(const MCCodePaddingContext &Context) override
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 EmitCVFileChecksumOffsetDirective(unsigned FileNo) override
This implements the CodeView '.cv_filechecksumoffset' assembler directive.
void EmitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion) override
This implements the CodeView '.cv_def_range' assembler directive.
void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize)
void EmitCVStringTableDirective() override
This implements the CodeView '.cv_stringtable' assembler directive.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc, const MCSubtargetInfo &STI) override
Emit a .reloc directive.
Base class for the full range of assembler expressions which are needed for parsing.
bool mayHaveInstructions(MCSection &Sec) const override
void flushPendingLabels()
Create a dummy fragment to assign any pending labels.
void EmitBundleLock(bool AlignToEnd) override
The following instructions are a bundle-locked group.
Context object for machine code objects.
void EmitDTPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value.
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override
Emit Size bytes worth of the value specified by FillValue.
void EmitFileDirective(StringRef Filename) override
Switch to a new logical file.
Streaming object file generation interface.
MCAssembler * getAssemblerPtr() override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void EmitDTPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value.
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 EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
void visitUsedSymbol(const MCSymbol &Sym) override
void EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc) override
This implements the CodeView '.cv_loc' assembler directive.
void EmitSLEB128Value(const MCExpr *Value) override
void insert(MCFragment *F)
void EmitCodePaddingBasicBlockEnd(const MCCodePaddingContext &Context) override
void EmitAddrsig() override
void EmitAddrsigSym(const MCSymbol *Sym) override
void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
MCAssembler & getAssembler()
void EmitFrames(MCAsmBackend *MAB)
void emitValueToOffset(const MCExpr *Offset, unsigned char Value, SMLoc Loc) override
Emit some number of copies of Value until the byte offset Offset is reached.
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.
PowerPC TLS Dynamic Call Fixup
MCPaddingFragment * getOrCreatePaddingFragment()
Iterator for intrusive lists based on ilist_node.
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.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void EmitCVLinetableDirective(unsigned FunctionId, const MCSymbol *Begin, const MCSymbol *End) override
This implements the CodeView '.cv_linetable' assembler directive.
void EmitBundleAlignMode(unsigned AlignPow2) override
Set the bundle alignment mode from now on in the section.
MCSection * getCurrentSectionOnly() const
void EmitTPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a tprel (32-bit TP relative) value.
MCDataFragment * getOrCreateDataFragment(const MCSubtargetInfo *STI=nullptr)
Get a data fragment to write into, creating a new one if the current fragment is not a data fragment...
iterator insert(iterator where, pointer New)
void EmitBundleUnlock() override
Ends a bundle-locked group.
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
Generic base class for all target subtargets.
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
void emitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
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.
void EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym) override
This implements the CodeView '.cv_inline_linetable' assembler directive.
MCFragment * getCurrentFragment() const
Fragment for data and encoded instructions.
MCObjectStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
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.
void EmitCVFileChecksumsDirective() override
This implements the CodeView '.cv_filechecksums' assembler directive.
Represents a location in source code.
void setParent(MCSection *Value)
void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo) override
Emit the absolute difference between two symbols encoded with ULEB128.
MCSection::FragmentListType & getFragmentList()
void EmitGPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
void EmitTPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a tprel (64-bit TP relative) value.
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool=false) override
Emit the given Instruction into the current section.