aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/ImmutableSet.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-05 18:50:25 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-05 18:50:25 +0000
commit9dc7ab538ee845e2477519c740a2c736a19bc30d (patch)
tree227531fd468cd8827e71c862924d3812fb34acc1 /include/llvm/ADT/ImmutableSet.h
parent95da16e2881a662401220cd52a4267b7cd7f5860 (diff)
downloadexternal_llvm-9dc7ab538ee845e2477519c740a2c736a19bc30d.tar.gz
external_llvm-9dc7ab538ee845e2477519c740a2c736a19bc30d.tar.bz2
external_llvm-9dc7ab538ee845e2477519c740a2c736a19bc30d.zip
Added FoldingSet profiling support to ImmutableSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ImmutableSet.h')
-rw-r--r--include/llvm/ADT/ImmutableSet.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index c436a2c72b..c339e3d4f9 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -1012,11 +1012,24 @@ public:
iterator end() const { return iterator(); }
//===--------------------------------------------------===//
+ // Utility methods.
+ //===--------------------------------------------------===//
+
+ inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
+
+ static inline void Profile(FoldingSetNodeID& ID, const ImmutableSet& S) {
+ ID.AddPointer(S.Root);
+ }
+
+ inline void Profile(FoldingSetNodeID& ID) const {
+ return Profile(ID,*this);
+ }
+
+ //===--------------------------------------------------===//
// For testing.
//===--------------------------------------------------===//
void verify() const { if (Root) Root->verify(); }
- unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
};
} // end namespace llvm