aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-09-16 20:53:30 +0000
committerCraig Topper <craig.topper@gmail.com>2012-09-16 20:53:30 +0000
commitfbb13471ed99ab8fdc3dbadb091ee5e2295b7b26 (patch)
treeeed4d2b7e46dda5fd10ac2b3d14f0a2299d83dc0 /include/llvm/Support
parent63392ea3ba295d59260553245b14a435b5f71a3e (diff)
downloadexternal_llvm-fbb13471ed99ab8fdc3dbadb091ee5e2295b7b26.zip
external_llvm-fbb13471ed99ab8fdc3dbadb091ee5e2295b7b26.tar.gz
external_llvm-fbb13471ed99ab8fdc3dbadb091ee5e2295b7b26.tar.bz2
Add LLVM_OVERRIDE and LLVM_FINAL C++11 compatibility macros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/Compiler.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 1136ff7..85e9bef 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -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