[Support] Add LLVM_CONSTEXPR.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Tue, 15 Jan 2013 05:01:39 +0000 (05:01 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Tue, 15 Jan 2013 05:01:39 +0000 (05:01 +0000)
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

include/llvm/Support/Compiler.h

index e639a2cfa1e798f2f4ef1ce761324bae58ef4197..7e855b2f10cd324889ff609bcbe8fe63b5c76c7e 100644 (file)
 #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