This is an archive of the discontinued LLVM Phabricator instance.

These are the matching changes needed to the lld project for the changes to llvm that changed the Archive and Child interfaces in libObject.
ClosedPublic

Authored by enderby on Oct 22 2015, 11:55 AM.

Details

Reviewers
ruiu
rafael
Summary

Lang Hames has given the “looks good to me” for these lld changes. But Rafael and Rui should OK these too.

Diff Detail

Event Timeline

enderby updated this revision to Diff 38154.Oct 22 2015, 11:55 AM
enderby retitled this revision from to These are the matching changes needed to the lld project for the changes to llvm that changed the Archive and Child interfaces in libObject..
enderby updated this object.
enderby added reviewers: rafael, ruiu.
enderby added subscribers: llvm-commits, lhames.
ruiu added inline comments.Oct 22 2015, 12:09 PM
COFF/DriverUtils.cpp
525–528

error() does not return, so you can just do like this

error(ChildOrErr.getError(), "Archive::Child::getName failed");
COFF/InputFiles.cpp
71–74

Ditto

79–83

This looks odd. Why do you have to check for errors twice?

enderby updated this revision to Diff 38174.Oct 22 2015, 2:15 PM

Addressed Rui's comments with the updated diff.

ruiu accepted this revision.Oct 22 2015, 2:19 PM
ruiu edited edge metadata.

LGTM with a few nits.

COFF/DriverUtils.cpp
525

error's first parameter can be ErrorOr<T>, so it can be

error(ChildOrErr, "Archive::Child::getName failed");

I'm sorry that I didn't mention this in the previous review.

COFF/InputFiles.cpp
71

Ditto

ELF/InputFiles.cpp
315

Remove break.

This revision is now accepted and ready to land.Oct 22 2015, 2:19 PM
enderby updated this revision to Diff 38177.Oct 22 2015, 2:31 PM
enderby edited edge metadata.

Updated the few nits that Rui pointed out. Also cleaned up further the code in
ArchiveFile::getMembers() on line 75 of ELF/InputFiles.cpp to use the same
error() like call to and replace the “if and break”. Thanks Rui!

rafael added inline comments.Oct 24 2015, 5:27 PM
COFF/DriverUtils.cpp
524–526

can it be "const auto &"

ELF/InputFiles.cpp
295

You can write this as

ErrorOr<Child> &ChildOrErr = *It;
erorr(ChildOrErr, ...)

no?

enderby updated this revision to Diff 38450.Oct 26 2015, 12:49 PM

Addressed Rafael's comments with the updated diff.

enderby updated this revision to Diff 39390.Nov 5 2015, 11:21 AM

This final patch includes many suggested updates from Rafael Espindola emails. Rafael's last email contained:

On Nov 5, 2015, at 6:48 AM, Rafael Espíndola <rafael.espindola@gmail.com> wrote:

LGTM with the "exit with 0 on error" issues fixed.

enderby closed this revision.Nov 5 2015, 11:30 AM

Closed with commit r252193