[PATCH] D96164: [lld-macho] add code signature for native arm64 macOS

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 09:31:47 PST 2021


gkm added a comment.

I could use some advice regarding import of the the Apple C (not C++) header `cs_blobs.h`:

- Some `struct` decls contain zero-length array members as offset markers. These are invalid C++, and LLD doesn't need them.
- Some `struct` decls contain flexible array members. These are invalid C++, and LLD doesn't need them.
- Some flag bit sets are specified via sequences of `#define`. LLVM prefers `enum`.
- All struct decls have `__attribute__((aligned(1)))`. LLD does not need or want these.
- Struct definition pattern is `typedef struct __TAG { ... } NAME;` C++ prefers `struct NAME { ... };`
- The linter complains about case style for struct names.

Questions:

- Should we make minimal edits to get proper compilation & semantics and leave all the other warts as-is?
- Or, should we be boldly invasive and make it conform to C++ and LLVM style, silencing the linter?
- What is best practice regarding header imports that require surgery? It seems wise to import the unaltered Apple header first via a preparatory commit (without a diff? unreviewed?), and then commit this diff with the changes to make it conform to C++ & LLVM style.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96164



More information about the llvm-commits mailing list