aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 1aa8b40e7e..11a769c930 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/iterator"
#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/Streams.h"
#include <vector>
#include <cassert>
#include <iosfwd>
@@ -284,6 +285,10 @@ public:
IsDead = false;
}
+ friend llvm_ostream& operator<<(llvm_ostream& os, const MachineOperand& mop) {
+ if (os.stream()) *os.stream() << mop;
+ return os;
+ }
friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop);
friend class MachineInstr;
@@ -400,8 +405,15 @@ public:
//
// Debugging support
//
+ void print(llvm_ostream &OS, const TargetMachine *TM) const {
+ if (OS.stream()) print(*OS.stream(), TM);
+ }
void print(std::ostream &OS, const TargetMachine *TM) const;
void dump() const;
+ friend llvm_ostream& operator<<(llvm_ostream& os, const MachineInstr& minstr){
+ if (os.stream()) *os.stream() << minstr;
+ return os;
+ }
friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr);
//===--------------------------------------------------------------------===//