[llvm-branch-commits] [llvm-branch] r164514 - /llvm/branches/R600/include/llvm/ADT/DenseMap.h

Tom Stellard thomas.stellard at amd.com
Mon Sep 24 08:53:42 PDT 2012


Author: tstellar
Date: Mon Sep 24 10:52:04 2012
New Revision: 164514

URL: http://llvm.org/viewvc/llvm-project?rev=164514&view=rev
Log:
DenseMap: assert that we have found a bucket before we try to insert into it.

This silences literally dozens of analyzer warnings on LLVM (since DenseMap
is such a commonly-used class).

Modified:
    llvm/branches/R600/include/llvm/ADT/DenseMap.h

Modified: llvm/branches/R600/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/include/llvm/ADT/DenseMap.h?rev=164514&r1=164513&r2=164514&view=diff
==============================================================================
--- llvm/branches/R600/include/llvm/ADT/DenseMap.h (original)
+++ llvm/branches/R600/include/llvm/ADT/DenseMap.h Mon Sep 24 10:52:04 2012
@@ -423,6 +423,7 @@
       this->grow(NumBuckets);
       LookupBucketFor(Key, TheBucket);
     }
+    assert(TheBucket);
 
     // Only update the state after we've grown our bucket space appropriately
     // so that when growing buckets we have self-consistent entry count.





More information about the llvm-branch-commits mailing list