[llvm] r194266 - Add ImmutableSet profiling info for 'bool'.

Jordan Rose jordan_rose at apple.com
Fri Nov 8 09:23:49 PST 2013


Author: jrose
Date: Fri Nov  8 11:23:49 2013
New Revision: 194266

URL: http://llvm.org/viewvc/llvm-project?rev=194266&view=rev
Log:
Add ImmutableSet profiling info for 'bool'.

Useful for tri-state maps: true, false, and "no data yet".

Modified:
    llvm/trunk/include/llvm/ADT/ImmutableSet.h

Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=194266&r1=194265&r2=194266&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Fri Nov  8 11:23:49 2013
@@ -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>





More information about the llvm-commits mailing list