projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rather then have a wrapper function, have tblgen instantiate the implementation.
[oota-llvm.git]
/
include
/
llvm
/
MC
/
MCInstPrinter.h
diff --git
a/include/llvm/MC/MCInstPrinter.h
b/include/llvm/MC/MCInstPrinter.h
index d2ddc5bb42b2460933e7ec42bfdd2f54fa435e71..3c4f28be7ca6477011bb5732c0aedb7b49431961 100644
(file)
--- a/
include/llvm/MC/MCInstPrinter.h
+++ b/
include/llvm/MC/MCInstPrinter.h
@@
-14,38
+14,53
@@
namespace llvm {
class MCInst;
class raw_ostream;
class MCAsmInfo;
class MCInst;
class raw_ostream;
class MCAsmInfo;
+class MCInstrInfo;
+class MCRegisterInfo;
class StringRef;
/// MCInstPrinter - This is an instance of a target assembly language printer
/// that converts an MCInst to valid target assembly syntax.
class MCInstPrinter {
protected:
class StringRef;
/// MCInstPrinter - This is an instance of a target assembly language printer
/// 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;
/// 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;
+ const MCInstrInfo &MII;
+ const MCRegisterInfo &MRI;
+
+ /// The current set of available features.
+ unsigned AvailableFeatures;
+
+ /// Utility function for printing annotations.
+ void printAnnotation(raw_ostream &OS, StringRef Annot);
public:
public:
- MCInstPrinter(raw_ostream &o, const MCAsmInfo &mai)
- : O(o), CommentStream(0), MAI(mai) {}
-
+ MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii,
+ const MCRegisterInfo &mri)
+ : CommentStream(0), MAI(mai), MII(mii), MRI(mri), AvailableFeatures(0) {}
+
virtual ~MCInstPrinter();
/// setCommentStream - Specify a stream to emit comments to.
void setCommentStream(raw_ostream &OS) { CommentStream = &OS; }
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,
+ StringRef Annot) = 0;
+
/// getOpcodeName - Return the name of the specified opcode enum (e.g.
/// "MOV32ri") or empty if we can't resolve it.
/// 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;
+ 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
} // namespace llvm
#endif