summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-01-15 05:01:39 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-01-15 05:01:39 +0000
commitb5f8cd5bb04df52c05cbd1eddf081e6d9cf9cd64 (patch)
tree9bb960e5802ea2f64abf8be22cddd6b18b82f186
parent47f39340211f537cf79610832194c1884d420d62 (diff)
downloadllvm-b5f8cd5bb04df52c05cbd1eddf081e6d9cf9cd64.tar.gz
llvm-b5f8cd5bb04df52c05cbd1eddf081e6d9cf9cd64.tar.bz2
llvm-b5f8cd5bb04df52c05cbd1eddf081e6d9cf9cd64.tar.xz
[Support] Add LLVM_CONSTEXPR.
Marks a decl as constexpr if the compiler supports it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172508 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/Compiler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index e639a2cfa1..7e855b2f10 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -95,6 +95,12 @@
#define LLVM_OVERRIDE
#endif
+#if __has_feature(cxx_constexpr) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define LLVM_CONSTEXPR constexpr
+#else
+# define LLVM_CONSTEXPR
+#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