[PATCH] D105866: [lld-macho] Use intermediate arrays to store opcodes

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 16:09:39 PDT 2021


int3 added inline comments.


================
Comment at: lld/MachO/SyntheticSections.cpp:281-282
+struct BindIR {
+  uint8_t opcode = 0xF0;
+  uint64_t data = 0;
+};
----------------
thevinster wrote:
> int3 wrote:
> > do we need these default values?
> Probably not, since we always construct these values explicitly. But, the reason for having it as default is 1/ follow the convention of `Binding` struct and 2/ in the event that something goes awry, `0xF0` is not valid opcode and should make the program scream instead of accidentally writing "valid" values. 
> 
> Plus, I think it'll debugging easier if we see these specific values when debugging.
> 0xF0 is not valid opcode and should make the program scream instead of accidentally writing "valid" values.

Can you add that as a comment? Otherwise it looks a bit like a magic number :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105866



More information about the llvm-commits mailing list