Avoid needlessly casting away const qualifiers.
authorDan Gohman <gohman@apple.com>
Fri, 8 Feb 2008 03:26:46 +0000 (03:26 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 8 Feb 2008 03:26:46 +0000 (03:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46876 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 9cb58c93290f82f7b52460413d4ddcf6826c97d6..2c35e3181bbf82eabff5eabf4f8ab0b40dbf4c9f 100644 (file)
@@ -1001,7 +1001,7 @@ protected:
   
   /// getValueTypeList - Return a pointer to the specified value type.
   ///
-  static MVT::ValueType *getValueTypeList(MVT::ValueType VT);
+  static const MVT::ValueType *getValueTypeList(MVT::ValueType VT);
   static SDVTList getSDVTList(MVT::ValueType VT) {
     SDVTList Ret = { getValueTypeList(VT), 1 };
     return Ret;
index b58138eb2b08f5f3c5fa06ff4526403181d42e69..a62ea53142061acb272b7c3291eaa90426c9ead5 100644 (file)
@@ -3563,10 +3563,10 @@ void SDNode::Profile(FoldingSetNodeID &ID) {
 
 /// getValueTypeList - Return a pointer to the specified value type.
 ///
-MVT::ValueType *SDNode::getValueTypeList(MVT::ValueType VT) {
+const MVT::ValueType *SDNode::getValueTypeList(MVT::ValueType VT) {
   if (MVT::isExtendedVT(VT)) {
     static std::set<MVT::ValueType> EVTs;
-    return (MVT::ValueType *)&(*EVTs.insert(VT).first);
+    return &(*EVTs.insert(VT).first);
   } else {
     static MVT::ValueType VTs[MVT::LAST_VALUETYPE];
     VTs[VT] = VT;