[llvm-branch-commits] [libunwind] 90321b4 - [libunwind] Fix build with -Wunused-function
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jul 28 23:41:38 PDT 2023
Author: Shoaib Meenai
Date: 2023-07-29T08:40:14+02:00
New Revision: 90321b4ed22607dd6977e774dac96bbe51c5e872
URL: https://github.com/llvm/llvm-project/commit/90321b4ed22607dd6977e774dac96bbe51c5e872
DIFF: https://github.com/llvm/llvm-project/commit/90321b4ed22607dd6977e774dac96bbe51c5e872.diff
LOG: [libunwind] Fix build with -Wunused-function
https://reviews.llvm.org/D144252 removed -Wno-unused-function from the
libunwind build, but we have an unused function when you're building for
armv7 without assertions. Mark that function as possibly unused to avoid
the warning, and mark the parameter as a const pointer while I'm here to
make it clear that nothing is modified by a debugging function.
Reviewed By: #libunwind, philnik
Differential Revision: https://reviews.llvm.org/D156496
(cherry picked from commit 3da76c2116179fdb3fff8feb4551209e4218746e)
Added:
Modified:
libunwind/src/Unwind-EHABI.cpp
Removed:
################################################################################
diff --git a/libunwind/src/Unwind-EHABI.cpp b/libunwind/src/Unwind-EHABI.cpp
index f387c5d3db4e65..05475c6ac1e2fe 100644
--- a/libunwind/src/Unwind-EHABI.cpp
+++ b/libunwind/src/Unwind-EHABI.cpp
@@ -885,8 +885,11 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
return result;
}
-static uint64_t ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation,
- void* valuep) {
+// Only used in _LIBUNWIND_TRACE_API, which is a no-op when assertions are
+// disabled.
+[[gnu::unused]] static uint64_t
+ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation,
+ const void *valuep) {
uint64_t value = 0;
switch (representation) {
case _UVRSD_UINT32:
More information about the llvm-branch-commits
mailing list