[llvm] r198399 - Enable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more gcc and MSVC versions
Alp Toker
alp at nuanti.com
Thu Jan 2 21:00:46 PST 2014
Author: alp
Date: Thu Jan 2 23:00:46 2014
New Revision: 198399
URL: http://llvm.org/viewvc/llvm-project?rev=198399&view=rev
Log:
Enable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more gcc and MSVC versions
The 'sealed' definition of LLVM_FINAL can be dropped once VS 2010 is
decommissioned.
Some of this is speculative so will keep an eye on the waterfall -- ping me if
you see failures.
Incremental work towards C++11 migration.
Modified:
llvm/trunk/include/llvm/Support/Compiler.h
Modified: llvm/trunk/include/llvm/Support/Compiler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=198399&r1=198398&r2=198399&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Thu Jan 2 23:00:46 2014
@@ -107,7 +107,7 @@
/// \brief Does this compiler support variadic templates.
///
/// Implies LLVM_HAS_RVALUE_REFERENCES and the existence of std::forward.
-#if __has_feature(cxx_variadic_templates)
+#if __has_feature(cxx_variadic_templates) || LLVM_MSC_PREREQ(1800)
# define LLVM_HAS_VARIADIC_TEMPLATES 1
#else
# define LLVM_HAS_VARIADIC_TEMPLATES 0
@@ -151,15 +151,19 @@
/// LLVM_FINAL - Expands to 'final' if the compiler supports it.
/// Use to mark classes or virtual methods as final.
-#if __has_feature(cxx_override_control) || LLVM_MSC_PREREQ(1700)
+#if __has_feature(cxx_override_control) || \
+ defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1700)
#define LLVM_FINAL final
+#elif LLVM_MSC_PREREQ(1600)
+#define LLVM_FINAL sealed
#else
#define LLVM_FINAL
#endif
/// LLVM_OVERRIDE - Expands to 'override' if the compiler supports it.
/// Use to mark virtual methods as overriding a base class method.
-#if __has_feature(cxx_override_control) || LLVM_MSC_PREREQ(1700)
+#if __has_feature(cxx_override_control) || \
+ defined(__GXX_EXPERIMENTAL_CXX0X__) || LLVM_MSC_PREREQ(1600)
#define LLVM_OVERRIDE override
#else
#define LLVM_OVERRIDE
More information about the llvm-commits
mailing list