aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2023-07-27 16:55:26 -0700
committerTobias Hieta <tobias@hieta.se>2023-07-29 08:40:14 +0200
commit90321b4ed22607dd6977e774dac96bbe51c5e872 (patch)
treedf5b4f4456339471f4a01bec868af9b0a18e1e7d
parent8ea504be360bb991918df47ee245912f61fc9a38 (diff)
downloadllvm-90321b4ed22607dd6977e774dac96bbe51c5e872.zip
llvm-90321b4ed22607dd6977e774dac96bbe51c5e872.tar.gz
llvm-90321b4ed22607dd6977e774dac96bbe51c5e872.tar.bz2
[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)
-rw-r--r--libunwind/src/Unwind-EHABI.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libunwind/src/Unwind-EHABI.cpp b/libunwind/src/Unwind-EHABI.cpp
index f387c5d..05475c6 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: