[PATCH] D127864: [llvm-ar] Add object mode option -X for AIX
Owen Reynolds via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 04:14:09 PDT 2022
gbreynoo added a comment.
I think my comment got eaten. Sorry for the delay @jhenderson. I've had a look, particularly at the section highlighted, and I this is the best place for this check. The best I can suggest is the use of a lambda or new function to tidy the `IA_AddNewMember` and `IA_MoveNewMember` cases. Something like:
auto handleNewMembers = [&](auto Members, auto MemberI, auto Child) {
NewArchiveMember NM = getArchiveMember(*MemberI);
if (isValidInBitMode(NM))
addMember(Members, NM);
else {
// If a new member is not a valid object for the bit mode, add the old
// member back.
warnInvalidObjectForFileMode(*MemberI);
addChildMember(Members, Child,
/*FlattenArchive=*/Thin);
}
};
So the calls sites are:
case IA_AddNewMember: {
handleNewMembers(Ret, MemberI, Child);
} break;
case IA_MoveNewMember: {
handleNewMembers(Moved, MemberI, Child);
} break;
How much clearer this is is debatable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127864/new/
https://reviews.llvm.org/D127864
More information about the llvm-commits
mailing list