Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lld/COFF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,11 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
const Archive::Symbol &sym,
StringRef parentName) {

auto reportBufferError = [=](Error &&e, StringRef childName) {
auto reportBufferError = [=](Error &&e) {
StringRef childName =
CHECK(c.getName(),
"could not get child name for archive " + parentName +
" while loading symbol " + toCOFFString(ctx, sym));
Fatal(ctx) << "could not get the buffer for the member defining symbol "
<< &sym << ": " << parentName << "(" << childName
<< "): " << std::move(e);
Expand All @@ -414,7 +418,7 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
uint64_t offsetInArchive = c.getChildOffset();
Expected<MemoryBufferRef> mbOrErr = c.getMemoryBufferRef();
if (!mbOrErr)
reportBufferError(mbOrErr.takeError(), check(c.getFullName()));
reportBufferError(mbOrErr.takeError());
MemoryBufferRef mb = mbOrErr.get();
enqueueTask([=]() {
llvm::TimeTraceScope timeScope("Archive: ", mb.getBufferIdentifier());
Expand All @@ -433,7 +437,7 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
enqueueTask([=]() {
auto mbOrErr = future->get();
if (mbOrErr.second)
reportBufferError(errorCodeToError(mbOrErr.second), childName);
reportBufferError(errorCodeToError(mbOrErr.second));
llvm::TimeTraceScope timeScope("Archive: ",
mbOrErr.first->getBufferIdentifier());
ctx.driver.addThinArchiveBuffer(takeBuffer(std::move(mbOrErr.first)),
Expand Down
Loading