This is an archive of the discontinued LLVM Phabricator instance.

[lld] Add module name to LTO inline asm diagnostic
ClosedPublic

Authored by MaskRay on Jan 27 2022, 10:52 PM.

Details

Reviewers
thakis
ychen
int3
Group Reviewers
Restricted Project
Commits
rG33b38339a096: [lld] Add module name to LTO inline asm diagnostic
Summary

Close #52781: for LTO, the inline asm diagnostic uses <inline asm> as the file
name (lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp) and it is unclear which
module has the issue.

With this patch, we will see the module name (say asm.o) before <inline asm> with ThinLTO.

% clang -flto=thin -c asm.c && myld.lld asm.o -e f
ld.lld: error: asm.o <inline asm>:1:2: invalid instruction mnemonic 'invalid'
        invalid
        ^~~~~~~

For regular LTO, unfortunately the original module name is lost and we only get
ld-temp.o.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 27 2022, 10:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 10:52 PM
MaskRay requested review of this revision.Jan 27 2022, 10:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 10:52 PM
ychen accepted this revision.Jan 28 2022, 12:00 AM

LGTM

This revision is now accepted and ready to land.Jan 28 2022, 12:00 AM
int3 accepted this revision.Jan 28 2022, 10:15 AM
int3 added a subscriber: int3.

lgtm

MaskRay updated this revision to Diff 404112.Jan 28 2022, 11:32 AM
MaskRay edited the summary of this revision. (Show Details)

rename a test from .s to .ll

This revision was landed with ongoing or failed builds.Jan 28 2022, 11:32 AM
This revision was automatically updated to reflect the committed changes.