aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-09-17 17:44:31 +0000
committerDan Gohman <gohman@apple.com>2007-09-17 17:44:31 +0000
commite1b50639a860934685dff840e1826b16dbe6a344 (patch)
treec8e07b59d8a5b46374b752aa17c61eb9929dc2a5 /include/llvm
parent7d6ff3a25d9be6fae7ad95837ba8f1a8738947b6 (diff)
downloadexternal_llvm-e1b50639a860934685dff840e1826b16dbe6a344.zip
external_llvm-e1b50639a860934685dff840e1826b16dbe6a344.tar.gz
external_llvm-e1b50639a860934685dff840e1826b16dbe6a344.tar.bz2
Add a utility function to SDOperand for testing if a value is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 4f44c4f..40a88eb 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -766,6 +766,10 @@ public:
/// 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 unsigned SDOperand::getTargetOpcode() const {
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.