You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clang format does a good job in formatting the following global variable definitions by itself. However, the different decisions it takes for each makes it difficult to read a list of such definitions:
static cl::opt<unsigned>
MaxInsts("bb-vectorize-max-instr-per-group", cl::init(500), cl::Hidden,
cl::desc("The maximum number of pairable instructions per group"));
static cl::opt<unsigned> MaxCandPairsForCycleCheck(
"bb-vectorize-max-cycle-check-pairs", cl::init(200), cl::Hidden,
cl::desc("The maximum number of candidate pairs with which to use"
" a full cycle check"));
static cl::opt<bool>
NoBools("bb-vectorize-no-bools", cl::init(false), cl::Hidden,
cl::desc("Don't try to vectorize boolean (i1) values"));
static cl::opt<bool> NoInts("bb-vectorize-no-ints", cl::init(false), cl::Hidden,
cl::desc("Don't try to vectorize integer values"));
static cl::opt<bool>
NoFloats("bb-vectorize-no-floats", cl::init(false), cl::Hidden,
cl::desc("Don't try to vectorize floating-point values"));
In LLVM there exists both code that breaks after the type of the global and code that keeps
the variable name in the same line of the type. However, within one file I have never seen a mix here.
The very same is true for function definitions and their return types.
I believe choosing one strategy would increase overall readability.
The text was updated successfully, but these errors were encountered:
There is the mentioned option. And apart from that clang-format does have one strategy, it minimizes the penalty. Some penalty values can be configured.
So for your return type you can activate AlwaysBreakAfterReturnType or increase PenaltyReturnTypeOnItsOwnLine so that it basically never ends on its own line.
Extended Description
Clang format does a good job in formatting the following global variable definitions by itself. However, the different decisions it takes for each makes it difficult to read a list of such definitions:
In LLVM there exists both code that breaks after the type of the global and code that keeps
the variable name in the same line of the type. However, within one file I have never seen a mix here.
The very same is true for function definitions and their return types.
I believe choosing one strategy would increase overall readability.
The text was updated successfully, but these errors were encountered: