This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Move CommentOpts checks to the call sites that depend on it.
ClosedPublic

Authored by dlj on Feb 22 2018, 5:31 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

dlj created this revision.Feb 22 2018, 5:31 PM
dlj edited the summary of this revision. (Show Details)Feb 22 2018, 5:33 PM
dlj edited the summary of this revision. (Show Details)
rsmith accepted this revision.Mar 1 2018, 9:58 AM
This revision is now accepted and ready to land.Mar 1 2018, 9:58 AM
This revision was automatically updated to reflect the committed changes.