From ede042dc8d59ff48a48ef8e2271f2a7ee8324ba5 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 15 Sep 2011 18:36:29 +0000 Subject: Add support for stored annotations to MCInst, and provide facilities for MC-based InstPrinters to print them out. Enhance the ARM and X86 InstPrinter's to do so in verbose mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139820 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCInstPrinter.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/llvm/MC/MCInstPrinter.h') diff --git a/include/llvm/MC/MCInstPrinter.h b/include/llvm/MC/MCInstPrinter.h index 39002da..4c12d10 100644 --- a/include/llvm/MC/MCInstPrinter.h +++ b/include/llvm/MC/MCInstPrinter.h @@ -41,6 +41,10 @@ public: /// virtual void printInst(const MCInst *MI, raw_ostream &OS) = 0; + /// printAnnotations - Print the annotation comments attached to specified + /// MCInst to the specified raw_ostream. + void printAnnotations(const MCInst *MI, raw_ostream &OS); + /// getOpcodeName - Return the name of the specified opcode enum (e.g. /// "MOV32ri") or empty if we can't resolve it. virtual StringRef getOpcodeName(unsigned Opcode) const; -- cgit v1.1 From 98c5ddabca1debf935a07d14d0cbc9732374bdb8 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 15 Sep 2011 23:38:46 +0000 Subject: Don't attach annotations to MCInst's. Instead, have the disassembler return, and the printer accept, an annotation string which can be passed through if the client cares about annotations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139876 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCInstPrinter.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/llvm/MC/MCInstPrinter.h') diff --git a/include/llvm/MC/MCInstPrinter.h b/include/llvm/MC/MCInstPrinter.h index 4c12d10..01ad2d3 100644 --- a/include/llvm/MC/MCInstPrinter.h +++ b/include/llvm/MC/MCInstPrinter.h @@ -28,6 +28,9 @@ protected: /// The current set of available features. unsigned AvailableFeatures; + + /// Utility function for printing annotations. + void printAnnotation(raw_ostream &OS, StringRef Annot); public: MCInstPrinter(const MCAsmInfo &mai) : CommentStream(0), MAI(mai), AvailableFeatures(0) {} @@ -39,11 +42,8 @@ public: /// printInst - Print the specified MCInst to the specified raw_ostream. /// - virtual void printInst(const MCInst *MI, raw_ostream &OS) = 0; - - /// printAnnotations - Print the annotation comments attached to specified - /// MCInst to the specified raw_ostream. - void printAnnotations(const MCInst *MI, raw_ostream &OS); + virtual void printInst(const MCInst *MI, raw_ostream &OS, + StringRef Annot) = 0; /// getOpcodeName - Return the name of the specified opcode enum (e.g. /// "MOV32ri") or empty if we can't resolve it. -- cgit v1.1