Skip to content

Commit

Permalink
[libunwind] Fix build with -Wunused-function
Browse files Browse the repository at this point in the history
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
  • Loading branch information
smeenai committed Jul 28, 2023
1 parent e09a1b5 commit 3da76c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libunwind/src/Unwind-EHABI.cpp
Expand Up @@ -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:
Expand Down

0 comments on commit 3da76c2

Please sign in to comment.