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

Dan Gohman gohman at apple.com
Mon Feb 25 11:08:02 PST 2008


Author: djg
Date: Mon Feb 25 13:08:02 2008
New Revision: 47552

URL: http://llvm.org/viewvc/llvm-project?rev=47552&view=rev
Log:
Add a new method to SDNode/SDOperand named getValueSizeInBits
that combines getValueType and MVT::getSizeInBits, since this
occurrs frequently.

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=47552&r1=47551&r2=47552&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Feb 25 13:08:02 2008
@@ -831,6 +831,12 @@
   ///
   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 @@
     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; }





More information about the llvm-commits mailing list