BumpPtrAllocator: do the size check without moving any pointers
[oota-llvm.git] / include / llvm / Support / Compiler.h
index 1edcd45bc3bb61611af925aa48878de8d10afdaf..85f0cc6a39176f79107a472561aee55289ff048d 100644 (file)
 #define LLVM_MSC_PREREQ(version) 0
 #endif
 
+#ifndef _MSC_VER
+#define LLVM_NOEXCEPT noexcept
+#else
+#define LLVM_NOEXCEPT
+#endif
+
 /// \brief Does the compiler support r-value reference *this?
 ///
 /// Sadly, this is separate from just r-value reference support because GCC
 #define LLVM_ATTRIBUTE_NORETURN
 #endif
 
+#if __has_attribute(returns_nonnull) || __GNUC_PREREQ(4, 9)
+#define LLVM_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull))
+#else
+#define LLVM_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
 /// LLVM_EXTENSION - Support compilers where we have a keyword to suppress
 /// pedantic diagnostics.
 #ifdef __GNUC__