History log of /llvm-project/clang/lib/Format/QualifierAlignmentFixer.cpp (Results 1 – 25 of 50)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 3bd8b02a 22-Jan-2025 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle leading C++11 attribute in QualifierAlignment (#123690)

Fixes #123573.


Revision tags: llvmorg-19.1.7
# 40acaa39 22-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a crash in `QualifierAlignment: Right` (#120821)

Fixes #120793.


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6
# 364f988d 14-May-2024 Owen Pan <owenpiano@gmail.com>

Reland "[clang-format] Fix FormatToken::isSimpleTypeSpecifier() (#91712)"

Remove FormatToken::isSimpleTypeSpecifier() and call
Token::isSimpleTypeSpecifier(LangOpts) instead.


# c72e9438 14-May-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Move LeftRightQualifierAlignmentFixer::is...() (#91930)

Move static member functions LeftRightQualifierAlignmentFixer::is...()
out of the class so that #91712 can reland.


# 1fadb2b0 13-May-2024 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format] Fix FormatToken::isSimpleTypeSpecifier() (#91712)"

This reverts commits e62ce1f8842c, 5cd280433e8e, and de641e289269 due to
buildbot failures.


# 626025ac 13-May-2024 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format] Fix buildbot failures"

This reverts commit 0869204cff22831d0bb19a82c99bf85e4deb4ae3, which caused a
buildbot failure:
https://lab.llvm.org/buildbot/#/builders/5/builds/43322


# 0869204c 11-May-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix buildbot failures

This effectively reverts 5cd280433e8e and changes to QualifierFixerTest.cpp
from e62ce1f8842c.

Failed buidbots:
https://lab.llvm.org/buildbot/#/builders/236/bui

[clang-format] Fix buildbot failures

This effectively reverts 5cd280433e8e and changes to QualifierFixerTest.cpp
from e62ce1f8842c.

Failed buidbots:
https://lab.llvm.org/buildbot/#/builders/236/builds/11223
https://lab.llvm.org/buildbot/#/builders/239/builds/6968

show more ...


# e62ce1f8 11-May-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix FormatToken::isSimpleTypeSpecifier() (#91712)

Remove FormatToken::isSimpleTypeSpecifier() and call
Token::isSimpleTypeSpecifier(LangOpts) instead.


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3
# b2082a98 20-Mar-2024 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files"

This reverts commit b92d6dd704d789240685a336ad8b25a9f381b4cc. See
github.com/llvm/llvm-project/commit/b92d6dd704d7#com

Revert "[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files"

This reverts commit b92d6dd704d789240685a336ad8b25a9f381b4cc. See
github.com/llvm/llvm-project/commit/b92d6dd704d7#commitcomment-139992444

We should use a tool like Visual Studio to clean up the headers.

show more ...


# 6f31cf51 20-Mar-2024 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format][NFC] Eliminate the IsCpp parameter in all functions (#84599)"

This reverts c3a1eb6207d8 (and the related commit f3c5278efa3b) which makes
cleanupAroundReplacements() no longer

Revert "[clang-format][NFC] Eliminate the IsCpp parameter in all functions (#84599)"

This reverts c3a1eb6207d8 (and the related commit f3c5278efa3b) which makes
cleanupAroundReplacements() no longer thread-safe.

show more ...


Revision tags: llvmorg-18.1.2
# b92d6dd7 17-Mar-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files


# c3a1eb62 15-Mar-2024 Owen Pan <owenpiano@gmail.com>

Reland [clang-format][NFC] Eliminate the IsCpp parameter in all functions (#84599)

Initialize IsCpp in LeftRightQualifierAlignmentFixer ctor.


# b0d1e32c 15-Mar-2024 Mehdi Amini <joker.eph@gmail.com>

Revert "[clang-format][NFC] Eliminate the IsCpp parameter in all functions" (#85353)

Reverts llvm/llvm-project#84599

This broke the presubmit bot.


# 0c071029 15-Mar-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Eliminate the IsCpp parameter in all functions (#84599)


# 0baef3b1 09-Mar-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle common C++ non-keyword types as such (#83709)

Fixes #83400.


Revision tags: llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3
# ea16a3bb 17-Feb-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't sort qualifiers across preprocessor directives (#81958)

Fixes #80579.


Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6
# f0ad9ea3 16-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle lambdas in QualifierAlignment (#72456)

Fixed #62780.


# b04664be 15-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle constrained auto in QualifierAlignment (#72251)

Fixed #69610.


Revision tags: llvmorg-17.0.5
# cc75e520 10-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Refactor isPointerOrReference


Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4
# 77b2fc8a 31-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Reformat and fix file mode

Fix file mode errors introduced in 2c9372e78d7c and format errors in
https://reviews.llvm.org/D155239.


# 2c9372e7 26-Aug-2023 MyDeveloperDay <mydeveloperday@gmail.com>

[clang-format] Rename qualifier file comments (#64354)

* [clang-format] rename the file comments to match the file name

* [clang-format] rename the file comments to match the file name

* Remov

[clang-format] Rename qualifier file comments (#64354)

* [clang-format] rename the file comments to match the file name

* [clang-format] rename the file comments to match the file name

* Remove extraneous space

* [clang-format] NFC remove EOF

---------

Co-authored-by: paul_hoad <paul_hoad@amat.com>

show more ...


# 91c4db00 24-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Replace !is() with isNot()

Differential Revision: https://reviews.llvm.org/D158571


Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 875b8811 11-Jul-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Remove redundant parentheses in the source code

Reformat the source code with RemoveParentheses set to ReturnStatement.


# 899c8677 03-Jul-2023 Sedenion <39583823+Sedeniono@users.noreply.github.com>

[clang-format] Fixed bad performance with enabled qualifier fixer.

This fixes github issue #57117: If the "QualifierAlignment"
option of clang-format is set to anything else but "Leave", the
"Qualif

[clang-format] Fixed bad performance with enabled qualifier fixer.

This fixes github issue #57117: If the "QualifierAlignment"
option of clang-format is set to anything else but "Leave", the
"QualifierAlignmentFixer" pass gets enabled. This pass scales
quadratically with the number of preprocessor branches, i.e.
with the number of elements in TokenAnalyzer::UnwrappedLines.
The reason is that QualifierAlignmentFixer::process() generates
the UnwrappedLines, but then QualifierAlignmentFixer::analyze()
calls LeftRightQualifierAlignmentFixer::process() several times
(once for each qualifier) which again each time generates the
UnwrappedLines.

This commit gets rid of this double loop by registering the
individual LeftRightQualifierAlignmentFixer passes directly in
the top most container of passes (local variable "Passes" in
reformat()).
With this change, the original example in the github issue #57117
now takes only around 3s instead of >300s to format.

Since QualifierAlignmentFixer::analyze() got deleted, we also
no longer have the code with the NonNoOpFixes. This causes
replacements that end up not changing anything to appear in the
list of final replacements. There is a unit test to check that
this does not happen: QualifierFixerTest.NoOpQualifierReplacements.
However, it got broken at some point in time. So this commit
fixes the test. To keep the behavior that no no-op replacements
should appear from the qualifier fixer, the corresponding code
from QualifierAlignmentFixer::analyze() was moved to the top
reformat() function. Thus, is now done for **every** replacement
of every formatting pass. If no-op replacements are a problem
for the qualifier fixer, then it seems to be a good idea to
filter them out always.

See
https://github.com/llvm/llvm-project/issues/57117#issuecomment-1546716934
for some more details.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D153228

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4
# f3dcd3ad 04-May-2023 Colin Ogilvie <colin.ogilvie@kdab.com>

[clang-format] Correctly limit formatted ranges when specifying qualifier alignment

The qualifier alignment fixer appeared to ignore any ranges specified for limiting formatting.
This change ensures

[clang-format] Correctly limit formatted ranges when specifying qualifier alignment

The qualifier alignment fixer appeared to ignore any ranges specified for limiting formatting.
This change ensures that it only formats affected lines to avoid unexpected changes.

Fixes #54888.

Differential Revision: https://reviews.llvm.org/D149643

show more ...


12