This is an archive of the discontinued LLVM Phabricator instance.

[StripDeadDebugInfo] Drop dead CUs entirely
ClosedPublic

Authored by loladiro on Apr 5 2017, 12:11 PM.

Details

Summary

Prior to this while it would delete the dead DIGlobalVariables, it would
leave dead DICompileUnits and everything referenced therefrom. For a bit
bitcode file with thousands of compile units those dead nodes easily
outnumbered the real ones. Clean that up.

Diff Detail

Repository
rL LLVM

Event Timeline

loladiro created this revision.Apr 5 2017, 12:11 PM
aprantl accepted this revision.Apr 5 2017, 3:29 PM

Can you add a CU that only has a DIGlobalVariableExpression with a DIExpression(DW_OP_constu 0, DW_OP_stack_value) to your testcase and verify that it survives?
Otherwise this LGTM.

lib/Transforms/IPO/StripSymbols.cpp
327 ↗(On Diff #94267)

. at the end :-)

353 ↗(On Diff #94267)

remove extra parens?

373 ↗(On Diff #94267)

It might be faster to just call clearOperands() instead of deleting the entire node?

This revision is now accepted and ready to land.Apr 5 2017, 3:29 PM
This revision was automatically updated to reflect the committed changes.