This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][dsymutil] Keep locations for function-local globals
ClosedPublic

Authored by ellis on Dec 10 2021, 5:24 PM.

Details

Summary

In debug info, we expect variables to have location info if they are used and we don't want location info for functions that are not used. However, if an unused function is inlined, we could have the scenario where a function is not in the final binary but its static variable is in the final binary. Ensure that variables in the final binary have location debug info even if their scope was inlined.

Also add --implicit-check-not to a test for clarity.

Diff Detail

Event Timeline

ellis created this revision.Dec 10 2021, 5:24 PM
ellis updated this revision to Diff 393640.Dec 10 2021, 5:40 PM

Fix test

ellis updated this revision to Diff 393643.Dec 10 2021, 5:54 PM

Change comment.

kyulee added a subscriber: kyulee.Dec 10 2021, 6:04 PM
ellis updated this revision to Diff 393650.Dec 10 2021, 6:58 PM

Add entry to debug map.

ellis updated this revision to Diff 393654.Dec 10 2021, 7:17 PM

Add comments to test.

ellis published this revision for review.Dec 10 2021, 7:23 PM
ellis edited the summary of this revision. (Show Details)
ellis added a reviewer: dblaikie.
ellis added a project: debug-info.
ellis added reviewers: clayborg, kyulee.
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2021, 7:25 PM
JDevlieghere accepted this revision.Dec 13 2021, 9:26 PM

Small readability nit, but otherwise this LGTM.

llvm/lib/DWARFLinker/DWARFLinker.cpp
1426–1432

Just for symmetry with the clause above, I would structure this slightly differently.

This revision is now accepted and ready to land.Dec 13 2021, 9:26 PM
ellis updated this revision to Diff 394140.Dec 13 2021, 10:29 PM

Restructure logic.

This revision was landed with ongoing or failed builds.Dec 14 2021, 9:28 AM
This revision was automatically updated to reflect the committed changes.