Page MenuHomePhabricator

Switch to using -debug-info-kind=constructor as default (from =limited)

Authored by akhuang on Apr 29 2020, 4:36 PM.



-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.

Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.

I compared the PDB files for clang, and there are 273 class types that are defined with =limited
but not with =constructor (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.


Diff Detail

Event Timeline

akhuang created this revision.Apr 29 2020, 4:36 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 29 2020, 4:36 PM
akhuang updated this revision to Diff 276252.Tue, Jul 7, 4:08 PM

Instead of merging =constructor and =limited, change the default to use =constructor

akhuang retitled this revision from [WIP] Merge -debug-info-kind=constructor into -debug-info-kind=limited to Switch to using -debug-info-kind=constructor as default (from =limited).Tue, Jul 7, 4:32 PM
akhuang edited the summary of this revision. (Show Details)
akhuang added a reviewer: dblaikie.
dblaikie accepted this revision.Tue, Jul 7, 5:11 PM

Could you include some comparative data in the description/commit message demonstrating this generally ends up emitting all the same types for a clang build before/after (& explanations for a sample of any differences)?

This revision is now accepted and ready to land.Tue, Jul 7, 5:11 PM
akhuang edited the summary of this revision. (Show Details)Wed, Jul 8, 5:13 PM
akhuang edited the summary of this revision. (Show Details)Thu, Jul 9, 10:37 AM
akhuang updated this revision to Diff 276778.Thu, Jul 9, 10:38 AM

fix one more test case

This revision was automatically updated to reflect the committed changes.
MaskRay added a subscriber: MaskRay.Thu, Jul 9, 4:12 PM

Hi, your git commit contains extra Phabricator tags. You can drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -

Reviewed By: is considered important by some people. Please keep the tag. (--date=now is my personal preference (author dates are usually not useful. Using committer dates can make log almost monotonic in time))

llvm/utils/git/ can validate the message does not include unneeded tags.