diff options
author | David L. Jones <dlj@google.com> | 2018-03-01 22:41:53 +0000 |
---|---|---|
committer | David L. Jones <dlj@google.com> | 2018-03-01 22:41:53 +0000 |
commit | 40388bdfb96f6cae8c1dcd5ca341c9e3dd2c8d31 (patch) | |
tree | 275d0639b8e7d28f9e4033d4730d7432a68418e9 /clang/lib/Sema/Sema.cpp | |
parent | e7ca6f5456a3b5a836a39b3c99e7d1d740883805 (diff) | |
download | bcm5719-llvm-40388bdfb96f6cae8c1dcd5ca341c9e3dd2c8d31.tar.gz bcm5719-llvm-40388bdfb96f6cae8c1dcd5ca341c9e3dd2c8d31.zip |
[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
llvm-svn: 326501
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 65183b434b1..1e9e53bb133 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1463,8 +1463,7 @@ void Sema::ActOnComment(SourceRange Comment) { if (!LangOpts.RetainCommentsFromSystemHeaders && SourceMgr.isInSystemHeader(Comment.getBegin())) return; - RawComment RC(SourceMgr, Comment, false, - LangOpts.CommentOpts.ParseAllComments); + RawComment RC(SourceMgr, Comment, LangOpts.CommentOpts, false); if (RC.isAlmostTrailingComment()) { SourceRange MagicMarkerRange(Comment.getBegin(), Comment.getBegin().getLocWithOffset(3)); |