Skip to content

Commit 7601ee1

Browse files
kazutakahiratagithub-actions[bot]
authored andcommitted
Automerge: [BOLT] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] (NFC) (#163700)
This patch replaces LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]], introduced as part of C++17.
2 parents f9740bc + 9be6744 commit 7601ee1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bolt/lib/Core/CallGraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#undef USE_SSECRC
2323
#endif
2424

25-
static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64_fallback(int64_t k) {
25+
[[maybe_unused]] static inline size_t hash_int64_fallback(int64_t k) {
2626
uint64_t key = (unsigned long long)k;
2727
// "64 bit Mix Functions", from Thomas Wang's "Integer Hash Function."
2828
// http://www.concentric.net/~ttwang/tech/inthash.htm
@@ -35,7 +35,7 @@ static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64_fallback(int64_t k) {
3535
return static_cast<size_t>(static_cast<uint32_t>(key));
3636
}
3737

38-
static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64(int64_t k) {
38+
[[maybe_unused]] static inline size_t hash_int64(int64_t k) {
3939
#if defined(USE_SSECRC) && defined(__SSE4_2__)
4040
size_t h = 0;
4141
__asm("crc32q %1, %0\n" : "+r"(h) : "rm"(k));

bolt/lib/Core/DebugData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ std::optional<AttrInfo> findAttributeInfo(const DWARFDie DIE,
101101
return findAttributeInfo(DIE, AbbrevDecl, *Index);
102102
}
103103

104-
LLVM_ATTRIBUTE_UNUSED
104+
[[maybe_unused]]
105105
static void printLE64(const std::string &S) {
106106
for (uint32_t I = 0, Size = S.size(); I < Size; ++I) {
107107
errs() << Twine::utohexstr(S[I]);

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void printDie(const DWARFDie &DIE) {
6969
}
7070

7171
/// Lazily parse DWARF DIE and print it out.
72-
LLVM_ATTRIBUTE_UNUSED
72+
[[maybe_unused]]
7373
static void printDie(DWARFUnit &DU, uint64_t DIEOffset) {
7474
uint64_t OriginalOffsets = DIEOffset;
7575
uint64_t NextCUOffset = DU.getNextUnitOffset();

0 commit comments

Comments
 (0)