aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
commit22436b8ac20fddf08dedbe0f80bae0431767a0c7 (patch)
tree227531fd468cd8827e71c862924d3812fb34acc1 /include
parentcfb6bf59734ce4690964b9a7fea7f5d19873d9ea (diff)
downloadexternal_llvm-22436b8ac20fddf08dedbe0f80bae0431767a0c7.zip
external_llvm-22436b8ac20fddf08dedbe0f80bae0431767a0c7.tar.gz
external_llvm-22436b8ac20fddf08dedbe0f80bae0431767a0c7.tar.bz2
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')
-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 c436a2c..c339e3d 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