[llvm] bc1ea2a - Replicate attributes on definition to make MSVC less noisy

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 17:02:47 PDT 2020


Author: Benjamin Kramer
Date: 2020-04-25T02:02:00+02:00
New Revision: bc1ea2a2c5e177ad0034e445cd32b62d3b22ac90

URL: https://github.com/llvm/llvm-project/commit/bc1ea2a2c5e177ad0034e445cd32b62d3b22ac90
DIFF: https://github.com/llvm/llvm-project/commit/bc1ea2a2c5e177ad0034e445cd32b62d3b22ac90.diff

LOG: Replicate attributes on definition to make MSVC less noisy

warning C4565: 'llvm::allocate_buffer': redefinition; the symbol was previously declared with __declspec(restrict)

Added: 
    

Modified: 
    llvm/lib/Support/MemAlloc.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/MemAlloc.cpp b/llvm/lib/Support/MemAlloc.cpp
index bc5a26dc7218..7aaa0dc6e205 100644
--- a/llvm/lib/Support/MemAlloc.cpp
+++ b/llvm/lib/Support/MemAlloc.cpp
@@ -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
                         ,


        


More information about the llvm-commits mailing list