aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-02-25 19:08:02 +0000
committerDan Gohman <gohman@apple.com>2008-02-25 19:08:02 +0000
commit4fc3d5dac255120e2f0c0b537044fcf56a30fa34 (patch)
tree5ebf9e2756976a868e2e77b9d149131fd476fc86
parent1a9c9df1db4ab3bf39f0395a7086576b4491d50b (diff)
downloadexternal_llvm-4fc3d5dac255120e2f0c0b537044fcf56a30fa34.tar.gz
external_llvm-4fc3d5dac255120e2f0c0b537044fcf56a30fa34.tar.bz2
external_llvm-4fc3d5dac255120e2f0c0b537044fcf56a30fa34.zip
Add a new method to SDNode/SDOperand named getValueSizeInBits
that combines getValueType and MVT::getSizeInBits, since this occurrs frequently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47552 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index d47e0a69a7..6996c69545 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -831,6 +831,12 @@ public:
///
inline MVT::ValueType getValueType() const;
+ /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType()).
+ ///
+ unsigned getValueSizeInBits() const {
+ return MVT::getSizeInBits(getValueType());
+ }
+
// Forwarding methods - These forward to the corresponding methods in SDNode.
inline unsigned getOpcode() const;
inline unsigned getNumOperands() const;
@@ -1011,6 +1017,12 @@ public:
return ValueList[ResNo];
}
+ /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType(ResNo)).
+ ///
+ unsigned getValueSizeInBits(unsigned ResNo) const {
+ return MVT::getSizeInBits(getValueType(ResNo));
+ }
+
typedef const MVT::ValueType* value_iterator;
value_iterator value_begin() const { return ValueList; }
value_iterator value_end() const { return ValueList+NumValues; }