Page MenuHomePhabricator

[clang][ASTContext] Call setAttached for comments attached to a declaration

Authored by jkorous on May 3 2019, 2:23 PM.



I believe this is a bug affecting performance when compiling with -Wdocumentation.
In Sema::ActOnDocumentable we're checking whether there are any comments unattached to declaration at the end of comment list whenever we encounter new documentable declaration.
Since this property of RawComment was never set we were trying to find comments every time and that involves at least a couple expensive SourceLocation decompositions.

Diff Detail


Event Timeline

jkorous created this revision.May 3 2019, 2:23 PM
gribozavr accepted this revision.May 6 2019, 2:41 AM

Good catch!

258 ↗(On Diff #198089)

(*Comment)->setAttached(); (for consistency with the rest of the code).

300 ↗(On Diff #198089)

(*Comment)->setAttached(); (for consistency with the rest of the code).

This revision is now accepted and ready to land.May 6 2019, 2:41 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2019, 10:52 AM