[PATCH] D113215: [llvm-libtool-darwin] Clean up names
Roger Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 4 14:40:58 PDT 2021
Roger created this revision.
Roger added a reviewer: jhenderson.
Roger requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Removing unclear abbreviations.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113215
Files:
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
Index: llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
===================================================================
--- llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@ -259,29 +259,30 @@
: Members(MembersArg), FileName(FileNameArg), C(CArg) {}
Error operator()(std::vector<std::unique_ptr<MemoryBuffer>> &FileBuffers) {
- Expected<NewArchiveMember> NMOrErr =
+ Expected<NewArchiveMember> NewMemberOrErr =
NewArchiveMember::getFile(FileName, C.Deterministic);
- if (!NMOrErr)
- return createFileError(FileName, NMOrErr.takeError());
+ if (!NewMemberOrErr)
+ return createFileError(FileName, NewMemberOrErr.takeError());
+ auto& NewMember = *NewMemberOrErr;
// For regular archives, use the basename of the object path for the member
// name.
- NMOrErr->MemberName = sys::path::filename(NMOrErr->MemberName);
- file_magic Magic = identify_magic(NMOrErr->Buf->getBuffer());
+ NewMember.MemberName = sys::path::filename(NewMember.MemberName);
+ file_magic Magic = identify_magic(NewMember.Buf->getBuffer());
// Flatten archives.
if (Magic == file_magic::archive)
- return addArchiveMembers(FileBuffers, std::move(*NMOrErr));
+ return addArchiveMembers(FileBuffers, std::move(NewMember));
// Flatten universal files.
if (Magic == file_magic::macho_universal_binary)
- return addUniversalMembers(FileBuffers, std::move(*NMOrErr));
+ return addUniversalMembers(FileBuffers, std::move(NewMember));
// Bitcode files.
if (Magic == file_magic::bitcode)
- return verifyAndAddIRObject(std::move(*NMOrErr));
+ return verifyAndAddIRObject(std::move(NewMember));
- if (Error E = verifyAndAddMachOObject(std::move(*NMOrErr)))
+ if (Error E = verifyAndAddMachOObject(std::move(NewMember)))
return E;
return Error::success();
}
@@ -353,17 +354,18 @@
}
Error addChildMember(const object::Archive::Child &M) {
- Expected<NewArchiveMember> NMOrErr =
+ Expected<NewArchiveMember> NewMemberOrErr =
NewArchiveMember::getOldMember(M, C.Deterministic);
- if (!NMOrErr)
- return NMOrErr.takeError();
+ if (!NewMemberOrErr)
+ return NewMemberOrErr.takeError();
+ auto& NewMember = *NewMemberOrErr;
- file_magic Magic = identify_magic(NMOrErr->Buf->getBuffer());
+ file_magic Magic = identify_magic(NewMember.Buf->getBuffer());
if (Magic == file_magic::bitcode)
- return verifyAndAddIRObject(std::move(*NMOrErr));
+ return verifyAndAddIRObject(std::move(NewMember));
- if (Error E = verifyAndAddMachOObject(std::move(*NMOrErr)))
+ if (Error E = verifyAndAddMachOObject(std::move(NewMember)))
return E;
return Error::success();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113215.384867.patch
Type: text/x-patch
Size: 2828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/e412be16/attachment.bin>
More information about the llvm-commits
mailing list