llvm-project/clang/lib
Yitzhak Mandelbaum 45b6ca5cd6 [clang-format] Fix cleanup of `AnnotatedLine` to include children nodes.
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
2019-09-17 15:10:39 +00:00
..
ARCMigrate Removed some questionable default arguments from setters 2019-09-12 12:16:43 +00:00
AST Add SpellingNotCalculated to Attribute Enums to suppress UBSan warnings 2019-09-17 14:11:51 +00:00
ASTMatchers [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Analysis [CFG] Add dumps for CFGElement and CFGElementRef 2019-09-12 19:52:34 +00:00
Basic [RISCV] Define __riscv_cmodel_medlow and __riscv_cmodel_medany correctly 2019-09-17 08:09:56 +00:00
CodeGen Add SpellingNotCalculated to Attribute Enums to suppress UBSan warnings 2019-09-17 14:11:51 +00:00
CrossTU [CrossTU] Fix problem with CrossTU AST load limit and progress messages. 2019-08-12 07:15:29 +00:00
DirectoryWatcher [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Driver [Driver] Fix multiple bugs related to dependency file options: -M -MM -MD -MMD -MT -MQ 2019-09-14 06:01:22 +00:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [clang-format] Fix cleanup of `AnnotatedLine` to include children nodes. 2019-09-17 15:10:39 +00:00
Frontend [Support] Add overload writeFileAtomically(std::function Writer) 2019-09-13 20:08:27 +00:00
FrontendTool [analyzer] Don't run the analyzer for -analyzer-list-enabled-checkers 2019-09-12 18:53:48 +00:00
Headers Fix reliance on -flax-vector-conversions in AVX intrinsics headers and 2019-09-17 03:56:30 +00:00
Index [clang][Index] Replace CodegenNameGenerator with ASTNameGenerator 2019-09-05 20:33:52 +00:00
Lex do not emit -Wunused-macros warnings in -frewrite-includes mode (PR15614) 2019-09-16 19:18:37 +00:00
Parse [OPENMP5.0]Add basic support for declare variant directive. 2019-09-13 20:18:17 +00:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema Add SpellingNotCalculated to Attribute Enums to suppress UBSan warnings 2019-09-17 14:11:51 +00:00
Serialization [OpenMP] Fix OMPClauseReader::readClause() uninitialized variable warning. NFCI. 2019-09-15 16:05:20 +00:00
StaticAnalyzer [analyzer][NFC] Fix inconsistent references to checkers as "checks" 2019-09-12 19:09:24 +00:00
Tooling [clang-scan-deps] Fix for headers having the same name as a directory 2019-09-13 22:12:02 +00:00
CMakeLists.txt Reland [clang] DirectoryWatcher 2019-07-12 20:34:10 +00:00