[llvm-commits] [llvm] r46876 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Dan Gohman
gohman at apple.com
Thu Feb 7 19:26:46 PST 2008
Author: djg
Date: Thu Feb 7 21:26:46 2008
New Revision: 46876
URL: http://llvm.org/viewvc/llvm-project?rev=46876&view=rev
Log:
Avoid needlessly casting away const qualifiers.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46876&r1=46875&r2=46876&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Feb 7 21:26:46 2008
@@ -1001,7 +1001,7 @@
/// 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;
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46876&r1=46875&r2=46876&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Feb 7 21:26:46 2008
@@ -3563,10 +3563,10 @@
/// 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;
More information about the llvm-commits
mailing list