From fffdcacff2de0c1eaf4dbd2884384d71d024776d Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 8 Nov 2013 17:23:49 +0000 Subject: Add ImmutableSet profiling info for 'bool'. Useful for tri-state maps: true, false, and "no data yet". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194266 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/ImmutableSet.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h index 2a0579e..ad34969 100644 --- a/include/llvm/ADT/ImmutableSet.h +++ b/include/llvm/ADT/ImmutableSet.h @@ -851,6 +851,18 @@ PROFILE_INTEGER_INFO(unsigned long long) #undef PROFILE_INTEGER_INFO +/// Profile traits for booleans. +template <> +struct ImutProfileInfo { + typedef const bool value_type; + typedef const bool& value_type_ref; + + static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) { + ID.AddBoolean(X); + } +}; + + /// Generic profile trait for pointer types. We treat pointers as /// references to unique objects. template -- cgit v1.1