Owen Pan
61c83e9491
Revert "[clang-format][NFC] Make LangOpts global in namespace Format"
...
This reverts commit 32e65b0b8a743678974c7ca7913c1d6c41bb0772.
It seems to break some PowerPC bots.
See https://github.com/llvm/llvm-project/pull/81390#issuecomment-1941964803 .
2024-02-13 21:02:14 -08:00
Owen Pan
32e65b0b8a
Reland "[clang-format][NFC] Make LangOpts global in namespace Format ( #81390 )"
...
Restore getFormattingLangOpts().
2024-02-11 22:01:23 -08:00
Owen Pan
3dc8ef677d
Revert "[clang-format][NFC] Make LangOpts global in namespace Format ( #81390 )"
...
This reverts commit 03f571995b4f0c260254955afd16ec44d0764794.
We can't hide getFormattingLangOpts() as it's used by other tools.
2024-02-11 13:08:28 -08:00
Owen Pan
03f571995b
[clang-format][NFC] Make LangOpts global in namespace Format ( #81390 )
2024-02-11 12:59:05 -08:00
Owen Pan
a72b064acf
[clang-format] Handle <chrono> ud suffixes in IntegerLiteralSeparator
...
Fixes #62679 .
Differential Revision: https://reviews.llvm.org/D150539
2023-05-16 13:17:31 -07:00
Owen Pan
253985d58c
[clang-format] Add MinDigits suboptions to IntegerLiteralSeparator
...
Closes #61209 .
Differential Revision: https://reviews.llvm.org/D147111
2023-03-31 17:14:33 -07:00
Owen Pan
4d21868b09
[clang-format] Handle '_' in ud-suffix for IntegerLiteralSeparator
...
Also, handle imaginary numbers, i.e., those with suffixes starting
with an 'i'.
Fixes #61676 .
Differential Revision: https://reviews.llvm.org/D146844
2023-03-28 13:13:02 -07:00
Owen Pan
5b5c49ad45
[clang-format] Don't format already formatted integer literals
...
Fixes a bug in IntegerLiteralSeparatorFixer::checkSeparator() so that
only unformatted integer literals will be formatted.
Differential Revision: https://reviews.llvm.org/D146501
2023-03-26 13:25:41 -07:00
Owen Pan
b4243bb611
[clang-format] Don't rewrite the input file if already formatted
...
If IntegerLiteralSeparator is set but the integer literals are
already formatted, don't rewrite the input file.
Fixes #60651 .
Differential Revision: https://reviews.llvm.org/D143831
2023-02-14 14:27:53 -08:00
Owen Pan
25e2d0f3c8
[clang-format] Support clang-format on/off line comments as prefix
...
Closes #60264 .
Differential Revision: https://reviews.llvm.org/D142804
2023-02-01 13:07:09 -08:00
Owen Pan
b027cdc5b9
[clang-format][NFC] Clean up IntegerLiteralSeparatorFixer::process
2023-01-01 14:49:12 -08:00
Owen Pan
89aad1e6a3
Reland [clang-format] Add an option to format integer literal separators
...
Previously committed in 46c94e5067b5 which was reverted in f0756e086010
due to a memory bug.
Closes #58949 .
Differential Revision: https://reviews.llvm.org/D140543
2022-12-31 17:57:33 -08:00
Vitaly Buka
f0756e0860
Revert "[clang-format] Add an option to format integer literal separators"
...
Revert "[clang-format] Disable FixRanges in IntegerLiteralSeparatorTest"
Breaks buildbots, details in https://reviews.llvm.org/D140543
This reverts commit 879bd9146a2c9ea395abd7c1ebd0f76f414a4967.
This reverts commit 46c94e5067b5f396c24bb950505c79bc819bd4b8.
2022-12-25 13:04:41 -08:00
Owen Pan
46c94e5067
[clang-format] Add an option to format integer literal separators
...
Closes #58949 .
Differential Revision: https://reviews.llvm.org/D140543
2022-12-24 15:35:17 -08:00