aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-11-08 17:23:49 +0000
committerJordan Rose <jordan_rose@apple.com>2013-11-08 17:23:49 +0000
commitfffdcacff2de0c1eaf4dbd2884384d71d024776d (patch)
tree44c2e974a1f10997a9809d2e4af4b1aa67e4166c /include
parent323ac85d6ad7ba5d9593d8e151d879bd91d82e08 (diff)
downloadexternal_llvm-fffdcacff2de0c1eaf4dbd2884384d71d024776d.zip
external_llvm-fffdcacff2de0c1eaf4dbd2884384d71d024776d.tar.gz
external_llvm-fffdcacff2de0c1eaf4dbd2884384d71d024776d.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/ImmutableSet.h12
1 files changed, 12 insertions, 0 deletions
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<bool> {
+ 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 <typename T>