aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF Bastien <jfbastien@apple.com>2019-08-14 20:13:49 +0000
committerJF Bastien <jfbastien@apple.com>2019-08-14 20:13:49 +0000
commit9953c74fb65786930f6dec33f9e49473966410e3 (patch)
treeb55fbfe23d9dee692a4e77e27e41f617b6591850
parentee6f3dd14dec0548c7aaf3c2461ff0998c70d1f6 (diff)
downloadllvm-9953c74fb65786930f6dec33f9e49473966410e3.zip
llvm-9953c74fb65786930f6dec33f9e49473966410e3.tar.gz
llvm-9953c74fb65786930f6dec33f9e49473966410e3.tar.bz2
Use std::is_final directly
The workaround isn't needed anymore because all toolchains should support it. llvm-svn: 368910
-rw-r--r--llvm/include/llvm/Support/TrailingObjects.h4
-rw-r--r--llvm/include/llvm/Support/type_traits.h9
2 files changed, 1 insertions, 12 deletions
diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h
index ddcdda5..1a15d39 100644
--- a/llvm/include/llvm/Support/TrailingObjects.h
+++ b/llvm/include/llvm/Support/TrailingObjects.h
@@ -249,9 +249,7 @@ class TrailingObjects : private trailing_objects_internal::TrailingObjectsImpl<
// because BaseTy isn't complete at class instantiation time, but
// will be by the time this function is instantiated.
static void verifyTrailingObjectsAssertions() {
-#ifdef LLVM_IS_FINAL
- static_assert(LLVM_IS_FINAL(BaseTy), "BaseTy must be final.");
-#endif
+ static_assert(std::is_final<BaseTy>(), "BaseTy must be final.");
}
// These two methods are the base of the recursion for this method.
diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
index 403bac7..b7d48e8 100644
--- a/llvm/include/llvm/Support/type_traits.h
+++ b/llvm/include/llvm/Support/type_traits.h
@@ -189,13 +189,4 @@ class is_trivially_copyable<T*> : public std::true_type {
} // end namespace llvm
-// If the compiler supports detecting whether a class is final, define
-// an LLVM_IS_FINAL macro. If it cannot be defined properly, this
-// macro will be left undefined.
-#if defined(__cplusplus) || defined(_MSC_VER)
-#define LLVM_IS_FINAL(Ty) std::is_final<Ty>()
-#elif __has_feature(is_final) || LLVM_GNUC_PREREQ(4, 7, 0)
-#define LLVM_IS_FINAL(Ty) __is_final(Ty)
-#endif
-
#endif // LLVM_SUPPORT_TYPE_TRAITS_H