145220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner//===-- llvm/MC/MCParsedAsmOperand.h - Asm Parser Operand -------*- C++ -*-===//
245220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner//
345220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner//                     The LLVM Compiler Infrastructure
445220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner//
545220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner// This file is distributed under the University of Illinois Open Source
645220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner// License. See LICENSE.TXT for details.
745220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner//
845220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner//===----------------------------------------------------------------------===//
945220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner
1045220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner#ifndef LLVM_MC_MCASMOPERAND_H
1145220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner#define LLVM_MC_MCASMOPERAND_H
1245220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner
1345220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattnernamespace llvm {
143581d662e9c39b38c1cd8c243bbf7f03869f30deJeffrey Yasskinclass SMLoc;
15b3cb6967949493a2e1b10d015ac08b746736764eDaniel Dunbarclass raw_ostream;
1645220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner
1745220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner/// MCParsedAsmOperand - This abstract class represents a source-level assembly
1845220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner/// instruction operand.  It should be subclassed by target-specific code.  This
1945220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner/// base class is used by target-independent clients and is the interface
2045220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner/// between parsing an asm instruction and recognizing it.
2145220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattnerclass MCParsedAsmOperand {
2298311ecb4ae9c82baba9e3a48acf756a81c8e9a4Jim Grosbachpublic:
23f007e853e26845cd6866b52d646455fc69f4e0afChris Lattner  MCParsedAsmOperand() {}
24f007e853e26845cd6866b52d646455fc69f4e0afChris Lattner  virtual ~MCParsedAsmOperand() {}
2598311ecb4ae9c82baba9e3a48acf756a81c8e9a4Jim Grosbach
269d3c755fd6bf33335fad66dca9a629c630fc3bf2Chris Lattner  /// getStartLoc - Get the location of the first token of this operand.
27b3cb6967949493a2e1b10d015ac08b746736764eDaniel Dunbar  virtual SMLoc getStartLoc() const = 0;
289d3c755fd6bf33335fad66dca9a629c630fc3bf2Chris Lattner  /// getEndLoc - Get the location of the last token of this operand.
29b3cb6967949493a2e1b10d015ac08b746736764eDaniel Dunbar  virtual SMLoc getEndLoc() const = 0;
30b3cb6967949493a2e1b10d015ac08b746736764eDaniel Dunbar
31b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach  /// print - Print a debug representation of the operand to the given stream.
32b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach  virtual void print(raw_ostream &OS) const = 0;
33b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach  /// dump - Print to the debug stream.
34b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach  virtual void dump() const;
3545220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner};
3645220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner
37b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach//===----------------------------------------------------------------------===//
38b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach// Debugging Support
39b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach
40b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbachinline raw_ostream& operator<<(raw_ostream &OS, const MCParsedAsmOperand &MO) {
41b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach  MO.print(OS);
42b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach  return OS;
43b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach}
44b7f689bab98777236a2bf600f299d232d246bb61Jim Grosbach
4545220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner} // end namespace llvm.
4645220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner
4745220a84394758c86cc29ee0e3fe6738946fbcd0Chris Lattner#endif
48