[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h MachineBasicBlock.h MachineInstr.h

Jeff Cohen jeffc at jolt-lang.org
Fri Dec 15 18:16:01 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

LiveInterval.h updated: 1.32 -> 1.33
MachineBasicBlock.h updated: 1.52 -> 1.53
MachineInstr.h updated: 1.207 -> 1.208
---
Log message:

The best unbreakage yet, addressing Bill's concerns.

---
Diffs of the changes:  (+30 -6)

 LiveInterval.h      |    7 ++++++-
 MachineBasicBlock.h |    5 ++++-
 MachineInstr.h      |   24 ++++++++++++++++++++----
 3 files changed, 30 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/CodeGen/LiveInterval.h
diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.32 llvm/include/llvm/CodeGen/LiveInterval.h:1.33
--- llvm/include/llvm/CodeGen/LiveInterval.h:1.32	Fri Dec 15 16:57:14 2006
+++ llvm/include/llvm/CodeGen/LiveInterval.h	Fri Dec 15 20:15:42 2006
@@ -56,13 +56,18 @@
     }
 
     void dump() const;
+    void print(std::ostream &os) const;
 
   private:
     LiveRange(); // DO NOT IMPLEMENT
   };
 
   std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
-  OStream& operator<<(OStream& os, const LiveRange &LR);
+  inline OStream& operator<<(OStream& os, const LiveRange &LR) {
+    if (os.stream()) LR.print(*os.stream());
+    return os;
+  }
+
 
   inline bool operator<(unsigned V, const LiveRange &LR) {
     return V < LR.start;


Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.52 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.53
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.52	Fri Dec 15 16:57:14 2006
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h	Fri Dec 15 20:15:42 2006
@@ -226,7 +226,10 @@
 };
 
 std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB);
-OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB);
+inline OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) {
+  if (OS.stream()) MBB.print(*OS.stream());
+  return OS;
+}
 
 //===--------------------------------------------------------------------===//
 // GraphTraits specializations for machine basic block graphs (machine-CFGs)


Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.207 llvm/include/llvm/CodeGen/MachineInstr.h:1.208
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.207	Fri Dec 15 16:57:14 2006
+++ llvm/include/llvm/CodeGen/MachineInstr.h	Fri Dec 15 20:15:42 2006
@@ -76,6 +76,9 @@
   int offset;
 
   MachineOperand() {}
+
+  void print(std::ostream &os) const;
+
 public:
   MachineOperand(const MachineOperand &M) {
     *this = M;
@@ -285,8 +288,14 @@
     IsDead = false;
   }
 
-  friend OStream& operator<<(OStream& os, const MachineOperand& mop);
-  friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop);
+  friend OStream& operator<<(OStream& os, const MachineOperand& mop) {
+    if (os.stream()) mop.print(*os.stream());
+    return os;
+  }
+  friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop) {
+    mop.print(os);
+    return os;
+  }
 
   friend class MachineInstr;
 };
@@ -398,9 +407,16 @@
     if (OS.stream()) print(*OS.stream(), TM);
   }
   void print(std::ostream &OS, const TargetMachine *TM) const;
+  void print(std::ostream &OS) const;
   void dump() const;
-  friend OStream& operator<<(OStream& os, const MachineInstr& minstr);
-  friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr);
+  friend OStream& operator<<(OStream& os, const MachineInstr& minstr) {
+    if (os.stream()) minstr.print(*os.stream());
+    return os;
+  }
+  friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr){
+    minstr.print(os);
+    return os;
+  }
 
   //===--------------------------------------------------------------------===//
   // Accessors to add operands when building up machine instructions.






More information about the llvm-commits mailing list