[PATCH] D13990: These are the matching changes needed to the lld project for the changes to llvm that changed the Archive and Child interfaces in libObject.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 22 12:09:51 PDT 2015
ruiu added inline comments.
================
Comment at: COFF/DriverUtils.cpp:525-528
@@ +524,6 @@
+ for (auto &ChildOrErr : Archive.children()) {
+ if (std::error_code EC = ChildOrErr.getError()) {
+ error(EC, "Archive::Child::getName failed");
+ break;
+ }
+ const object::Archive::Child C(*ChildOrErr);
----------------
error() does not return, so you can just do like this
error(ChildOrErr.getError(), "Archive::Child::getName failed");
================
Comment at: COFF/InputFiles.cpp:71-74
@@ +70,6 @@
+ for (auto &ChildOrErr : File->children()) {
+ if (std::error_code EC = ChildOrErr.getError()) {
+ error(EC, "Failed to parse static library");
+ break;
+ }
+ const Archive::Child &Child = *ChildOrErr;
----------------
Ditto
================
Comment at: COFF/InputFiles.cpp:83-88
@@ -76,6 +82,8 @@
MemoryBufferRef ArchiveFile::getMember(const Archive::Symbol *Sym) {
auto ItOrErr = Sym->getMember();
error(ItOrErr,
Twine("Could not get the member for symbol ") + Sym->getName());
Archive::child_iterator It = *ItOrErr;
+ if (std::error_code EC = It->getError())
+ error(EC, Twine("Could not get the member for symbol ") + Sym->getName());
----------------
This looks odd. Why do you have to check for errors twice?
http://reviews.llvm.org/D13990
More information about the llvm-commits
mailing list