Add LLVM_OVERRIDE and LLVM_FINAL C++11 compatibility macros.
authorCraig Topper <craig.topper@gmail.com>
Sun, 16 Sep 2012 20:53:30 +0000 (20:53 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sun, 16 Sep 2012 20:53:30 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164005 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Compiler.h

index 1136ff70c370fb85a40d07071382ee4f7517fdb6..85e9befc0c7e78981a8fbe96fefcafa1c89fafd1 100644 (file)
 #define LLVM_DELETED_FUNCTION
 #endif
 
+/// 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))
+#define LLVM_FINAL final
+#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))
+#define LLVM_OVERRIDE override
+#else
+#define LLVM_OVERRIDE
+#endif
+
 /// LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked
 /// into a shared library, then the class should be private to the library and
 /// not accessible from outside it.  Can also be used to mark variables and