aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/DenseMap.h
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
commitbdd376ccb25f251e115fff24b526b4e65e03a1d3 (patch)
treeb39aff2aee7f61c8cca19a21ff1be6bc7655f7ed /include/llvm/ADT/DenseMap.h
parentde62192843c90189fbb21145437b085848140122 (diff)
downloadexternal_llvm-bdd376ccb25f251e115fff24b526b4e65e03a1d3.zip
external_llvm-bdd376ccb25f251e115fff24b526b4e65e03a1d3.tar.gz
external_llvm-bdd376ccb25f251e115fff24b526b4e65e03a1d3.tar.bz2
add some accessors so I can play games with DenseMaps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/DenseMap.h')
-rw-r--r--include/llvm/ADT/DenseMap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index c0f8cee..ce0c006 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/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())) {