[llvm-commits] [llvm] r164005 - /llvm/trunk/include/llvm/Support/Compiler.h

Craig Topper craig.topper at gmail.com
Sun Sep 16 13:53:30 PDT 2012


Author: ctopper
Date: Sun Sep 16 15:53:30 2012
New Revision: 164005

URL: http://llvm.org/viewvc/llvm-project?rev=164005&view=rev
Log:
Add LLVM_OVERRIDE and LLVM_FINAL C++11 compatibility macros.

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=164005&r1=164004&r2=164005&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Sun Sep 16 15:53:30 2012
@@ -57,6 +57,22 @@
 #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





More information about the llvm-commits mailing list