This is an archive of the discontinued LLVM Phabricator instance.

DebugInfo: Emit "LocalToUnit" flag on local member function decls.
ClosedPublic

Authored by jyknight on Feb 4 2021, 8:16 AM.

Details

Summary

Previously, the definition was so-marked, but the declaration was
not. This resulted in LLVM's dwarf emission treating the function as
being external, and incorrectly emitting DW_AT_external.

Diff Detail

Event Timeline

jyknight created this revision.Feb 4 2021, 8:16 AM
jyknight requested review of this revision.Feb 4 2021, 8:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2021, 8:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dblaikie accepted this revision.Feb 6 2021, 2:31 PM

Sounds good. Out of curiosity, how'd you come across this/do you have any particular use case that uses DW_AT_external?

clang/test/CodeGenCXX/debug-info-class.cpp
27–34

Might be better to add a separate class to test this case - modifying this class may reduce coverage of existing features (the vtable homing (well, lack of homing due to ~D being virtual and inline) would no longer be tested here, since the type is internal and that'd override the other logic.

This revision is now accepted and ready to land.Feb 6 2021, 2:31 PM
This revision was landed with ongoing or failed builds.Feb 22 2021, 2:55 PM
This revision was automatically updated to reflect the committed changes.