mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-08 18:30:04 +00:00
[MC] Adding prettyPrintAsm to MCTargetStreamer to allow targets to specialize how instructions are printed to asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
edb6ecd65a
commit
4b61d2618c
@ -85,6 +85,9 @@ public:
|
|||||||
// Allow a target to add behavior to the emitAssignment of MCStreamer.
|
// Allow a target to add behavior to the emitAssignment of MCStreamer.
|
||||||
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value);
|
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value);
|
||||||
|
|
||||||
|
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS,
|
||||||
|
const MCInst &Inst, const MCSubtargetInfo &STI);
|
||||||
|
|
||||||
virtual void finish();
|
virtual void finish();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1308,7 +1308,10 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &S
|
|||||||
GetCommentOS() << "\n";
|
GetCommentOS() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
InstPrinter->printInst(&Inst, OS, "", STI);
|
if(getTargetStreamer())
|
||||||
|
getTargetStreamer()->prettyPrintAsm(*InstPrinter, OS, Inst, STI);
|
||||||
|
else
|
||||||
|
InstPrinter->printInst(&Inst, OS, "", STI);
|
||||||
|
|
||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "llvm/MC/MCContext.h"
|
#include "llvm/MC/MCContext.h"
|
||||||
#include "llvm/MC/MCExpr.h"
|
#include "llvm/MC/MCExpr.h"
|
||||||
#include "llvm/MC/MCInst.h"
|
#include "llvm/MC/MCInst.h"
|
||||||
|
#include "llvm/MC/MCInstPrinter.h"
|
||||||
#include "llvm/MC/MCObjectFileInfo.h"
|
#include "llvm/MC/MCObjectFileInfo.h"
|
||||||
#include "llvm/MC/MCObjectWriter.h"
|
#include "llvm/MC/MCObjectWriter.h"
|
||||||
#include "llvm/MC/MCSection.h"
|
#include "llvm/MC/MCSection.h"
|
||||||
@ -601,6 +602,11 @@ void MCStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
|
|||||||
TS->emitAssignment(Symbol, Value);
|
TS->emitAssignment(Symbol, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MCTargetStreamer::prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS,
|
||||||
|
const MCInst &Inst, const MCSubtargetInfo &STI) {
|
||||||
|
InstPrinter.printInst(&Inst, OS, "", STI);
|
||||||
|
}
|
||||||
|
|
||||||
void MCStreamer::visitUsedSymbol(const MCSymbol &Sym) {
|
void MCStreamer::visitUsedSymbol(const MCSymbol &Sym) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user