This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cov] Improve error message by printing the object file name that produces error
ClosedPublic

Authored by zequanwu on Jul 20 2022, 12:31 PM.

Details

Summary

If error occurs on constructing coverage info for one of the object files, it prints the name of the object file, so that users know which one is the cause of error.

Diff Detail

Event Timeline

zequanwu created this revision.Jul 20 2022, 12:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2022, 12:31 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
zequanwu requested review of this revision.Jul 20 2022, 12:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2022, 12:31 PM
zequanwu edited the summary of this revision. (Show Details)Jul 20 2022, 12:33 PM
thakis added a subscriber: thakis.Jul 21 2022, 6:09 AM
thakis added inline comments.
llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
606 ↗(On Diff #446237)

Is the signature change needed? llvm::createFileError() creates a FileError, which should fit into an Expected. Maybe we just need to call that in the place that creates the error?

zequanwu updated this revision to Diff 446571.Jul 21 2022, 10:37 AM
zequanwu marked an inline comment as done.

Use llvm::createFileError

llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
606 ↗(On Diff #446237)

Thanks, I didn't know this before.

This revision is now accepted and ready to land.Jul 21 2022, 11:18 AM
This revision was landed with ongoing or failed builds.Jul 21 2022, 11:27 AM
This revision was automatically updated to reflect the committed changes.