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
This commit is contained in:
Dan Gohman 2008-02-25 19:08:02 +00:00
parent 1a9c9df1db
commit 4fc3d5dac2

View File

@ -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; }