[clang][ASTContext] Call setAttached for comments attached to a declaration
authorJan Korous <jkorous@apple.com>
Mon, 13 May 2019 17:52:09 +0000 (17:52 +0000)
committerJan Korous <jkorous@apple.com>
Mon, 13 May 2019 17:52:09 +0000 (17:52 +0000)
commit31f09da997ff53574df752319dcd14b935677148
tree680e8723fa91a879017578a8b1ec2b890475e695
parent24e6d2a7b6f041a6df9e61cf9cecfc15c1f7ccac
[clang][ASTContext] Call setAttached for comments attached to a declaration

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.

Differential Revision: https://reviews.llvm.org/D61538

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360607 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTContext.cpp