This is an archive of the discontinued LLVM Phabricator instance.

Fix crash in EmitDeclMetadata mode
ClosedPublic

Authored by loladiro on Oct 21 2015, 2:31 PM.

Details

Summary

This fixes a bug that's easily encountered in LLDB (https://llvm.org/bugs/show_bug.cgi?id=22875). The problem here is that we mangle a name during debug info emission, but never actually emit the actual Decl, so we run into problems here. I am not entirely sure this is the right fix. The comment says something about StaticLocalDeclMap, which may be better here, but I checked and that already existed when this functionality was added, which makes me think that there is some reason it wasn't used.

Diff Detail

Repository
rL LLVM

Event Timeline

loladiro updated this revision to Diff 38049.Oct 21 2015, 2:31 PM
loladiro retitled this revision from to Fix crash in EmitDeclMetadata mode.
loladiro updated this object.
loladiro added reviewers: rjmccall, labath.
loladiro set the repository for this revision to rL LLVM.
loladiro added a subscriber: cfe-commits.
labath resigned from this revision.Oct 22 2015, 1:08 AM
labath removed a reviewer: labath.

I'll just observe this one. Someone with more knowledge of clang needs to review this.

labath added a subscriber: labath.Oct 22 2015, 1:09 AM

Can you provide insight as to why this is looking at MangledDeclNames rather than the StaticLocalDeclMap? I'd like to extend the comment with an explanation.

This revision was automatically updated to reflect the committed changes.