[PATCH] D156496: [libunwind] Fix build with -Wunused-function

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 16:57:48 PDT 2023


smeenai created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
smeenai requested review of this revision.
Herald added projects: LLVM, libunwind.
Herald added subscribers: libcxx-commits, llvm-commits.
Herald added a reviewer: libunwind.

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. Only define that function when assertions are
enabled to avoid the warning.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156496

Files:
  libunwind/src/Unwind-EHABI.cpp


Index: libunwind/src/Unwind-EHABI.cpp
===================================================================
--- libunwind/src/Unwind-EHABI.cpp
+++ libunwind/src/Unwind-EHABI.cpp
@@ -885,8 +885,10 @@
   return result;
 }
 
+#ifndef NDEBUG
+// Only used in _LIBUNWIND_TRACE_API
 static uint64_t ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation,
-                                  void* valuep) {
+                                  const void* valuep) {
   uint64_t value = 0;
   switch (representation) {
     case _UVRSD_UINT32:
@@ -902,6 +904,7 @@
   }
   return value;
 }
+#endif
 
 _LIBUNWIND_EXPORT _Unwind_VRS_Result
 _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156496.544980.patch
Type: text/x-patch
Size: 708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230727/e8e3e801/attachment.bin>


More information about the llvm-commits mailing list