From: Dan Gohman Date: Fri, 8 Feb 2008 03:26:46 +0000 (+0000) Subject: Avoid needlessly casting away const qualifiers. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=547ca537b638c8fd5c8f4729e4c74898f8371e4e;p=oota-llvm.git Avoid needlessly casting away const qualifiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46876 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 9cb58c93290..2c35e3181bb 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -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; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index b58138eb2b0..a62ea531420 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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 EVTs; - return (MVT::ValueType *)&(*EVTs.insert(VT).first); + return &(*EVTs.insert(VT).first); } else { static MVT::ValueType VTs[MVT::LAST_VALUETYPE]; VTs[VT] = VT;