- Added MCSubtargetInfo to capture subtarget features and scheduling
[oota-llvm.git] / include / llvm / MC / MCInstPrinter.h
index d2ddc5bb42b2460933e7ec42bfdd2f54fa435e71..39002dabca14cf43d589452c461b3478f2d1ccb0 100644 (file)
@@ -20,32 +20,38 @@ class StringRef;
 /// that converts an MCInst to valid target assembly syntax.
 class MCInstPrinter {
 protected:
-  /// O - The main stream to emit instruction text to.
-  raw_ostream &O;
-  
   /// CommentStream - a stream that comments can be emitted to if desired.
   /// Each comment must end with a newline.  This will be null if verbose
   /// assembly emission is disable.
   raw_ostream *CommentStream;
   const MCAsmInfo &MAI;
+
+  /// The current set of available features.
+  unsigned AvailableFeatures;
 public:
-  MCInstPrinter(raw_ostream &o, const MCAsmInfo &mai)
-    : O(o), CommentStream(0), MAI(mai) {}
-  
+  MCInstPrinter(const MCAsmInfo &mai)
+    : CommentStream(0), MAI(mai), AvailableFeatures(0) {}
+
   virtual ~MCInstPrinter();
 
   /// setCommentStream - Specify a stream to emit comments to.
   void setCommentStream(raw_ostream &OS) { CommentStream = &OS; }
-  
-  /// printInst - Print the specified MCInst to the current raw_ostream.
+
+  /// printInst - Print the specified MCInst to the specified raw_ostream.
   ///
-  virtual void printInst(const MCInst *MI) = 0;
-  
+  virtual void printInst(const MCInst *MI, raw_ostream &OS) = 0;
+
   /// 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;
+
+  /// printRegName - Print the assembler register name.
+  virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
+
+  unsigned getAvailableFeatures() const { return AvailableFeatures; }
+  void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }
 };
-  
+
 } // namespace llvm
 
 #endif