[PATCH] D134250: [ObjectYAML] Support chained fixups, dyld exports trie, data in code
Chris Bieneman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 23 07:25:51 PDT 2022
beanz added inline comments.
================
Comment at: llvm/tools/obj2yaml/macho2yaml.cpp:673
+ MachO::data_in_code_entry DICE = Obj.getDataInCodeTableEntry(DIC.dataoff, Idx);
+ uint8_t *Bytes = static_cast<uint8_t *>(static_cast<void *>(&DICE));
+ for (size_t Jdx = 0; Jdx < sizeof(MachO::data_in_code_entry); Jdx++) {
----------------
Higuoxing wrote:
> beanz wrote:
> > Higuoxing wrote:
> > > Why not using `reinterpret_case<>` here?
> > `void*` to `uint8_t*` doesn’t need a `reinterpret_cast` so it is better to use a `static_cast`.
> Yes, I mean why not just
>
> ```
> uint8_t *Bytes = reinterpret_cast<uint8_t *>(&DICE);
> ```
Ah, I see. The single reinterpret_cast is probably clearer here. Sorry for the noise.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134250/new/
https://reviews.llvm.org/D134250
More information about the llvm-commits
mailing list