[DAGCombine] MergeConsecutiveStores - fix cppcheck/MSVC extension warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 15 Aug 2019 13:07:14 +0000 (13:07 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 15 Aug 2019 13:07:14 +0000 (13:07 +0000)
Set the StartIdx type to size_t so that it matches the StoreNodes SmallVector size() and index types.

Silences the MSVC analyzer warning that unsigned increment might overflow before exceeding size_t on 64-bit targets - this isn't likely to happen but it means we use consistent types and reduces the warning "noise" a little.

llvm-svn: 368998

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index d9a77899ca32b8bfbe96397027005a08bc0aab83..57fd6025e49785ac6a8113941c08bfe006d11446 100644 (file)
@@ -15396,7 +15396,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
 
   bool RV = false;
   while (StoreNodes.size() > 1) {
-    unsigned StartIdx = 0;
+    size_t StartIdx = 0;
     while ((StartIdx + 1 < StoreNodes.size()) &&
            StoreNodes[StartIdx].OffsetFromBase + ElementSizeBytes !=
                StoreNodes[StartIdx + 1].OffsetFromBase)