[PATCH] D98837: [lld][MachO] Refactor handling of subsections
Alexander Shaposhnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 31 14:21:06 PDT 2021
alexshap added inline comments.
================
Comment at: lld/MachO/Driver.cpp:1054-1059
for (const InputFile *file : inputFiles) {
- for (const SubsectionMap &map : file->subsections) {
- for (const auto &p : map) {
- InputSection *isec = p.second;
- inputSections.push_back(isec);
- }
+ for (const SubsectionMapping &map : file->subsections) {
+ for (const SubsectionEntry &subsectionEntry : map)
+ inputSections.push_back(subsectionEntry.isec);
}
}
----------------
gkm wrote:
> Nit: only the outer set of braces are necessary according to https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
> ```
> // Use braces on the outer block because there are more than two levels of nesting.
> if (isa<FunctionDecl>(D)) {
> for (auto *A : D.attrs())
> for (ssize_t i : llvm::seq<ssize_t>(count))
> handleAttrOnDecl(D, A, i);
> }
> ```
>
thanks, I'll address it before committing
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98837/new/
https://reviews.llvm.org/D98837
More information about the llvm-commits
mailing list