[PATCH] D78356: [flang] Replace ATTRIBUTE_UNUSED with LLVM_ATTRIBUTE_UNUSED.
مهدي شينون (Mehdi Chinoune) via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 22:41:38 PDT 2020
ChinouneMehdi updated this revision to Diff 261128.
ChinouneMehdi retitled this revision from "[flang] Use a better definition for ATTRIBUTE_UNUSED" to "[flang] Replace ATTRIBUTE_UNUSED with LLVM_ATTRIBUTE_UNUSED.".
ChinouneMehdi added a comment.
Use LLVM_ATTRIBUTE_UNUSED
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78356/new/
https://reviews.llvm.org/D78356
Files:
flang/include/flang/Common/idioms.h
Index: flang/include/flang/Common/idioms.h
===================================================================
--- flang/include/flang/Common/idioms.h
+++ flang/include/flang/Common/idioms.h
@@ -20,6 +20,7 @@
#include <tuple>
#include <type_traits>
#include <variant>
+#include "llvm/Support/Compiler.h"
#if __GNUC__ == 7
// Avoid a deduction bug in GNU 7.x headers by forcing the answer.
@@ -98,10 +99,6 @@
} \
template <typename A> constexpr bool T{class_trait_ns_##T::trait_value<A>()};
-#if !defined ATTRIBUTE_UNUSED && (__clang__ || __GNUC__)
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-#endif
-
// Define enum class NAME with the given enumerators, a static
// function EnumToString() that maps enumerators to std::string,
// and a constant NAME_enumSize that captures the number of items
@@ -116,11 +113,11 @@
#define ENUM_CLASS(NAME, ...) \
enum class NAME { __VA_ARGS__ }; \
- ATTRIBUTE_UNUSED static constexpr std::size_t NAME##_enumSize{[] { \
+ LLVM_ATTRIBUTE_UNUSED static constexpr std::size_t NAME##_enumSize{[] { \
enum { __VA_ARGS__ }; \
return Fortran::common::ListItemCount{__VA_ARGS__}.value; \
}()}; \
- ATTRIBUTE_UNUSED static inline std::string EnumToString(NAME e) { \
+ LLVM_ATTRIBUTE_UNUSED static inline std::string EnumToString(NAME e) { \
return Fortran::common::EnumIndexToString( \
static_cast<int>(e), #__VA_ARGS__); \
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78356.261128.patch
Type: text/x-patch
Size: 1418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200430/181b4804/attachment.bin>
More information about the llvm-commits
mailing list