[llvm-commits] [llvm] r68145 - /llvm/trunk/include/llvm/ADT/DenseMap.h
Chris Lattner
sabre at nondot.org
Tue Mar 31 13:57:23 PDT 2009
Author: lattner
Date: Tue Mar 31 15:57:23 2009
New Revision: 68145
URL: http://llvm.org/viewvc/llvm-project?rev=68145&view=rev
Log:
add some accessors so I can play games with DenseMaps.
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=68145&r1=68144&r2=68145&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Tue Mar 31 15:57:23 2009
@@ -279,6 +279,18 @@
return *this;
}
+ /// isPointerIntoBucketsArray - Return true if the specified pointer points
+ /// somewhere into the DenseMap's array of buckets (i.e. either to a key or
+ /// value in the DenseMap).
+ bool isPointerIntoBucketsArray(const void *Ptr) const {
+ return Ptr >= Buckets && Ptr < Buckets+NumBuckets;
+ }
+
+ /// getPointerIntoBucketsArray() - Return an opaque pointer into the buckets
+ /// array. In conjunction with the previous method, this can be used to
+ /// determine whether an insertion caused the DenseMap to reallocate.
+ const void *getPointerIntoBucketsArray() const { return Buckets; }
+
private:
void CopyFrom(const DenseMap& other) {
if (NumBuckets != 0 && (!KeyInfoT::isPod() || !ValueInfoT::isPod())) {
More information about the llvm-commits
mailing list