[PATCH] D25900: [ADT] static_assert that SmallDenseMap is instantiated with a power-of-two number of inline buckets.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 09:16:13 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL284985: [ADT] static_assert that SmallDenseMap is instantiated with a power-of-two… (authored by jlebar).

Changed prior to commit:
  https://reviews.llvm.org/D25900?vs=75546&id=75596#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25900

Files:
  llvm/trunk/include/llvm/ADT/DenseMap.h


Index: llvm/trunk/include/llvm/ADT/DenseMap.h
===================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h
+++ llvm/trunk/include/llvm/ADT/DenseMap.h
@@ -742,6 +742,8 @@
   // simplicity of referring to them.
   typedef DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT> BaseT;
   friend class DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+  static_assert(isPowerOf2_64(InlineBuckets),
+                "InlineBuckets must be a power of 2.");
 
   unsigned Small : 1;
   unsigned NumEntries : 31;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25900.75596.patch
Type: text/x-patch
Size: 574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161024/c8896889/attachment.bin>


More information about the llvm-commits mailing list