HomePhabricator

[lldb] Fix dynamic_cast by no longer failing on variable without metadata

Description

[lldb] Fix dynamic_cast by no longer failing on variable without metadata

Summary:
Our IR rewriting infrastructure currently fails when it encounters a variable which has no metadata associated.
This causes dynamic_cast to fail as in this case IRForTarget considers the type info pointers ('@_ZTI...') to be
variables without associated metadata. As there are no variables for these internal variables, this is actually
not an error and dynamic_cast would work fine if we didn't throw this error.

This patch fixes this by removing this diagnostics code. In case we would actually hit a variable that has no
metadata (but is supposed to have), we still have the error in the expression log so this shouldn't make it
harder to diagnose any missing metadata errors.

This patch should fix dynamic_cast and also adds a bunch of test coverage to that language feature.

Fixes rdar://10813639

Reviewers: davide, labath

Reviewed By: labath

Subscribers: friss, labath, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D65932

Details

Committed
teemperorAug 10 2019, 3:56 AM
Reviewer
labath
Differential Revision
D65932: [lldb] Fix dynamic_cast by no longer failing on variable without metadata
Branches
Unknown
Tags
Unknown