aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authormitchell <56368743+mitchell-stellar@users.noreply.github.com>2022-09-27 15:40:39 -0400
committermitchell <56368743+mitchell-stellar@users.noreply.github.com>2022-09-27 15:41:09 -0400
commitc0779756a0c4cc84d9f98714734d47879701cc3d (patch)
tree862b4de4dcc09b6152c7eb275581758e4963d7f0 /llvm/unittests/Support/CommandLineTest.cpp
parent670cac72804bbeb91fd0653de621aa03f70600e3 (diff)
downloadllvm-c0779756a0c4cc84d9f98714734d47879701cc3d.zip
llvm-c0779756a0c4cc84d9f98714734d47879701cc3d.tar.gz
llvm-c0779756a0c4cc84d9f98714734d47879701cc3d.tar.bz2
[clang-format] Fix alignment in #else preprocessor blocks
Summary: clang-format makes multiple passes when #if/#else preprocessor blocks are found. It will make one pass for normal code and code in the #if block, and then it will make another pass for just the code in #else blocks. This often results in invalid alignment inside the else blocks because they do not have any scope or indentAndNestingLevel context from their surrounding tokens/lines. This patch remedies that by caching any initial indentAndNestingLevel from a second pass and not breaking/returning early when a scope change is detected. Fixes #36070 Reviewers: HazardyKnusperkeks, MyDeveloperDay Tags: clang, clang-format Differential Revision: https://reviews.llvm.org/D134042
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions