[llvm] r284367 - Support: Drop LLVM_ATTRIBUTE_UNUSED_RESULT
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 17 00:37:11 PDT 2016
Author: bogner
Date: Mon Oct 17 02:37:11 2016
New Revision: 284367
URL: http://llvm.org/viewvc/llvm-project?rev=284367&view=rev
Log:
Support: Drop LLVM_ATTRIBUTE_UNUSED_RESULT
Uses of this have all been updated to use LLVM_NODISCARD, which
matches the C++17 [[nodiscard]] semantics rather than those of GCC's
__attribute__((warn_unused_result)).
Modified:
llvm/trunk/docs/ReleaseNotes.rst
llvm/trunk/include/llvm/Support/Compiler.h
Modified: llvm/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.rst?rev=284367&r1=284366&r2=284367&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.rst (original)
+++ llvm/trunk/docs/ReleaseNotes.rst Mon Oct 17 02:37:11 2016
@@ -41,6 +41,10 @@ Non-comprehensive list of changes in thi
functionality, or simply have a lot to talk about), see the `NOTE` below
for adding a new subsection.
+* The definition and uses of LLVM_ATRIBUTE_UNUSED_RESULT in the LLVM source
+ were replaced with LLVM_NODISCARD, which matches the C++17 [[nodiscard]]
+ semantics rather than gcc's __attribute__((warn_unused_result)).
+
* ... next change ...
.. NOTE
Modified: llvm/trunk/include/llvm/Support/Compiler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=284367&r1=284366&r2=284367&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Compiler.h (original)
+++ llvm/trunk/include/llvm/Support/Compiler.h Mon Oct 17 02:37:11 2016
@@ -130,15 +130,6 @@
#define LLVM_ATTRIBUTE_USED
#endif
-/// LLVM_ATTRIBUTE_UNUSED_RESULT - Deprecated. Use LLVM_NODISCARD instead.
-#if __has_attribute(warn_unused_result) || LLVM_GNUC_PREREQ(3, 4, 0)
-#define LLVM_ATTRIBUTE_UNUSED_RESULT __attribute__((__warn_unused_result__))
-#elif defined(_MSC_VER)
-#define LLVM_ATTRIBUTE_UNUSED_RESULT _Check_return_
-#else
-#define LLVM_ATTRIBUTE_UNUSED_RESULT
-#endif
-
/// LLVM_NODISCARD - Warn if a type or return value is discarded.
#if __cplusplus > 201402L && __has_cpp_attribute(nodiscard)
#define LLVM_NODISCARD [[nodiscard]]
More information about the llvm-commits
mailing list