summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-31 20:57:23 +0000
committerChris Lattner <sabre@nondot.org>2009-03-31 20:57:23 +0000
commite0d25e42e9cb541c81c4f86bae6a11e7989d4f32 (patch)
tree56feb45452d1fe85a4682e3e6f23d480b9781944
parente521a8994cd24e85f968833209d74ad611d5e4b2 (diff)
downloadbcm5719-llvm-e0d25e42e9cb541c81c4f86bae6a11e7989d4f32.tar.gz
bcm5719-llvm-e0d25e42e9cb541c81c4f86bae6a11e7989d4f32.zip
add some accessors so I can play games with DenseMaps.
llvm-svn: 68145
-rw-r--r--llvm/include/llvm/ADT/DenseMap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index c0f8cee5984..ce0c006cf2b 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -279,6 +279,18 @@ public:
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())) {
OpenPOWER on IntegriCloud