[llvm-commits] [llvm] r42038 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Dan Gohman djg at cray.com
Mon Sep 17 10:44:31 PDT 2007


Author: djg
Date: Mon Sep 17 12:44:31 2007
New Revision: 42038

URL: http://llvm.org/viewvc/llvm-project?rev=42038&view=rev
Log:
Add a utility function to SDOperand for testing if a value is unused.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=42038&r1=42037&r2=42038&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Sep 17 12:44:31 2007
@@ -766,6 +766,10 @@
   /// hasOneUse - Return true if there is exactly one operation using this
   /// result value of the defining operator.
   inline bool hasOneUse() const;
+
+  /// use_empty - Return true if there are no operations using this
+  /// result value of the defining operator.
+  inline bool use_empty() const;
 };
 
 
@@ -1035,6 +1039,9 @@
 inline bool SDOperand::hasOneUse() const {
   return Val->hasNUsesOfValue(1, ResNo);
 }
+inline bool SDOperand::use_empty() const {
+  return !Val->hasAnyUseOfValue(ResNo);
+}
 
 /// UnarySDNode - This class is used for single-operand SDNodes.  This is solely
 /// to allow co-allocation of node operands with the node itself.





More information about the llvm-commits mailing list