Go to the documentation of this file.
28 std::unique_ptr<MCAsmBackend> TAB,
29 std::unique_ptr<MCObjectWriter> OW,
30 std::unique_ptr<MCCodeEmitter> Emitter)
34 EmitEHFrame(
true), EmitDebugFrame(
false) {
35 if (Assembler->getBackendPtr())
46 return Assembler.get();
54 if (!PendingLabels.empty()) {
57 PendingLabels.clear();
64 PendingLabelSections.insert(CurSection);
67 PendingLabels.push_back(
S);
73 assert(PendingLabels.empty());
77 if (!PendingLabels.empty()) {
80 PendingLabels.clear();
93 if (!PendingLabels.empty()) {
98 PendingLabels.clear();
102 for (
MCSection* Section : PendingLabelSections)
103 Section->flushPendingLabels();
113 void MCObjectStreamer::resolvePendingFixups() {
114 for (PendingMCFixup &PendingFixup : PendingFixups) {
115 if (!PendingFixup.Sym || PendingFixup.Sym->isUndefined ()) {
117 "unresolved relocation offset");
121 PendingFixup.Fixup.setOffset(PendingFixup.Sym->getOffset() +
122 PendingFixup.Fixup.getOffset());
127 MCFragment *SymFragment = PendingFixup.Sym->getFragment();
128 switch (SymFragment->
getKind()) {
132 cast<MCEncodedFragmentWithFixups<8, 1>>(SymFragment)
134 .push_back(PendingFixup.Fixup);
138 cast<MCEncodedFragmentWithFixups<32, 4>>(SymFragment)
140 .push_back(PendingFixup.Fixup);
143 PendingFixup.DF->getFixups().push_back(PendingFixup.Fixup);
147 PendingFixups.clear();
155 if (!Hi->getFragment() || Hi->getFragment() != Lo->getFragment() ||
156 Hi->isVariable() || Lo->isVariable())
159 return Hi->getOffset() - Lo->getOffset();
184 EmitDebugFrame =
false;
185 PendingLabels.clear();
186 PendingLabelSections.clear();
205 return &*std::prev(CurInsertionPoint);
213 if (!
F.hasInstructions())
221 return !STI ||
F.getSubtargetInfo() == STI;
235 Assembler->registerSymbol(Sym);
241 EmitDebugFrame = Debug;
255 if (!
isUIntN(8 * Size, AbsValue) && !
isIntN(8 * Size, AbsValue)) {
257 Loc,
"value evaluated as " +
Twine(AbsValue) +
" is out of range.");
263 DF->getFixups().push_back(
266 DF->getContents().resize(
DF->getContents().size() + Size, 0);
269 MCSymbol *MCObjectStreamer::emitCFILabel() {
298 Symbol->setOffset(
F->getContents().size());
311 auto Assignments = pendingAssignments.find(
Symbol);
312 if (Assignments != pendingAssignments.end()) {
313 for (
const PendingAssignment &A : Assignments->second)
316 pendingAssignments.erase(Assignments);
328 auto *
DF = dyn_cast_or_null<MCDataFragment>(
F);
329 Symbol->setOffset(Offset);
333 assert(isa<MCDummyFragment>(
F) &&
334 "F must either be an MCDataFragment or the pending MCDummyFragment");
364 const MCExpr *Subsection) {
369 const MCExpr *Subsection) {
370 assert(Section &&
"Cannot switch to a null section!");
375 int64_t IntSubsection = 0;
379 if (IntSubsection < 0 || IntSubsection > 8192)
381 CurSubsectionIdx = unsigned(IntSubsection);
383 Section->getSubsectionInsertionPoint(CurSubsectionIdx);
395 const MCSymbol *
Target = &cast<MCSymbolRefExpr>(*Value).getSymbol();
399 if (
Target->isRegistered())
415 "' cannot have instructions");
419 emitInstructionImpl(Inst, STI);
423 void MCObjectStreamer::emitInstructionImpl(
const MCInst &Inst,
439 emitInstToData(Inst, STI);
453 emitInstToData(Relaxed, STI);
475 IF->getContents().append(Code.begin(), Code.end());
480 "Aligned bundling is not implemented for this object format";
496 unsigned Column,
unsigned Flags,
498 unsigned Discriminator,
505 Discriminator, FileName);
521 int64_t LineDelta,
const MCSymbol *Label,
582 unsigned Line,
unsigned Column,
583 bool PrologueEnd,
bool IsStmt,
593 FileNo, Line, Column, PrologueEnd,
606 unsigned PrimaryFunctionId,
unsigned SourceFileId,
unsigned SourceLineNum,
609 *
this, PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym,
612 PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym, FnEndSym);
616 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
641 DF->getContents().append(
Data.begin(),
Data.end());
647 unsigned MaxBytesToEmit) {
648 if (MaxBytesToEmit == 0)
661 unsigned MaxBytesToEmit) {
679 DF->getContents().resize(
DF->getContents().size() + 4, 0);
689 DF->getContents().resize(
DF->getContents().size() + 8, 0);
699 DF->getContents().resize(
DF->getContents().size() + 4, 0);
709 DF->getContents().resize(
DF->getContents().size() + 8, 0);
717 DF->getFixups().push_back(
719 DF->getContents().resize(
DF->getContents().size() + 4, 0);
727 DF->getFixups().push_back(
729 DF->getContents().resize(
DF->getContents().size() + 8, 0);
735 if (
Symbol.isVariable()) {
739 return std::make_pair(
false,
740 std::string(
"symbol in .reloc offset is not "
748 return std::make_pair(
false,
749 std::string(
"symbol in offset has no data "
751 DF = cast<MCDataFragment>(Fragment);
756 return std::make_pair(
false,
757 std::string(
".reloc symbol offset is not "
762 return std::make_pair(
false,
763 std::string(
"symbol used in the .reloc offset is "
767 return std::make_pair(
false,
768 std::string(
"symbol used in the .reloc offset is "
775 return std::make_pair(
false,
776 std::string(
"symbol in offset has no data "
779 DF = cast<MCDataFragment>(Fragment);
781 RelocOffset =
Symbol.getOffset();
786 return std::make_pair(
false,
787 std::string(
"symbol in offset has no data "
789 DF = cast<MCDataFragment>(Fragment);
800 return std::make_pair(
true, std::string(
"unknown relocation name"));
812 if (!Offset.evaluateAsRelocatable(OffsetVal,
nullptr,
nullptr))
813 return std::make_pair(
false,
814 std::string(
".reloc offset is not relocatable"));
817 return std::make_pair(
false, std::string(
".reloc offset is negative"));
818 DF->getFixups().push_back(
823 return std::make_pair(
false,
824 std::string(
".reloc offset is not representable"));
836 DF->getFixups().push_back(
842 PendingFixups.emplace_back(
858 int64_t Expr,
SMLoc Loc) {
859 int64_t IntNumValues;
862 if (IntNumValues < 0) {
865 "'.fill' directive with negative repeat count has no effect");
869 int64_t NonZeroSize = Size > 4 ? 4 : Size;
870 Expr &= ~0ULL >> (64 - NonZeroSize * 8);
873 if (NonZeroSize < Size)
935 resolvePendingFixups();
virtual void emitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
This implements the CodeView '.cv_inline_linetable' assembler directive.
Optional< std::pair< bool, std::string > > emitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc, const MCSubtargetInfo &STI) override
Record a relocation described by the .reloc directive.
MCAsmBackend & getBackend() const
bool isBundleLocked() const
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.
const MCObjectFileInfo * getObjectFileInfo() const
void emitCVLinetableDirective(unsigned FunctionId, const MCSymbol *Begin, const MCSymbol *End) override
This implements the CodeView '.cv_linetable' assembler directive.
void emitFileDirective(StringRef Filename) override
Switch to a new logical file.
This is an optimization pass for GlobalISel generic memory operations.
void Finish()
Finish - Do final processing and write the object to the output stream.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
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.
@ FK_DTPRel_8
A eight-byte dtp relative fixup.
virtual void emitInstructionEnd(MCObjectStreamer &OS, const MCInst &Inst)
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
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.
CodeViewContext & getCVContext()
virtual void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo)
Emit the absolute difference between two symbols encoded with ULEB128.
bool getUseAssemblerInfoForParsing()
Context object for machine code objects.
MCObjectStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
uint64_t getOffset() const
void recordCVLoc(MCContext &Ctx, const MCSymbol *Label, unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt)
Saves the information from the currently parsed .cv_loc directive and sets CVLocSeen.
void emitDTPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value.
virtual void emitCFISections(bool EH, bool Debug)
void addPendingLabel(MCSymbol *label, unsigned Subsection=0)
Add a pending label for the requested subsection.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Target - Wrapper for Target specific information.
void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo) override
Emit the absolute difference between two symbols encoded with ULEB128.
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
void emitBundleLock(bool AlignToEnd) override
The following instructions are a bundle-locked group.
void emitConditionalAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol, but only if Value is also emitted.
virtual void emitCVLinetableDirective(unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd)
This implements the CodeView '.cv_linetable' assembler directive.
void emitCFISections(bool EH, bool Debug) override
void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) override
Emit the absolute difference between two symbols if possible.
virtual void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset)
virtual void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
MCFragment * getFragment(bool SetUsed=true) const
static const MCExpr * buildSymbolDiff(MCObjectStreamer &OS, const MCSymbol *A, const MCSymbol *B)
void addAddrsigSymbol(const MCSymbol *Sym)
Record the given symbol in the address-significance table to be written diring writeObject().
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
void setAllowAutoPadding(bool v)
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
void visitUsedSymbol(const MCSymbol &Sym) override
void emitCVFileChecksumOffsetDirective(unsigned FileNo) override
This implements the CodeView '.cv_filechecksumoffset' assembler directive.
Instances of this class represent a single low-level machine instruction.
void changeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
void reset() override
state management
void emitLineTableForFunction(MCObjectStreamer &OS, unsigned FuncId, const MCSymbol *FuncBegin, const MCSymbol *FuncEnd)
Emits a line table substream.
void emitDTPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value.
@ FK_TPRel_4
A four-byte tp relative fixup.
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
FragmentListType::iterator iterator
static void emitDwarfSetLineAddr(MCObjectStreamer &OS, MCDwarfLineTableParams Params, int64_t LineDelta, const MCSymbol *Label, int PointerSize)
Streaming machine code generation interface.
static void Emit(MCStreamer *MCOS)
Generic interface to target specific assembler backends.
static MCFixupKind getKindForSize(unsigned Size, bool IsPCRel)
Return the generic fixup kind for a value with the given size.
@ FK_GPRel_4
A four-byte gp relative fixup.
Represents a location in source code.
void emitGPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.
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 emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
virtual void switchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
static Optional< uint64_t > absoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo)
void emitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
void emitBundleAlignMode(unsigned AlignPow2) override
Set the bundle alignment mode from now on in the section.
Streaming object file generation interface.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
static void emit(MCStreamer *MCOS, MCDwarfLineTableParams Params)
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
void emitPendingAssignments(MCSymbol *Symbol)
Emits pending conditional assignments that depend on Symbol being emitted.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
void emitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize) override
If targets does not support representing debug line section by .loc/.file directives in assembly outp...
const MCSymbol & getSymbol() const
void emitDwarfLineEndEntry(MCSection *Section, MCSymbol *LastLabel) override
Emit the debug line end entry.
int64_t getConstant() const
void emitTPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a tprel (32-bit TP relative) value.
static void Emit(MCObjectStreamer &streamer, MCAsmBackend *MAB, bool isEH)
void emitNops(int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc, const MCSubtargetInfo &STI) override
const MCSymbolRefExpr * getSymA() const
@ FK_DTPRel_4
A four-byte dtp relative fixup.
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
MCFragment * getCurrentFragment() const
MCSection * getCurrentSectionOnly() const
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 emitInlineLineTableForFunction(MCObjectStreamer &OS, unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
static bool canReuseDataFragment(const MCDataFragment &F, const MCAssembler &Assembler, const MCSubtargetInfo *STI)
MCFragment * emitDefRange(MCObjectStreamer &OS, ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion)
void emitAddrsigSection()
Tell the object writer to emit an address-significance table during writeObject().
void addPendingLabel(MCSymbol *label)
Assign a label to the current Section and Subsection even though a fragment is not yet present.
MCSymbol * endSection(MCSection *Section)
MCCodeEmitter & getEmitter() const
void emitStringTable(MCObjectStreamer &OS)
Emits the string table substream.
const MCAsmInfo * getAsmInfo() const
@ FK_TPRel_8
A eight-byte tp relative fixup.
static void Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, int64_t LineDelta, uint64_t AddrDelta)
Utility function to emit the encoding to a streamer.
void emitCVFileChecksumsDirective() override
This implements the CodeView '.cv_filechecksums' assembler directive.
void PrintMessage(raw_ostream &OS, SMLoc Loc, DiagKind Kind, const Twine &Msg, ArrayRef< SMRange > Ranges={}, ArrayRef< SMFixIt > FixIts={}, bool ShowColors=true) const
Emit a message about the specified location with the specified string.
void emitFileChecksumOffset(MCObjectStreamer &OS, unsigned FileNo)
Emits the offset into the checksum table of the given file number.
void emitBundleUnlock() override
Ends a bundle-locked group.
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
virtual bool allowEnhancedRelaxation() const
Return true if this target allows an unrelaxable instruction to be emitted into RelaxableFragment and...
void emitSLEB128Value(const MCExpr *Value) override
void flushPendingLabels(MCFragment *F, uint64_t FOffset=0, unsigned Subsection=0)
Associate all pending labels in a subsection with a fragment.
static const MCBinaryExpr * create(Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
bool isVariable() const
isVariable - Check if this is a variable symbol.
void insert(MCFragment *F)
virtual Optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
constexpr uint64_t PointerSize
x86_64 pointer size.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
virtual void emitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
static const char *const BundlingNotImplementedMsg
void reportError(SMLoc L, const Twine &Msg)
Represent a reference to a symbol from inside an expression.
FragmentType getKind() const
virtual StringRef getVirtualSectionKind() const
unsigned getNumFrameInfos()
MCAssembler & getAssembler()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
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.
void setHasInstructions(bool Value)
unsigned getAlignment() const
bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection)
StringRef - Represent a constant reference to a string, i.e.
static void make(MCStreamer *MCOS, MCSection *Section)
virtual bool isVirtualSection() const =0
Check whether this section is "virtual", that is has no actual object file contents.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
virtual void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const
Relax the instruction in the given fragment to the next wider instruction.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
virtual void emitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &)
Emit an instruction to a special fragment, because this instruction can change its size during relaxa...
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
void emitAddrsigSym(const MCSymbol *Sym) override
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override
Emit Size bytes worth of the value specified by FillValue.
StringRef getName() const
void setAlignment(Align Value)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void addFileName(StringRef FileName)
bool hasInstructions() const
void emitSLEB128IntValue(int64_t Value)
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Lightweight error class with error context and mandatory checking.
virtual void emitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion)
This implements the CodeView '.cv_def_range' assembler directive.
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
void emitULEB128Value(const MCExpr *Value) override
void emitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion) override
This implements the CodeView '.cv_def_range' assembler directive.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
void emitAddrsig() override
bool checkCVLocSection(unsigned FuncId, unsigned FileNo, SMLoc Loc)
Returns true if the the .cv_loc directive is in the right section.
bool registerSection(MCSection &Section)
virtual void emitInstructionBegin(MCObjectStreamer &OS, const MCInst &Inst, const MCSubtargetInfo &STI)
Give the target a chance to manipulate state related to instruction alignment (e.g.
void emitCVStringTableDirective() override
This implements the CodeView '.cv_stringtable' assembler directive.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
void flushPendingLabels()
Create a data fragment for any pending labels across all Sections and Subsections.
void emitULEB128IntValue(uint64_t Value, unsigned PadTo=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
MCContext & getContext() const
const SourceMgr * getSourceManager() const
static void EmitAdvanceLoc(MCObjectStreamer &Streamer, uint64_t AddrDelta)
void emitGPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
virtual void emitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
This implements the DWARF2 '.loc fileno lineno ...' assembler directive.
A raw_ostream that writes to an SmallVector or SmallString.
void emitTPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a tprel (64-bit TP relative) value.
This represents an "assembler immediate".
bool mayHaveInstructions(MCSection &Sec) const override
MCDwarfLineTableParams getDWARFLinetableParams() const
void finishImpl() override
Streamer specific finalization.
void emitFrames(MCAsmBackend *MAB)
void emitCodeAlignment(unsigned ByteAlignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
Fragment for data and encoded instructions.
void emitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym) override
This implements the CodeView '.cv_inline_linetable' assembler directive.
bool isBundlingEnabled() const
MCSection * getDwarfLineSection() const
Generic base class for all target subtargets.
LLVM Value Representation.
static Optional< std::pair< bool, std::string > > getOffsetAndDataFragment(const MCSymbol &Symbol, uint32_t &RelocOffset, MCDataFragment *&DF)
Base class for the full range of assembler expressions which are needed for parsing.
virtual bool mayNeedRelaxation(const MCInst &Inst, const MCSubtargetInfo &STI) const
Check whether the given instruction may need relaxation.
void emitFileChecksums(MCObjectStreamer &OS)
Emits the file checksum substream.
virtual void reset()
State management.
void emitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel, const MCSymbol *Label)
const MCSymbolRefExpr * getSymB() const
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
MCAssembler * getAssemblerPtr() override
static void emit(MCObjectStreamer *MCOS)
MCObjectWriter & getWriter() const