From 4fc3d5dac255120e2f0c0b537044fcf56a30fa34 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 25 Feb 2008 19:08:02 +0000 Subject: [PATCH] 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 --- include/llvm/CodeGen/SelectionDAGNodes.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index d47e0a69a7d..6996c69545f 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; } -- 2.34.1