forked from OSchip/llvm-project
![]() A quick search of github.com, shows one common scenario for excessive use of //clang-format off/on is the indentation of #pragma's, especially around the areas of loop optimization or OpenMP This revision aims to help that by introducing an `IndentPragmas` style, the aim of which is to keep the pragma at the current level of scope ``` for (int i = 0; i < 5; i++) { // clang-format off #pragma HLS UNROLL // clang-format on for (int j = 0; j < 5; j++) { // clang-format off #pragma HLS UNROLL // clang-format on .... ``` can become ``` for (int i = 0; i < 5; i++) { #pragma HLS UNROLL for (int j = 0; j < 5; j++) { #pragma HLS UNROLL .... ``` This revision also support working alongside the `IndentPPDirective` of `BeforeHash` and `AfterHash` (see unit tests for examples) Reviewed By: curdeius Differential Revision: https://reviews.llvm.org/D92753 |
||
---|---|---|
.. | ||
AffectedRangeManager.cpp | ||
AffectedRangeManager.h | ||
BreakableToken.cpp | ||
BreakableToken.h | ||
CMakeLists.txt | ||
ContinuationIndenter.cpp | ||
ContinuationIndenter.h | ||
Encoding.h | ||
Format.cpp | ||
FormatInternal.h | ||
FormatToken.cpp | ||
FormatToken.h | ||
FormatTokenLexer.cpp | ||
FormatTokenLexer.h | ||
MacroExpander.cpp | ||
Macros.h | ||
NamespaceEndCommentsFixer.cpp | ||
NamespaceEndCommentsFixer.h | ||
SortJavaScriptImports.cpp | ||
SortJavaScriptImports.h | ||
TokenAnalyzer.cpp | ||
TokenAnalyzer.h | ||
TokenAnnotator.cpp | ||
TokenAnnotator.h | ||
UnwrappedLineFormatter.cpp | ||
UnwrappedLineFormatter.h | ||
UnwrappedLineParser.cpp | ||
UnwrappedLineParser.h | ||
UsingDeclarationsSorter.cpp | ||
UsingDeclarationsSorter.h | ||
WhitespaceManager.cpp | ||
WhitespaceManager.h |