This is an archive of the discontinued LLVM Phabricator instance.

Add a verifier check that rejects non-distinct DISubprogram function attachments.
ClosedPublic

Authored by aprantl on Sep 24 2020, 5:06 PM.

Details

Reviewers
vsk
shafik
Summary

Add a verifier check that rejects non-distinct DISubprogram function attachments. They would crash the backend, which expects all DISubprograms that are not part of the type system to have a unit field.

Clang right before https://reviews.llvm.org/D79967 would generate this kind of broken IR.

rdar://problem/69534688

Diff Detail

Event Timeline

aprantl created this revision.Sep 24 2020, 5:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2020, 5:06 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
aprantl requested review of this revision.Sep 24 2020, 5:06 PM
vsk accepted this revision.Sep 24 2020, 5:11 PM

Thanks, lgtm! s/unique/non-unique/ in the summary?

llvm/lib/IR/Verifier.cpp
2396

I see we're checking this for declarations already :).

This revision is now accepted and ready to land.Sep 24 2020, 5:11 PM
aprantl retitled this revision from Add a verifier check that rejects unique DISubprogram function attachments. to Add a verifier check that rejects non-distinct DISubprogram function attachments..Sep 24 2020, 5:12 PM
aprantl edited the summary of this revision. (Show Details)
shafik accepted this revision.Sep 24 2020, 5:54 PM

LGTM

aprantl closed this revision.Sep 25 2020, 8:21 AM

landed as 69534688 (forgot the attribution in the commit message).