[PATCH] D105089: [llvm-objcopy][MachO] Code cleanup
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 29 02:18:33 PDT 2021
jhenderson added inline comments.
================
Comment at: llvm/tools/llvm-objcopy/MachO/MachOReader.cpp:79
- Sections.push_back(
- std::make_unique<Section>(constructSection(*Curr, NextSectionIndex)));
- }
----------------
alexander-shaposhnikov wrote:
> @jhenderson this pointer dereference appears to be problematic.
> Perhaps, we should drop reinterpret_cast on line 68 completely.
Thanks. Given the change you've made, I don't think we really need to drop it. You could however move the `Curr` initialization into the for loop initialization list, if I'm not mistaken. Following your change then, there is no motivation to use `Curr` directly, I think, and moving it into the loop helps reinforce it further.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105089/new/
https://reviews.llvm.org/D105089
More information about the llvm-commits
mailing list