This is an archive of the discontinued LLVM Phabricator instance.

[lld-link] better error message when failing to open archive members
ClosedPublic

Authored by inglorion on Feb 8 2019, 1:36 PM.

Details

Summary

The message "could not get the buffer for the member defining symbol"
now also contains the name of the archive and the name of the archive
member that we tried to open.

Event Timeline

inglorion created this revision.Feb 8 2019, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2019, 1:36 PM

Before:

lld-link: error: could not get the buffer for the member defining symbol spvDiagnosticDestroy: No such file or directory

After:

lld-link: error: could not get the buffer for the member defining symbol spvDiagnosticDestroy: obj/third_party/SPIRV-Tools/src/spvtools.lib(obj/third_party/SPIRV-Tools/src/obj/third_party/SPIRV-Tools/src/spvtools/diagnostic.obj): No such file or directory

(Following the same archive(member) format also used by toString() in InputFiles.cpp)

ruiu added inline comments.Feb 8 2019, 1:46 PM
lld/COFF/Driver.cpp
228–230

I wouldn't pass SymName and ParentName and just capture them using [&].

inglorion updated this revision to Diff 186039.Feb 8 2019, 1:52 PM
inglorion marked an inline comment as done.

Use [=] instead of explicitly passing StringRefs to ReportBufferError.

inglorion added inline comments.Feb 8 2019, 1:52 PM
lld/COFF/Driver.cpp
228–230
[ =] is better for StringRefs, right?
ruiu accepted this revision.Feb 8 2019, 1:56 PM

LGTM

This revision is now accepted and ready to land.Feb 8 2019, 1:56 PM
This revision was automatically updated to reflect the committed changes.