Added function MachineInstr::operandIsDefined(i) and decl for
[oota-llvm.git] / include / llvm / CodeGen / MachineInstr.h
index 83c29ed9396d014b3b32cf9680e79b87a7e07a34..fbb3106810dda1d33172aa3e1622fe9271936bef 100644 (file)
@@ -133,10 +133,8 @@ private:
   void                 InitializeReg   (unsigned int regNum);
 
   friend class MachineInstr;
-  friend class  ValOpIterator<const MachineInstr, const Value>;
-
-  //friend class MachineInstr::val_op_const_iterator;
-  //friend class MachineInstr::val_op_iterator;
+  friend class ValOpIterator<const MachineInstr, const Value>;
+  friend class ValOpIterator<      MachineInstr,       Value>;
 };
 
 
@@ -243,6 +241,8 @@ public:
   const MachineOperand& getOperand     (unsigned int i) const;
         MachineOperand& getOperand     (unsigned int i);
   
+  bool                 operandIsDefined(unsigned int i) const;
+  
   void                 dump            (unsigned int indent = 0) const;
   
 public:
@@ -289,6 +289,12 @@ MachineInstr::getOperand(unsigned int i) const
   return operands[i];
 }
 
+inline bool
+MachineInstr::operandIsDefined(unsigned int i) const
+{
+  return getOperand(i).opIsDef();
+}
+
 
 template<class _MI, class _V>
 class ValOpIterator : public std::forward_iterator<_V, ptrdiff_t> {
@@ -448,12 +454,16 @@ MachineOperand::MachineOperandType
                                 unsigned int& getMachineRegNum,
                                 int64_t& getImmedValue);
 
+
 ostream& operator<<(ostream& os, const MachineInstr& minstr);
 
 
 ostream& operator<<(ostream& os, const MachineOperand& mop);
                                         
 
+void   PrintMachineInstructions        (Method* method);
+
+
 //**************************************************************************/
 
 #endif