llvm-project/clang
Krasimir Georgiev fe268fc1c8 [clang-format] Break non-trailing block comments
Summary:
This patch is an alternative to https://reviews.llvm.org/D36614, by resolving a
non-idempotency issue by breaking non-trailing comments:

Consider formatting the following code with column limit at `V`:
```
                    V
const /* comment comment */ A = B;
```
The comment is not a trailing comment, breaking before it doesn't bring it under
the column limit. The formatter breaks after it, resulting in:

```
                    V
const /* comment comment */
    A = B;
```
For a next reformat, the formatter considers the comment as a trailing comment,
so it is free to break it further, resulting in:

```
                    V
const /* comment
         comment */
    A = B;
```
This patch improves the situation by directly producing the third case.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 311457
2017-08-22 14:40:05 +00:00
..
INPUTS
bindings [libclang] Support for querying whether an enum is scoped 2017-07-12 11:35:11 +00:00
cmake Update libprotobuf-mutator revision 2017-08-22 05:18:28 +00:00
docs clang-format: add an option -verbose to list the files being processed 2017-08-12 15:15:10 +00:00
examples Add LLVMOption to clang-interpreter, corresponding to r291938. 2017-01-14 08:54:05 +00:00
include [clang-diff] Use the relative name for NamedDecl 2017-08-22 08:56:26 +00:00
lib [clang-format] Break non-trailing block comments 2017-08-22 14:40:05 +00:00
runtime
test Revert r311442 (Fix templated type alias completion when using global completion cache) 2017-08-22 10:54:40 +00:00
tools [clang-format] Fix lines regression in clang-format.py 2017-08-22 14:28:01 +00:00
unittests [clang-format] Break non-trailing block comments 2017-08-22 14:40:05 +00:00
utils Do not look through pack expansions when looking for unexpanded parameter packs. 2017-08-15 22:58:45 +00:00
www [c++2a] Implement P0409R2 - Allow lambda capture [=,this] (by hamzasood) 2017-08-19 03:43:07 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Integrate Kostya's clang-proto-fuzzer with LLVM. 2017-08-08 20:15:04 +00:00
CODE_OWNERS.TXT
INSTALL.txt
LICENSE.TXT
ModuleInfo.txt
NOTES.txt
README.txt Remove test commit. 2017-06-30 03:03:28 +00:00

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:              http://clang.llvm.org/
Building and using Clang:          http://clang.llvm.org/get_started.html
Clang Static Analyzer:             http://clang-analyzer.llvm.org/
Information on the LLVM project:   http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/