Skip to content

Commit 90321b4

Browse files
smeenaitru
authored andcommitted
[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 3da76c2)
1 parent 8ea504b commit 90321b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libunwind/src/Unwind-EHABI.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,11 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
885885
return result;
886886
}
887887

888-
static uint64_t ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation,
889-
void* valuep) {
888+
// Only used in _LIBUNWIND_TRACE_API, which is a no-op when assertions are
889+
// disabled.
890+
[[gnu::unused]] static uint64_t
891+
ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation,
892+
const void *valuep) {
890893
uint64_t value = 0;
891894
switch (representation) {
892895
case _UVRSD_UINT32:

0 commit comments

Comments
 (0)