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

Michael J. Spencer bigcheesegs at gmail.com
Mon Jan 14 21:01:39 PST 2013


Author: mspencer
Date: Mon Jan 14 23:01:39 2013
New Revision: 172508

URL: http://llvm.org/viewvc/llvm-project?rev=172508&view=rev
Log:
[Support] Add LLVM_CONSTEXPR.

Marks a decl as constexpr if the compiler supports it.

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=172508&r1=172507&r2=172508&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Mon Jan 14 23:01:39 2013
@@ -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





More information about the llvm-commits mailing list