[PATCH] D121434: [clang-format][NFC] Group QualifierAlignment with other C++ passes
Owen Pan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 10 18:29:07 PST 2022
owenpan created this revision.
owenpan added reviewers: MyDeveloperDay, curdeius, HazardyKnusperkeks.
owenpan added a project: clang-format.
Herald added a project: All.
owenpan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Also increases the initial size of Passes to 8.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121434
Files:
clang/lib/Format/Format.cpp
Index: clang/lib/Format/Format.cpp
===================================================================
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -3169,18 +3169,18 @@
typedef std::function<std::pair<tooling::Replacements, unsigned>(
const Environment &)>
AnalyzerPass;
- SmallVector<AnalyzerPass, 4> Passes;
-
- if (Style.isCpp() && Style.QualifierAlignment != FormatStyle::QAS_Leave) {
- Passes.emplace_back([&](const Environment &Env) {
- return QualifierAlignmentFixer(Env, Expanded, Code, Ranges,
- FirstStartColumn, NextStartColumn,
- LastStartColumn, FileName)
- .process();
- });
- }
+ SmallVector<AnalyzerPass, 8> Passes;
if (Style.isCpp()) {
+ if (Style.QualifierAlignment != FormatStyle::QAS_Leave) {
+ Passes.emplace_back([&](const Environment &Env) {
+ return QualifierAlignmentFixer(Env, Expanded, Code, Ranges,
+ FirstStartColumn, NextStartColumn,
+ LastStartColumn, FileName)
+ .process();
+ });
+ }
+
if (Style.InsertBraces)
Passes.emplace_back([&](const Environment &Env) {
return BracesInserter(Env, Expanded).process();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121434.414549.patch
Type: text/x-patch
Size: 1312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220311/c7796aec/attachment.bin>
More information about the cfe-commits
mailing list