Revert 165057, per Jim's request. This requires further discussion.
[oota-llvm.git] / include / llvm / MC / MCParser / MCParsedAsmOperand.h
index 99fa5adae977fa3346fa01e64bf0aa88caa85864..0ce32d617effae79ed46b4f672d8e3c9333d6a29 100644 (file)
@@ -19,19 +19,40 @@ class raw_ostream;
 /// base class is used by target-independent clients and is the interface
 /// between parsing an asm instruction and recognizing it.
 class MCParsedAsmOperand {
-public:  
+public:
   MCParsedAsmOperand() {}
   virtual ~MCParsedAsmOperand() {}
-  
+
+  /// isToken - Is this a token operand?
+  virtual bool isToken() const = 0;
+  /// isImm - Is this an immediate operand?
+  virtual bool isImm() const = 0;
+  /// isReg - Is this a register operand?
+  virtual bool isReg() const = 0;
+  virtual unsigned getReg() const = 0;
+
+  /// isMem - Is this a memory operand?
+  virtual bool isMem() const = 0;
+
   /// getStartLoc - Get the location of the first token of this operand.
   virtual SMLoc getStartLoc() const = 0;
   /// getEndLoc - Get the location of the last token of this operand.
   virtual SMLoc getEndLoc() const = 0;
 
-  /// dump - Print a debug representation of the operand to the given stream.
-  virtual void dump(raw_ostream &OS) const = 0;
+  /// print - Print a debug representation of the operand to the given stream.
+  virtual void print(raw_ostream &OS) const = 0;
+  /// dump - Print to the debug stream.
+  virtual void dump() const;
 };
 
+//===----------------------------------------------------------------------===//
+// Debugging Support
+
+inline raw_ostream& operator<<(raw_ostream &OS, const MCParsedAsmOperand &MO) {
+  MO.print(OS);
+  return OS;
+}
+
 } // end namespace llvm.
 
 #endif