Replicate attributes on definition to make MSVC less noisy
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 25 Apr 2020 00:00:54 +0000 (02:00 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 25 Apr 2020 00:02:00 +0000 (02:02 +0200)
warning C4565: 'llvm::allocate_buffer': redefinition; the symbol was previously declared with __declspec(restrict)

llvm/lib/Support/MemAlloc.cpp

index bc5a26d..7aaa0dc 100644 (file)
@@ -10,7 +10,8 @@
 
 // These are out of line to have __cpp_aligned_new not affect ABI.
 
-void *llvm::allocate_buffer(size_t Size, size_t Alignment) {
+LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void *
+llvm::allocate_buffer(size_t Size, size_t Alignment) {
   return ::operator new(Size
 #ifdef __cpp_aligned_new
                         ,