aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/type_traits.h
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-10-22 20:10:20 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-10-22 20:10:20 +0000
commite0a234029b1b65f21169536f4c45e83743ed3cfa (patch)
tree47c339af1f2fbc95bfa69c64488190662f759a32 /include/llvm/Support/type_traits.h
parent9d89df169027035bf692b3d397bb93cff7bdc860 (diff)
downloadexternal_llvm-e0a234029b1b65f21169536f4c45e83743ed3cfa.zip
external_llvm-e0a234029b1b65f21169536f4c45e83743ed3cfa.tar.gz
external_llvm-e0a234029b1b65f21169536f4c45e83743ed3cfa.tar.bz2
Add a ValueMap<ValueOrSubclass*, T> type. ValueMap<Value*, T> is safe to use
even when keys get RAUWed and deleted during its lifetime. By default the keys act like WeakVHs, but users can pass a third template parameter to configure how updates work and whether to do anything beyond updating the map on each action. It's also possible to automatically acquire a lock around ValueMap updates triggered by RAUWs and deletes, to support the ExecutionEngine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/type_traits.h')
-rw-r--r--include/llvm/Support/type_traits.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/type_traits.h b/include/llvm/Support/type_traits.h
index 5f799b8..cfaae4b 100644
--- a/include/llvm/Support/type_traits.h
+++ b/include/llvm/Support/type_traits.h
@@ -87,6 +87,15 @@ struct is_base_of {
sizeof(char) == sizeof(dont_use::base_of_helper<Base>((Derived*)0));
};
+// remove_pointer - Metafunction to turn Foo* into Foo. Defined in
+// C++0x [meta.trans.ptr].
+template <typename T> struct remove_pointer { typedef T type; };
+template <typename T> struct remove_pointer<T*> { typedef T type; };
+template <typename T> struct remove_pointer<T*const> { typedef T type; };
+template <typename T> struct remove_pointer<T*volatile> { typedef T type; };
+template <typename T> struct remove_pointer<T*const volatile> {
+ typedef T type; };
+
}
#endif