[llvm-commits] CVS: llvm/include/llvm/Value.h

Chris Lattner lattner at cs.uiuc.edu
Wed Oct 15 11:40:02 PDT 2003


Changes in directory llvm/include/llvm:

Value.h updated: 1.44 -> 1.45

---
Log message:

Add new hasOneUse() method.  Remove explicit inline qualifiers


---
Diffs of the changes:  (+13 -9)

Index: llvm/include/llvm/Value.h
diff -u llvm/include/llvm/Value.h:1.44 llvm/include/llvm/Value.h:1.45
--- llvm/include/llvm/Value.h:1.44	Thu Oct  2 14:44:23 2003
+++ llvm/include/llvm/Value.h	Wed Oct 15 11:39:04 2003
@@ -97,18 +97,22 @@
   typedef std::vector<User*>::iterator       use_iterator;
   typedef std::vector<User*>::const_iterator use_const_iterator;
 
-  inline unsigned           use_size()  const { return Uses.size();  }
-  inline bool               use_empty() const { return Uses.empty(); }
-  inline use_iterator       use_begin()       { return Uses.begin(); }
-  inline use_const_iterator use_begin() const { return Uses.begin(); }
-  inline use_iterator       use_end()         { return Uses.end();   }
-  inline use_const_iterator use_end()   const { return Uses.end();   }
-  inline User              *use_back()        { return Uses.back();  }
-  inline const User        *use_back()  const { return Uses.back();  }
+  unsigned           use_size()  const { return Uses.size();  }
+  bool               use_empty() const { return Uses.empty(); }
+  use_iterator       use_begin()       { return Uses.begin(); }
+  use_const_iterator use_begin() const { return Uses.begin(); }
+  use_iterator       use_end()         { return Uses.end();   }
+  use_const_iterator use_end()   const { return Uses.end();   }
+  User              *use_back()        { return Uses.back();  }
+  const User        *use_back()  const { return Uses.back();  }
+
+  /// hasOneUse - Return true if there is exactly one user of this value.
+  ///
+  bool hasOneUse() const { return use_size() == 1; }
 
   /// addUse/killUse - These two methods should only be used by the Use class
   /// below.
-  inline void addUse(User *I)      { Uses.push_back(I); }
+  void addUse(User *I)      { Uses.push_back(I); }
   void killUse(User *I);
 };
 





More information about the llvm-commits mailing list