aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/TargetParserTest.cpp
diff options
context:
space:
mode:
authorZhao Wei Liew <zhaoweiliew@gmail.com>2022-01-03 11:30:24 +0100
committerMarek Kurdej <marek.kurdej+llvm.org@gmail.com>2022-01-03 11:36:00 +0100
commit0090cd4e7a24bedeb24dfe5b3b55167ad74e231e (patch)
treed639ae82ff2496eb2f73b063c4728f9c3d2b4cc2 /llvm/unittests/Support/TargetParserTest.cpp
parent791523bae6153b13bb41ba05c9fc89e502cc4a1a (diff)
downloadllvm-0090cd4e7a24bedeb24dfe5b3b55167ad74e231e.zip
llvm-0090cd4e7a24bedeb24dfe5b3b55167ad74e231e.tar.gz
llvm-0090cd4e7a24bedeb24dfe5b3b55167ad74e231e.tar.bz2
[clang-format] Support inheriting from more than 1 parents in the fallback case
Currently, we are unable to inherit from a chain of parent configs where the outermost parent config has `BasedOnStyle: InheritParentConfig` set. This patch adds a test case for this scenario, and adds support for it. To illustrate, suppose we have the following directory structure: ``` - e/ |- .clang-format (BasedOnStyle: InheritParentConfig) <-- outermost config |- sub/ |- .clang-format (BasedOnStyle: InheritParentConfig) |- sub/ |- .clang-format (BasedOnStyle: InheritParentConfig) |- code.cpp ``` Now consider what happens when we run `clang-format --style=file /e/sub/sub/code.cpp`. Without this patch, on a release build, only the innermost config will be applied. On a debug build, clang-format crashes due to an assertion failure. With this patch, clang-format behaves as we'd expect, applying all 3 configs. Reviewed By: HazardyKnusperkeks, curdeius Differential Revision: https://reviews.llvm.org/D116371
Diffstat (limited to 'llvm/unittests/Support/TargetParserTest.cpp')
0 files changed, 0 insertions, 0 deletions