[llvm-commits] [llvm] r78985 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
Daniel Dunbar
daniel at zuster.org
Thu Aug 13 20:43:58 PDT 2009
Author: ddunbar
Date: Thu Aug 13 22:43:57 2009
New Revision: 78985
URL: http://llvm.org/viewvc/llvm-project?rev=78985&view=rev
Log:
Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=78985&r1=78984&r2=78985&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu Aug 13 22:43:57 2009
@@ -345,6 +345,12 @@
/// EmitComments - Pretty-print comments for basic blocks
void EmitComments(const MachineBasicBlock &MBB) const;
+ /// printMCInst - Print an MCInst for this target.
+ ///
+ /// Note, this is only a temporary hack to allow the MCStreamer to print
+ /// instructions, do not use this function outside of llvm-mc.
+ virtual void printMCInst(const MCInst *MI);
+
protected:
/// EmitZeros - Emit a block of zeros.
///
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=78985&r1=78984&r2=78985&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Aug 13 22:43:57 2009
@@ -1738,6 +1738,10 @@
O << Offset;
}
+void AsmPrinter::printMCInst(const MCInst *MI) {
+ llvm_unreachable("MCInst printing unavailable on this target!");
+}
+
GCMetadataPrinter *AsmPrinter::GetOrCreateGCPrinter(GCStrategy *S) {
if (!S->usesMetadata())
return 0;
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h?rev=78985&r1=78984&r2=78985&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Thu Aug 13 22:43:57 2009
@@ -67,6 +67,8 @@
// New MCInst printing stuff.
void printInstruction(const MCInst *MI);
+ virtual void printMCInst(const MCInst *MI) { printInstruction(MI); }
+
void printSymbolOperand(const MachineOperand &MO);
void printOperand(const MCInst *MI, unsigned OpNo,
const char *Modifier = 0);
More information about the llvm-commits
mailing list