[PATCH] D37695: [clang-format] Break non-trailing comments, try 2

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 11 08:22:19 PDT 2017


krasimir created this revision.
Herald added a subscriber: klimek.

This patch enables `BreakableToken` to manage the formatting of non-trailing
block comments. It is a refinement of https://reviews.llvm.org/D37007.
We discovered that the optimizer outsmarts us on cases where breaking the comment
costs considerably less than breaking after the comment. This patch addresses
this by ensuring that a newline is inserted between a block comment and the next
token.


https://reviews.llvm.org/D37695

Files:
  lib/Format/BreakableToken.cpp
  lib/Format/BreakableToken.h
  lib/Format/ContinuationIndenter.cpp
  lib/Format/ContinuationIndenter.h
  unittests/Format/FormatTestComments.cpp
  unittests/Format/FormatTestJS.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37695.114614.patch
Type: text/x-patch
Size: 8651 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170911/1510100e/attachment.bin>


More information about the cfe-commits mailing list