| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
AnnotatedLine has a tree structure, and things like the body of a lambda will be
a child of the lambda expression. For example,
[&]() { foo(a); };
will have an AnnotatedLine with a child:
[&]() {};
'- foo(a);
Currently, when the `Cleaner` class analyzes the affected lines, it does not
cleanup the lines' children nodes, which results in missed cleanup
opportunities, like the lambda body in the example above.
This revision extends the algorithm to visit children, thereby fixing the above problem.
Patch by Eric Li.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67659
llvm-svn: 372129
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Regrouping #includes in blocks separated by blank lines when sorting C++ #include
headers was implemented recently, and it has been preferred in Google's C++ style guide:
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
Reviewers: sammccall, klimek
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60116
llvm-svn: 357567
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Also pull #include related style out of FormatStyle as tooling::IncludeStyle.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: klimek, mgorny, cfe-commits, djasper
Differential Revision: https://reviews.llvm.org/D46496
llvm-svn: 332287
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The class will be moved into libToolingCore as followup.
The new behaviors in this patch:
- New #include is inserted in the right position in a #include block to
preserver sorted #includes. This is best effort - only works when the
block is already sorted.
- When inserting multiple #includes to the end of a file which doesn't
end with a "\n" character, a "\n" will be prepended to each #include.
This is a special and rare case that was previously handled. This is now
relaxed to avoid complexity as it's rare in practice.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: klimek, cfe-commits, djasper
Differential Revision: https://reviews.llvm.org/D46180
llvm-svn: 331544
|
|
|
|
|
|
| |
By luz.paz
llvm-svn: 324342
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In JavaScript, duplicated commas have semantic meaning.
x = [a,,b];
The statement above creates an array with three entries, the middle being undefined. Because clang-format should not change semantics, disable this cleanup in JS.
Reviewers: djasper
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D33641
llvm-svn: 304141
|
|
|
|
| |
llvm-svn: 300982
|
|
|
|
| |
llvm-svn: 290093
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D27615
llvm-svn: 289203
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the file.
Summary:
This avoid inserting #include into:
- raw string literals containing #include.
- #if block.
- Special #include among declarations (e.g. functions).
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D26909
llvm-svn: 288493
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Remove colon and commas after replacing constructor body with = default.
Fix annotation of TT_CtorInitializerColon when preceded by a comment.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D25768
llvm-svn: 284732
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Patch by Sam McCall!
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D25162
llvm-svn: 283332
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
end of the code which does not end with newline.
Summary:
append newline after code when inserting new headers at the end of the
code which does not end with newline.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D21026
llvm-svn: 283330
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
- If a replacement has offset UINT_MAX, length 0, and a replacement text
that is an #include directive, this will insert the #include into the
correct block in the \p Code.
- If a replacement has offset UINT_MAX, length 1, and a replacement text
that is the name of the header to be removed, the header will be removed
from \p Code if it exists.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24829
llvm-svn: 282253
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24501
llvm-svn: 281344
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24400
llvm-svn: 281064
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
control how replacements for a single file are combined and provide guarantee
on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
Use std::map<std::string, tooling::Replacements> to represent multi-file
replacements.
- Error handling for the interface change will be improved in followup patches.
Reviewers: djasper, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D21748
llvm-svn: 277335
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
empty string to indicate potential error.
Summary:
return llvm::Expected<> to carry error status and error information.
This is the first step towards introducing "Error" into tooling::Replacements.
Reviewers: djasper, klimek
Subscribers: ioeric, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21601
llvm-svn: 275062
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: do not add existing includes.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21323
llvm-svn: 272669
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: make header guard identification stricter with Lexer.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20959
llvm-svn: 271883
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inserting new headers.
Summary:
[clang-format] skip empty lines and comments in the top of the code when inserting new headers.
Pair-programmed with @hokein
Reviewers: djasper
Subscribers: ioeric, cfe-commits, hokein, klimek
Differential Revision: http://reviews.llvm.org/D20898
llvm-svn: 271664
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replacement with cleanupAroundReplacements().
Summary:
When a replacement's offset is set to UINT_MAX or -1U, it is treated as
a header insertion replacement by cleanupAroundReplacements(). The new #include
directive is then inserted into the correct block.
Reviewers: klimek, djasper
Subscribers: klimek, cfe-commits, bkramer
Differential Revision: http://reviews.llvm.org/D20734
llvm-svn: 271276
|
|
|
|
|
|
| |
FormatTest.cpp to CleanUpTest.cpp.
llvm-svn: 270971
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
colon in constructor initializer.
Summary: Make clang-format cleaner remove redundant commas/colons in constructor initializer list.
Reviewers: klimek, djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19804
llvm-svn: 269888
|
|
redundant code.
Summary:
After applying replacements, redundant code like extra commas or empty namespaces
might be introduced. Fixer can detect and remove any redundant code introduced by replacements.
The current implementation only handles redundant commas.
Reviewers: djasper, klimek
Subscribers: ioeric, mprobst, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D18551
llvm-svn: 267416
|