From 9dc7ab538ee845e2477519c740a2c736a19bc30d Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 5 Feb 2008 18:50:25 +0000 Subject: [PATCH] Added FoldingSet profiling support to ImmutableSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46757 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/ImmutableSet.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h index c436a2c72b0..c339e3d4f96 100644 --- a/include/llvm/ADT/ImmutableSet.h +++ b/include/llvm/ADT/ImmutableSet.h @@ -1011,12 +1011,25 @@ public: iterator begin() const { return iterator(Root); } 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 -- 2.34.1