[PATCH] D43663: [NFC] Move CommentOpts checks to the call sites that depend on it.

David L. Jones via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 17:31:42 PST 2018


dlj created this revision.
dlj added a reviewer: rsmith.
Herald added a subscriber: sanjoy.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D43663

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43663.135573.patch
Type: text/x-patch
Size: 8417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180223/7435d62f/attachment-0001.bin>


More information about the cfe-commits mailing list