diff options
| author | Kazu Hirata <kazu@google.com> | 2025-10-16 13:06:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-16 13:06:58 -0700 |
| commit | 9be674420db90f68a7a00bd41d746f28b1d6a26a (patch) | |
| tree | 212d7963534407bab696b2a309a5652f57c57ab2 /bolt | |
| parent | 01c0cb928a2e9df72fd68942143bf5d4041d38ed (diff) | |
[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.
Diffstat (limited to 'bolt')
| -rw-r--r-- | bolt/lib/Core/CallGraph.cpp | 4 | ||||
| -rw-r--r-- | bolt/lib/Core/DebugData.cpp | 2 | ||||
| -rw-r--r-- | bolt/lib/Rewrite/DWARFRewriter.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/bolt/lib/Core/CallGraph.cpp b/bolt/lib/Core/CallGraph.cpp index f1d52737bf55..f07add3a8811 100644 --- a/bolt/lib/Core/CallGraph.cpp +++ b/bolt/lib/Core/CallGraph.cpp @@ -22,7 +22,7 @@ #undef USE_SSECRC #endif -static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64_fallback(int64_t k) { +[[maybe_unused]] static inline size_t hash_int64_fallback(int64_t k) { uint64_t key = (unsigned long long)k; // "64 bit Mix Functions", from Thomas Wang's "Integer Hash Function." // 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) { return static_cast<size_t>(static_cast<uint32_t>(key)); } -static LLVM_ATTRIBUTE_UNUSED inline size_t hash_int64(int64_t k) { +[[maybe_unused]] static inline size_t hash_int64(int64_t k) { #if defined(USE_SSECRC) && defined(__SSE4_2__) size_t h = 0; __asm("crc32q %1, %0\n" : "+r"(h) : "rm"(k)); diff --git a/bolt/lib/Core/DebugData.cpp b/bolt/lib/Core/DebugData.cpp index 24a4c852e9d7..2687788167a8 100644 --- a/bolt/lib/Core/DebugData.cpp +++ b/bolt/lib/Core/DebugData.cpp @@ -101,7 +101,7 @@ std::optional<AttrInfo> findAttributeInfo(const DWARFDie DIE, return findAttributeInfo(DIE, AbbrevDecl, *Index); } -LLVM_ATTRIBUTE_UNUSED +[[maybe_unused]] static void printLE64(const std::string &S) { for (uint32_t I = 0, Size = S.size(); I < Size; ++I) { errs() << Twine::utohexstr(S[I]); diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp index a7a4b664693f..5e3fa931e826 100644 --- a/bolt/lib/Rewrite/DWARFRewriter.cpp +++ b/bolt/lib/Rewrite/DWARFRewriter.cpp @@ -69,7 +69,7 @@ static void printDie(const DWARFDie &DIE) { } /// Lazily parse DWARF DIE and print it out. -LLVM_ATTRIBUTE_UNUSED +[[maybe_unused]] static void printDie(DWARFUnit &DU, uint64_t DIEOffset) { uint64_t OriginalOffsets = DIEOffset; uint64_t NextCUOffset = DU.getNextUnitOffset(); |
