]> granicus.if.org Git - clang/commit
[NFC] Move CommentOpts checks to the call sites that depend on it.
authorDavid L. Jones <dlj@google.com>
Thu, 1 Mar 2018 22:41:53 +0000 (22:41 +0000)
committerDavid L. Jones <dlj@google.com>
Thu, 1 Mar 2018 22:41:53 +0000 (22:41 +0000)
commitcee2c25d2e7d56f2b15cdde76b2a15465da93766
tree9c8ac6782d4c71001cedc8ce3119a9afc36e7671
parent549e9c4598a0e7a27e6bce0514e2f3d089dc2217
[NFC] Move CommentOpts checks to the call sites that depend on it.

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.

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326501 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