[llvm] 19ea625 - [llvm-objdump/mac] Silence XAR deprecation warning (NFC)

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 20:24:53 PST 2022


Author: Keith Smiley
Date: 2022-02-09T20:12:43-08:00
New Revision: 19ea62591095d06d4c639eed8b277e6e3e62bf9c

URL: https://github.com/llvm/llvm-project/commit/19ea62591095d06d4c639eed8b277e6e3e62bf9c
DIFF: https://github.com/llvm/llvm-project/commit/19ea62591095d06d4c639eed8b277e6e3e62bf9c.diff

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

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.

Differential Revision: https://reviews.llvm.org/D118569

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 31867625f0e5e..c785c6cfaa89a 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -188,8 +188,12 @@ typedef DiceTable::iterator dice_table_iterator;
 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);


        


More information about the llvm-commits mailing list