]> granicus.if.org Git - clang/commit
[NFC] Move CommentOpts checks to the call sites that depend on it. (Re-applying r326501.)
authorDavid L. Jones <dlj@google.com>
Fri, 2 Mar 2018 00:07:45 +0000 (00:07 +0000)
committerDavid L. Jones <dlj@google.com>
Fri, 2 Mar 2018 00:07:45 +0000 (00:07 +0000)
commit487dbaf2f1d922b8588d86c21a7bbf303eace7a1
tree1b50d767de0591dc296fab66a2e3db4e2bed6b0d
parent59621f674d1696904878358031e9d863d601b8d7
[NFC] Move CommentOpts checks to the call sites that depend on it. (Re-applying r326501.)

When parsing comments, for example, for -Wdocumentation, slightly different
behaviour occurs when -fparse-all-comments is specified. However, these
differences are subtle:

1. All comments are saved during parsing, regardless of whether they are doc
   comments or not.
2. "Maybe-doc" comments, like <, !, etc, are saved as such, instead of marking
   them as ordinary comments. The maybe-doc type of comment is never saved
   otherwise. (Warning on these is the impetus of -Wdocumentation.)
3. All comments are treated as doc comments in ASTContext, even if they are ordinary.

This change moves the logic for checking CommentOptions.ParseAllComments closer
to where it has an effect. The overall logic is unchanged, but checks of the
ParseAllComments flag are now done where the effect will be clearer.

Subscribers: cfe-commits

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326512 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
include/clang/AST/RawCommentList.h
lib/AST/ASTContext.cpp
lib/AST/RawCommentList.cpp
lib/Sema/Sema.cpp
lib/Serialization/ASTReader.cpp