Skip to content

Commit ffca377

Browse files
[lld] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] (NFC) (#163701)
This patch replaces LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]], introduced as part of C++17.
1 parent d13bcb6 commit ffca377

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lld/ELF/Symbols.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ template <typename T> struct AssertSymbol {
3535
"SymbolUnion not aligned enough");
3636
};
3737

38-
LLVM_ATTRIBUTE_UNUSED static inline void assertSymbols() {
38+
[[maybe_unused]] static inline void assertSymbols() {
3939
AssertSymbol<Defined>();
4040
AssertSymbol<CommonSymbol>();
4141
AssertSymbol<Undefined>();

lld/MachO/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ void multiThreadedPageInBackground(DeferredFiles &deferred) {
355355
// Reference all file's mmap'd pages to load them into memory.
356356
for (const char *page = buff.data(), *end = page + buff.size(); page < end;
357357
page += pageSize) {
358-
LLVM_ATTRIBUTE_UNUSED volatile char t = *page;
358+
[[maybe_unused]] volatile char t = *page;
359359
(void)t;
360360
}
361361
};

0 commit comments

Comments
 (0)