[PATCH] D118569: [llvm-objdump/mac] Silence XAR deprecation warning (NFC)

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 30 10:07:13 PST 2022


keith created this revision.
Herald added a subscriber: rupprecht.
Herald added a reviewer: jhenderson.
Herald added a reviewer: MaskRay.
keith requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If you're building this on macOS 12.x+ this produces a deprecation
warning. I'm not sure what this means for the bitcode format going
forward, but it seems safe to silence for now.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118569

Files:
  llvm/tools/llvm-objdump/MachODump.cpp


Index: llvm/tools/llvm-objdump/MachODump.cpp
===================================================================
--- llvm/tools/llvm-objdump/MachODump.cpp
+++ llvm/tools/llvm-objdump/MachODump.cpp
@@ -188,8 +188,12 @@
 namespace {
 struct ScopedXarFile {
   xar_t xar;
-  ScopedXarFile(const char *filename, int32_t flags)
-      : xar(xar_open(filename, flags)) {}
+  ScopedXarFile(const char *filename, int32_t flags) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    xar = xar_open(filename, flags);
+#pragma clang diagnostic pop
+  }
   ~ScopedXarFile() {
     if (xar)
       xar_close(xar);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118569.404390.patch
Type: text/x-patch
Size: 647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220130/a3904d88/attachment.bin>


More information about the llvm-commits mailing list