};
class MCAsmInfoMicrosoft : public MCAsmInfoCOFF {
- virtual void anchor();
+ void anchor() override;
protected:
explicit MCAsmInfoMicrosoft();
};
class MCAsmInfoGNUCOFF : public MCAsmInfoCOFF {
- virtual void anchor();
+ void anchor() override;
protected:
explicit MCAsmInfoGNUCOFF();
};
/// @name MCStreamer Interface
/// @{
- virtual void InitSections();
- virtual void ChangeSection(const MCSection *Section,
- const MCExpr *Subsection);
- virtual void EmitLabel(MCSymbol *Symbol);
- virtual void EmitDebugLabel(MCSymbol *Symbol);
- virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
- virtual void EmitThumbFunc(MCSymbol *Func);
- virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
- virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
- virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
- virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
- virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol);
- virtual void EmitCOFFSymbolStorageClass(int StorageClass);
- virtual void EmitCOFFSymbolType(int Type);
- virtual void EndCOFFSymbolDef();
+ void InitSections() override;
+ void ChangeSection(const MCSection *Section,
+ const MCExpr *Subsection) override;
+ void EmitLabel(MCSymbol *Symbol) override;
+ void EmitDebugLabel(MCSymbol *Symbol) override;
+ void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
+ void EmitThumbFunc(MCSymbol *Func) override;
+ void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
+ bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
+ void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
+ void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
+ void BeginCOFFSymbolDef(const MCSymbol *Symbol) override;
+ void EmitCOFFSymbolStorageClass(int StorageClass) override;
+ void EmitCOFFSymbolType(int Type) override;
+ void EndCOFFSymbolDef() override;
- virtual MCSymbolData &getOrCreateSymbolData(MCSymbol *Symbol);
+ MCSymbolData &getOrCreateSymbolData(MCSymbol *Symbol) override;
- virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value);
+ void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
- virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
+ void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
- virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
- uint64_t Size = 0, unsigned ByteAlignment = 0);
- virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, unsigned ByteAlignment = 0);
- virtual void EmitValueImpl(const MCExpr *Value, unsigned Size);
+ void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
+ uint64_t Size = 0, unsigned ByteAlignment = 0) override;
+ void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment = 0) override;
+ void EmitValueImpl(const MCExpr *Value, unsigned Size) override;
- virtual void EmitFileDirective(StringRef Filename);
+ void EmitFileDirective(StringRef Filename) override;
- virtual void EmitIdent(StringRef IdentString);
+ void EmitIdent(StringRef IdentString) override;
- virtual void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned);
+ void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
- virtual void Flush();
+ void Flush() override;
- virtual void FinishImpl();
+ void FinishImpl() override;
- virtual void EmitBundleAlignMode(unsigned AlignPow2);
- virtual void EmitBundleLock(bool AlignToEnd);
- virtual void EmitBundleUnlock();
+ void EmitBundleAlignMode(unsigned AlignPow2) override;
+ void EmitBundleLock(bool AlignToEnd) override;
+ void EmitBundleUnlock() override;
private:
- virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &);
- virtual void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &);
+ void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &) override;
+ void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
void fixSymbolsInTLSFixups(const MCExpr *expr);
SymbolLookUp(symbolLookUp), DisInfo(disInfo) {}
bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &CommentStream,
- int64_t Value,
- uint64_t Address, bool IsBranch,
- uint64_t Offset, uint64_t InstSize);
+ int64_t Value, uint64_t Address, bool IsBranch,
+ uint64_t Offset, uint64_t InstSize) override;
void tryAddingPcLoadReferenceComment(raw_ostream &CommentStream,
- int64_t Value, uint64_t Address);
+ int64_t Value,
+ uint64_t Address) override;
};
}
/// @name Lifetime management Methods
/// @{
- virtual void reset();
+ void reset() override;
/// @}
void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFragment *Fragment, const MCFixup &Fixup,
- MCValue Target, uint64_t &FixedValue);
+ MCValue Target, uint64_t &FixedValue) override;
void BindIndirectSymbols(MCAssembler &Asm);
void markAbsoluteVariableSymbols(MCAssembler &Asm,
const MCAsmLayout &Layout);
- void ExecutePostLayoutBinding(MCAssembler &Asm, const MCAsmLayout &Layout);
+ void ExecutePostLayoutBinding(MCAssembler &Asm,
+ const MCAsmLayout &Layout) override;
- virtual bool IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
- const MCSymbolData &DataA,
- const MCFragment &FB,
- bool InSet,
- bool IsPCRel) const;
+ bool IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
+ const MCSymbolData &DataA,
+ const MCFragment &FB,
+ bool InSet,
+ bool IsPCRel) const override;
- void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
+ void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
};
MCSectionData::iterator CurInsertionPoint;
virtual void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo&) = 0;
- virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
- virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame);
+ void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) override;
+ void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) override;
protected:
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &_OS,
public:
/// state management
- virtual void reset();
+ void reset() override;
/// Object streamers require the integrated assembler.
- virtual bool isIntegratedAssemblerRequired() const { return true; }
+ bool isIntegratedAssemblerRequired() const override { return true; }
protected:
MCSectionData *getCurrentSectionData() const {
/// @name MCStreamer Interface
/// @{
- virtual void EmitLabel(MCSymbol *Symbol);
- virtual void EmitDebugLabel(MCSymbol *Symbol);
- virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
- virtual void EmitValueImpl(const MCExpr *Value, unsigned Size);
- virtual void EmitULEB128Value(const MCExpr *Value);
- virtual void EmitSLEB128Value(const MCExpr *Value);
- virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
- virtual void ChangeSection(const MCSection *Section,
- const MCExpr *Subsection);
- virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo& STI);
+ void EmitLabel(MCSymbol *Symbol) override;
+ void EmitDebugLabel(MCSymbol *Symbol) override;
+ void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
+ void EmitValueImpl(const MCExpr *Value, unsigned Size) override;
+ void EmitULEB128Value(const MCExpr *Value) override;
+ void EmitSLEB128Value(const MCExpr *Value) override;
+ void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
+ void ChangeSection(const MCSection *Section,
+ const MCExpr *Subsection) override;
+ void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo& STI) override;
/// \brief Emit an instruction to a special fragment, because this instruction
/// can change its size during relaxation.
virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &);
- virtual void EmitBundleAlignMode(unsigned AlignPow2);
- virtual void EmitBundleLock(bool AlignToEnd);
- virtual void EmitBundleUnlock();
- virtual void EmitBytes(StringRef Data);
- virtual void EmitValueToAlignment(unsigned ByteAlignment,
- int64_t Value = 0,
- unsigned ValueSize = 1,
- unsigned MaxBytesToEmit = 0);
- virtual void EmitCodeAlignment(unsigned ByteAlignment,
- unsigned MaxBytesToEmit = 0);
- virtual bool EmitValueToOffset(const MCExpr *Offset, unsigned char Value);
- virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
- unsigned Column, unsigned Flags,
- unsigned Isa, unsigned Discriminator,
- StringRef FileName);
- virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
- const MCSymbol *LastLabel,
- const MCSymbol *Label,
- unsigned PointerSize);
- virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
- const MCSymbol *Label);
- virtual void EmitGPRel32Value(const MCExpr *Value);
- virtual void EmitGPRel64Value(const MCExpr *Value);
- virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue);
- virtual void EmitZeros(uint64_t NumBytes);
- virtual void FinishImpl();
+ void EmitBundleAlignMode(unsigned AlignPow2) override;
+ void EmitBundleLock(bool AlignToEnd) override;
+ void EmitBundleUnlock() override;
+ void EmitBytes(StringRef Data) override;
+ void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
+ unsigned ValueSize = 1,
+ unsigned MaxBytesToEmit = 0) override;
+ void EmitCodeAlignment(unsigned ByteAlignment,
+ unsigned MaxBytesToEmit = 0) override;
+ bool EmitValueToOffset(const MCExpr *Offset, unsigned char Value) override;
+ void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
+ unsigned Column, unsigned Flags,
+ unsigned Isa, unsigned Discriminator,
+ StringRef FileName) override;
+ void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel,
+ const MCSymbol *Label,
+ unsigned PointerSize) override;
+ void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
+ const MCSymbol *Label) override;
+ void EmitGPRel32Value(const MCExpr *Value) override;
+ void EmitGPRel64Value(const MCExpr *Value) override;
+ void EmitFill(uint64_t NumBytes, uint8_t FillValue) override;
+ void EmitZeros(uint64_t NumBytes) override;
+ void FinishImpl() override;
};
} // end namespace llvm
bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &cStream,
int64_t Value, uint64_t Address,
bool IsBranch, uint64_t Offset,
- uint64_t InstSize);
+ uint64_t InstSize) override;
void tryAddingPcLoadReferenceComment(raw_ostream &cStream,
- int64_t Value, uint64_t Address);
+ int64_t Value,
+ uint64_t Address) override;
/// @}
/// \brief Look for an external function symbol at \p Addr.
const MCAsmLayout &Layout,
const SectionIndexMapTy &SectionIndexMap);
- virtual void RecordRelocation(const MCAssembler &Asm,
- const MCAsmLayout &Layout,
- const MCFragment *Fragment,
- const MCFixup &Fixup,
- MCValue Target, uint64_t &FixedValue);
+ void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ const MCFragment *Fragment, const MCFixup &Fixup,
+ MCValue Target, uint64_t &FixedValue) override;
uint64_t getSymbolIndexInSymbolTable(const MCAssembler &Asm,
const MCSymbol *S);
SectionIndexMapTy &SectionIndexMap,
const RelMapTy &RelMap);
- virtual void ExecutePostLayoutBinding(MCAssembler &Asm,
- const MCAsmLayout &Layout);
+ void ExecutePostLayoutBinding(MCAssembler &Asm,
+ const MCAsmLayout &Layout) override;
void WriteSectionHeader(MCAssembler &Asm, const GroupMapTy &GroupMap,
const MCAsmLayout &Layout,
MCDataFragment *F,
const MCSectionData *SD);
- virtual bool
+ bool
IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
const MCSymbolData &DataA,
const MCFragment &FB,
bool InSet,
- bool IsPCRel) const;
+ bool IsPCRel) const override;
- virtual void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
+ void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
void WriteSection(MCAssembler &Asm,
const SectionIndexMapTy &SectionIndexMap,
uint32_t GroupSymbolIndex,
bool needsSet(const MCExpr *Value);
void EmitRegisterName(int64_t Register);
- virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
- virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame);
+ void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) override;
+ void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) override;
public:
MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os,
/// isVerboseAsm - Return true if this streamer supports verbose assembly at
/// all.
- virtual bool isVerboseAsm() const { return IsVerboseAsm; }
+ bool isVerboseAsm() const override { return IsVerboseAsm; }
/// hasRawTextSupport - We support EmitRawText.
- virtual bool hasRawTextSupport() const { return true; }
+ bool hasRawTextSupport() const override { return true; }
/// AddComment - Add a comment that can be emitted to the generated .s
/// file if applicable as a QoI issue to make the output of the compiler
/// more readable. This only affects the MCAsmStreamer, and only when
/// verbose assembly output is enabled.
- virtual void AddComment(const Twine &T);
+ void AddComment(const Twine &T) override;
/// AddEncodingComment - Add a comment showing the encoding of an instruction.
virtual void AddEncodingComment(const MCInst &Inst, const MCSubtargetInfo &);
/// GetCommentOS - Return a raw_ostream that comments can be written to.
/// Unlike AddComment, you are required to terminate comments with \n if you
/// use this method.
- virtual raw_ostream &GetCommentOS() {
+ raw_ostream &GetCommentOS() override {
if (!IsVerboseAsm)
return nulls(); // Discard comments unless in verbose asm mode.
return CommentStream;
void emitRawComment(const Twine &T, bool TabPrefix = true) override;
/// AddBlankLine - Emit a blank line to a .s file to pretty it up.
- virtual void AddBlankLine() {
+ void AddBlankLine() override {
EmitEOL();
}
/// @name MCStreamer Interface
/// @{
- virtual void ChangeSection(const MCSection *Section,
- const MCExpr *Subsection);
-
- virtual void EmitLabel(MCSymbol *Symbol);
- virtual void EmitDebugLabel(MCSymbol *Symbol);
-
- virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
- MCSymbol *EHSymbol);
- virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
- virtual void EmitLinkerOptions(ArrayRef<std::string> Options);
- virtual void EmitDataRegion(MCDataRegionType Kind);
- virtual void EmitThumbFunc(MCSymbol *Func);
-
- virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
- virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
- virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
- const MCSymbol *LastLabel,
- const MCSymbol *Label,
- unsigned PointerSize);
- virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
- const MCSymbol *Label);
-
- virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
-
- virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
- virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol);
- virtual void EmitCOFFSymbolStorageClass(int StorageClass);
- virtual void EmitCOFFSymbolType(int Type);
- virtual void EndCOFFSymbolDef();
- virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol);
- virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
- virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value);
- virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
+ void ChangeSection(const MCSection *Section,
+ const MCExpr *Subsection) override;
+
+ void EmitLabel(MCSymbol *Symbol) override;
+ void EmitDebugLabel(MCSymbol *Symbol) override;
+
+ void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
+ void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
+ void EmitLinkerOptions(ArrayRef<std::string> Options) override;
+ void EmitDataRegion(MCDataRegionType Kind) override;
+ void EmitThumbFunc(MCSymbol *Func) override;
+
+ void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
+ void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
+ void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel,
+ const MCSymbol *Label,
+ unsigned PointerSize) override;
+ void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
+ const MCSymbol *Label) override;
+
+ bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
+
+ void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
+ void BeginCOFFSymbolDef(const MCSymbol *Symbol) override;
+ void EmitCOFFSymbolStorageClass(int StorageClass) override;
+ void EmitCOFFSymbolType(int Type) override;
+ void EndCOFFSymbolDef() override;
+ void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
+ void EmitCOFFSecRel32(MCSymbol const *Symbol) override;
+ void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
+ void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
/// EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
///
/// @param Symbol - The common symbol to emit.
/// @param Size - The size of the common symbol.
/// @param ByteAlignment - The alignment of the common symbol in bytes.
- virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
-
- virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
- uint64_t Size = 0, unsigned ByteAlignment = 0);
-
- virtual void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, unsigned ByteAlignment = 0);
-
- virtual void EmitBytes(StringRef Data);
-
- virtual void EmitValueImpl(const MCExpr *Value, unsigned Size);
- virtual void EmitIntValue(uint64_t Value, unsigned Size);
-
- virtual void EmitULEB128Value(const MCExpr *Value);
-
- virtual void EmitSLEB128Value(const MCExpr *Value);
-
- virtual void EmitGPRel64Value(const MCExpr *Value);
-
- virtual void EmitGPRel32Value(const MCExpr *Value);
-
-
- virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue);
-
- virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
- unsigned ValueSize = 1,
- unsigned MaxBytesToEmit = 0);
-
- virtual void EmitCodeAlignment(unsigned ByteAlignment,
- unsigned MaxBytesToEmit = 0);
-
- virtual bool EmitValueToOffset(const MCExpr *Offset,
- unsigned char Value = 0);
-
- virtual void EmitFileDirective(StringRef Filename);
- virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
- StringRef Filename, unsigned CUID = 0);
- virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
- unsigned Column, unsigned Flags,
- unsigned Isa, unsigned Discriminator,
- StringRef FileName);
-
- virtual void EmitIdent(StringRef IdentString);
- virtual void EmitCFISections(bool EH, bool Debug);
- virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
- virtual void EmitCFIDefCfaOffset(int64_t Offset);
- virtual void EmitCFIDefCfaRegister(int64_t Register);
- virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
- virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
- virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
- virtual void EmitCFIRememberState();
- virtual void EmitCFIRestoreState();
- virtual void EmitCFISameValue(int64_t Register);
- virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
- virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
- virtual void EmitCFISignalFrame();
- virtual void EmitCFIUndefined(int64_t Register);
- virtual void EmitCFIRegister(int64_t Register1, int64_t Register2);
- virtual void EmitCFIWindowSave();
-
- virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
- virtual void EmitWin64EHEndProc();
- virtual void EmitWin64EHStartChained();
- virtual void EmitWin64EHEndChained();
- virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
- bool Except);
- virtual void EmitWin64EHHandlerData();
- virtual void EmitWin64EHPushReg(unsigned Register);
- virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
- virtual void EmitWin64EHAllocStack(unsigned Size);
- virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
- virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
- virtual void EmitWin64EHPushFrame(bool Code);
- virtual void EmitWin64EHEndProlog();
-
- virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI);
-
- virtual void EmitBundleAlignMode(unsigned AlignPow2);
- virtual void EmitBundleLock(bool AlignToEnd);
- virtual void EmitBundleUnlock();
+ void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
+
+ void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
+ uint64_t Size = 0, unsigned ByteAlignment = 0) override;
+
+ void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment = 0) override;
+
+ void EmitBytes(StringRef Data) override;
+
+ void EmitValueImpl(const MCExpr *Value, unsigned Size) override;
+ void EmitIntValue(uint64_t Value, unsigned Size) override;
+
+ void EmitULEB128Value(const MCExpr *Value) override;
+
+ void EmitSLEB128Value(const MCExpr *Value) override;
+
+ void EmitGPRel64Value(const MCExpr *Value) override;
+
+ void EmitGPRel32Value(const MCExpr *Value) override;
+
+
+ void EmitFill(uint64_t NumBytes, uint8_t FillValue) override;
+
+ void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
+ unsigned ValueSize = 1,
+ unsigned MaxBytesToEmit = 0) override;
+
+ void EmitCodeAlignment(unsigned ByteAlignment,
+ unsigned MaxBytesToEmit = 0) override;
+
+ bool EmitValueToOffset(const MCExpr *Offset,
+ unsigned char Value = 0) override;
+
+ void EmitFileDirective(StringRef Filename) override;
+ bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
+ StringRef Filename, unsigned CUID = 0) override;
+ void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
+ unsigned Column, unsigned Flags,
+ unsigned Isa, unsigned Discriminator,
+ StringRef FileName) override;
+
+ void EmitIdent(StringRef IdentString) override;
+ void EmitCFISections(bool EH, bool Debug) override;
+ void EmitCFIDefCfa(int64_t Register, int64_t Offset) override;
+ void EmitCFIDefCfaOffset(int64_t Offset) override;
+ void EmitCFIDefCfaRegister(int64_t Register) override;
+ void EmitCFIOffset(int64_t Register, int64_t Offset) override;
+ void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding) override;
+ void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding) override;
+ void EmitCFIRememberState() override;
+ void EmitCFIRestoreState() override;
+ void EmitCFISameValue(int64_t Register) override;
+ void EmitCFIRelOffset(int64_t Register, int64_t Offset) override;
+ void EmitCFIAdjustCfaOffset(int64_t Adjustment) override;
+ void EmitCFISignalFrame() override;
+ void EmitCFIUndefined(int64_t Register) override;
+ void EmitCFIRegister(int64_t Register1, int64_t Register2) override;
+ void EmitCFIWindowSave() override;
+
+ void EmitWin64EHStartProc(const MCSymbol *Symbol) override;
+ void EmitWin64EHEndProc() override;
+ void EmitWin64EHStartChained() override;
+ void EmitWin64EHEndChained() override;
+ void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
+ bool Except) override;
+ void EmitWin64EHHandlerData() override;
+ void EmitWin64EHPushReg(unsigned Register) override;
+ void EmitWin64EHSetFrame(unsigned Register, unsigned Offset) override;
+ void EmitWin64EHAllocStack(unsigned Size) override;
+ void EmitWin64EHSaveReg(unsigned Register, unsigned Offset) override;
+ void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset) override;
+ void EmitWin64EHPushFrame(bool Code) override;
+ void EmitWin64EHEndProlog() override;
+
+ void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
+
+ void EmitBundleAlignMode(unsigned AlignPow2) override;
+ void EmitBundleLock(bool AlignToEnd) override;
+ void EmitBundleUnlock() override;
/// EmitRawText - If this file is backed by an assembly streamer, this dumps
/// the specified string in the output .s file. This capability is
/// indicated by the hasRawTextSupport() predicate.
- virtual void EmitRawTextImpl(StringRef String);
+ void EmitRawTextImpl(StringRef String) override;
- virtual void FinishImpl();
+ void FinishImpl() override;
};
} // end anonymous namespace.
class MCMachOStreamer : public MCObjectStreamer {
private:
- virtual void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI);
+ void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override;
void EmitDataRegion(DataRegionData::KindTy Kind);
void EmitDataRegionEnd();
/// @name MCStreamer Interface
/// @{
- virtual void EmitLabel(MCSymbol *Symbol);
- virtual void EmitDebugLabel(MCSymbol *Symbol);
- virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
- MCSymbol *EHSymbol);
- virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
- virtual void EmitLinkerOptions(ArrayRef<std::string> Options);
- virtual void EmitDataRegion(MCDataRegionType Kind);
- virtual void EmitThumbFunc(MCSymbol *Func);
- virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
- virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
- virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
- virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {
+ void EmitLabel(MCSymbol *Symbol) override;
+ void EmitDebugLabel(MCSymbol *Symbol) override;
+ void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
+ void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
+ void EmitLinkerOptions(ArrayRef<std::string> Options) override;
+ void EmitDataRegion(MCDataRegionType Kind) override;
+ void EmitThumbFunc(MCSymbol *Func) override;
+ bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
+ void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
+ void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
+ void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {
llvm_unreachable("macho doesn't support this directive");
}
- virtual void EmitCOFFSymbolStorageClass(int StorageClass) {
+ void EmitCOFFSymbolStorageClass(int StorageClass) override {
llvm_unreachable("macho doesn't support this directive");
}
- virtual void EmitCOFFSymbolType(int Type) {
+ void EmitCOFFSymbolType(int Type) override {
llvm_unreachable("macho doesn't support this directive");
}
- virtual void EndCOFFSymbolDef() {
+ void EndCOFFSymbolDef() override {
llvm_unreachable("macho doesn't support this directive");
}
- virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {
+ void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override {
llvm_unreachable("macho doesn't support this directive");
}
- virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
- virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
- uint64_t Size = 0, unsigned ByteAlignment = 0);
+ void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
+ void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
+ uint64_t Size = 0, unsigned ByteAlignment = 0) override;
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, unsigned ByteAlignment = 0);
+ uint64_t Size, unsigned ByteAlignment = 0) override;
- virtual void EmitFileDirective(StringRef Filename) {
+ void EmitFileDirective(StringRef Filename) override {
// FIXME: Just ignore the .file; it isn't important enough to fail the
// entire assembly.
// report_fatal_error("unsupported directive: '.file'");
}
- virtual void EmitIdent(StringRef IdentString) {
+ void EmitIdent(StringRef IdentString) override {
llvm_unreachable("macho doesn't support this directive");
}
- virtual void FinishImpl();
+ void FinishImpl() override;
};
} // end anonymous namespace.
/// @name MCStreamer Interface
/// @{
- virtual void ChangeSection(const MCSection *Section,
- const MCExpr *Subsection) {
+ void ChangeSection(const MCSection *Section,
+ const MCExpr *Subsection) override {
}
- virtual void EmitLabel(MCSymbol *Symbol) {
+ void EmitLabel(MCSymbol *Symbol) override {
assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
assert(getCurrentSection().first &&"Cannot emit before setting section!");
AssignSection(Symbol, getCurrentSection().first);
}
- virtual void EmitDebugLabel(MCSymbol *Symbol) {
+ void EmitDebugLabel(MCSymbol *Symbol) override {
EmitLabel(Symbol);
}
- virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
- virtual void EmitThumbFunc(MCSymbol *Func) {}
-
- virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
- virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol){}
- virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
- const MCSymbol *LastLabel,
- const MCSymbol *Label,
- unsigned PointerSize) {}
-
- virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){
+ void EmitAssemblerFlag(MCAssemblerFlag Flag) override {}
+ void EmitThumbFunc(MCSymbol *Func) override {}
+
+ void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override {}
+ void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override {}
+ void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
+ const MCSymbol *LastLabel,
+ const MCSymbol *Label,
+ unsigned PointerSize) override {}
+
+ bool EmitSymbolAttribute(MCSymbol *Symbol,
+ MCSymbolAttr Attribute) override {
return true;
}
- virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
-
- virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {}
- virtual void EmitCOFFSymbolStorageClass(int StorageClass) {}
- virtual void EmitCOFFSymbolType(int Type) {}
- virtual void EndCOFFSymbolDef() {}
- virtual void EmitCOFFSecRel32(MCSymbol const *Symbol) {}
-
- virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
- virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {}
- virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {}
- virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
- uint64_t Size = 0, unsigned ByteAlignment = 0) {}
- virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, unsigned ByteAlignment) {}
- virtual void EmitBytes(StringRef Data) {}
-
- virtual void EmitValueImpl(const MCExpr *Value, unsigned Size) {}
- virtual void EmitULEB128Value(const MCExpr *Value) {}
- virtual void EmitSLEB128Value(const MCExpr *Value) {}
- virtual void EmitGPRel32Value(const MCExpr *Value) {}
- virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
- unsigned ValueSize = 1,
- unsigned MaxBytesToEmit = 0) {}
-
- virtual void EmitCodeAlignment(unsigned ByteAlignment,
- unsigned MaxBytesToEmit = 0) {}
-
- virtual bool EmitValueToOffset(const MCExpr *Offset,
- unsigned char Value = 0) { return false; }
-
- virtual void EmitFileDirective(StringRef Filename) {}
- virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
- StringRef Filename, unsigned CUID = 0) {
+ void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override {}
+
+ void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
+ void EmitCOFFSymbolStorageClass(int StorageClass) override {}
+ void EmitCOFFSymbolType(int Type) override {}
+ void EndCOFFSymbolDef() override {}
+ void EmitCOFFSecRel32(MCSymbol const *Symbol) override {}
+
+ void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override {}
+ void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override {}
+ void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override {}
+ void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
+ uint64_t Size = 0, unsigned ByteAlignment = 0) override {}
+ void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment) override {}
+ void EmitBytes(StringRef Data) override {}
+
+ void EmitValueImpl(const MCExpr *Value, unsigned Size) override {}
+ void EmitULEB128Value(const MCExpr *Value) override {}
+ void EmitSLEB128Value(const MCExpr *Value) override {}
+ void EmitGPRel32Value(const MCExpr *Value) override {}
+ void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
+ unsigned ValueSize = 1,
+ unsigned MaxBytesToEmit = 0) override {}
+
+ void EmitCodeAlignment(unsigned ByteAlignment,
+ unsigned MaxBytesToEmit = 0) override {}
+
+ bool EmitValueToOffset(const MCExpr *Offset,
+ unsigned char Value = 0) override { return false; }
+
+ void EmitFileDirective(StringRef Filename) override {}
+ bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
+ StringRef Filename,
+ unsigned CUID = 0) override {
return false;
}
- virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
- unsigned Column, unsigned Flags,
- unsigned Isa, unsigned Discriminator,
- StringRef FileName) {}
- virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo&) {}
+ void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
+ unsigned Column, unsigned Flags,
+ unsigned Isa, unsigned Discriminator,
+ StringRef FileName) override {}
+ void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo&) override {}
- virtual void EmitBundleAlignMode(unsigned AlignPow2) {}
- virtual void EmitBundleLock(bool AlignToEnd) {}
- virtual void EmitBundleUnlock() {}
+ void EmitBundleAlignMode(unsigned AlignPow2) override {}
+ void EmitBundleLock(bool AlignToEnd) override {}
+ void EmitBundleUnlock() override {}
- virtual void FinishImpl() {}
+ void FinishImpl() override {}
- virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
+ void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) override {
RecordProcEnd(Frame);
}
};
// MCObjectWriter interface implementation.
- void ExecutePostLayoutBinding(MCAssembler &Asm, const MCAsmLayout &Layout);
+ void ExecutePostLayoutBinding(MCAssembler &Asm,
+ const MCAsmLayout &Layout) override;
- void RecordRelocation(const MCAssembler &Asm,
- const MCAsmLayout &Layout,
- const MCFragment *Fragment,
- const MCFixup &Fixup,
- MCValue Target,
- uint64_t &FixedValue);
+ void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
+ const MCFragment *Fragment, const MCFixup &Fixup,
+ MCValue Target, uint64_t &FixedValue) override;
- void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
+ void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
};
}
// MCStreamer interface
- virtual void InitSections();
- virtual void EmitLabel(MCSymbol *Symbol);
- virtual void EmitDebugLabel(MCSymbol *Symbol);
- virtual void EmitAssemblerFlag(MCAssemblerFlag Flag);
- virtual void EmitThumbFunc(MCSymbol *Func);
- virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
- virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue);
- virtual void BeginCOFFSymbolDef(MCSymbol const *Symbol);
- virtual void EmitCOFFSymbolStorageClass(int StorageClass);
- virtual void EmitCOFFSymbolType(int Type);
- virtual void EndCOFFSymbolDef();
- virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol);
- virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
- virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value);
- virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
- virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment);
- virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
- uint64_t Size,unsigned ByteAlignment);
- virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, unsigned ByteAlignment);
- virtual void EmitFileDirective(StringRef Filename);
- virtual void EmitIdent(StringRef IdentString);
- virtual void EmitWin64EHHandlerData();
- virtual void FinishImpl();
+ void InitSections() override;
+ void EmitLabel(MCSymbol *Symbol) override;
+ void EmitDebugLabel(MCSymbol *Symbol) override;
+ void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
+ void EmitThumbFunc(MCSymbol *Func) override;
+ bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
+ void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
+ void BeginCOFFSymbolDef(MCSymbol const *Symbol) override;
+ void EmitCOFFSymbolStorageClass(int StorageClass) override;
+ void EmitCOFFSymbolType(int Type) override;
+ void EndCOFFSymbolDef() override;
+ void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
+ void EmitCOFFSecRel32(MCSymbol const *Symbol) override;
+ void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
+ void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
+ void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+ unsigned ByteAlignment) override;
+ void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size,unsigned ByteAlignment) override;
+ void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
+ uint64_t Size, unsigned ByteAlignment) override;
+ void EmitFileDirective(StringRef Filename) override;
+ void EmitIdent(StringRef IdentString) override;
+ void EmitWin64EHHandlerData() override;
+ void FinishImpl() override;
private:
- virtual void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) {
+ void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override {
MCDataFragment *DF = getOrCreateDataFragment();
SmallVector<MCFixup, 4> Fixups;