[PATCH] D135359: [lld-macho][nfc] define command UNWIND_MODE_MASK for convenience and rewrite mode-mask checking logic for clarity

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 10:40:37 PDT 2022


int3 accepted this revision.
int3 added a comment.
This revision is now accepted and ready to land.

> The previous form is currently "harmless" and happened to work (because there's no 0x05000000 in the enum set, but as soon as it's defined, it'll stop working)

I guess we can remove this now? Or if you want to be more precise, I think it happens to work because we don't usually get values like `0x04111111` in the input, so there's usually nothing to mask out



================
Comment at: lld/MachO/InputFiles.cpp:76-77
 
+#include "mach-o/compact_unwind_encoding.h"
+
 #include <type_traits>
----------------
don't think this is needed any more


================
Comment at: lld/MachO/InputFiles.cpp:1074-1077
+  static_assert(static_cast<uint32_t>(UNWIND_X86_64_MODE_MASK) ==
+                    static_cast<uint32_t>(UNWIND_X86_MODE_MASK) &&
+                static_cast<uint32_t>(UNWIND_ARM64_MODE_MASK) ==
+                    static_cast<uint32_t>(UNWIND_X86_64_MODE_MASK));
----------------
we can rm this now that we're doing it at the top level


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135359/new/

https://reviews.llvm.org/D135359



More information about the llvm-commits mailing list