[libunwind] 3da76c2 - [libunwind] Fix build with -Wunused-function

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 27 20:23:13 PDT 2023


Author: Shoaib Meenai
Date: 2023-07-27T20:22:16-07:00
New Revision: 3da76c2116179fdb3fff8feb4551209e4218746e

URL: https://github.com/llvm/llvm-project/commit/3da76c2116179fdb3fff8feb4551209e4218746e
DIFF: https://github.com/llvm/llvm-project/commit/3da76c2116179fdb3fff8feb4551209e4218746e.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

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 cfe-commits mailing list