aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2020-11-02 17:35:59 +0000
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2020-11-02 17:52:37 +0000
commit906b9dbc9d7487ee923b6a516c36777a2be0ca35 (patch)
tree793fdd468a8cb0579e861ba78298d1eaa7081845 /clang/lib/Basic/Module.cpp
parent5bc438efcf96c9ef83312c37674b03e98259a22b (diff)
downloadllvm-906b9dbc9d7487ee923b6a516c36777a2be0ca35.zip
llvm-906b9dbc9d7487ee923b6a516c36777a2be0ca35.tar.gz
llvm-906b9dbc9d7487ee923b6a516c36777a2be0ca35.tar.bz2
[clang-format] Improve BAS_DontAlign+AllowAllArgumentsOnNextLine=false
TokenAnnotator::splitPenalty() was always returning 0 for opening parens if AlignAfterOpenBracket was set to BAS_DontAlign, so the preferred point for line breaking was always after the open paren (and was ignoring PenaltyBreakBeforeFirstCallParameter). This change restricts the zero penalty to the AllowAllArgumentsOnNextLine case. This results in improved formatting for FreeBSD where we set AllowAllArgumentsOnNextLine: false and a high value for PenaltyBreakBeforeFirstCallParameter to avoid breaking after the open paren. Before: ``` functionCall( paramA, paramB, paramC); void functionDecl( int A, int B, int C) ``` After: ``` functionCall(paramA, paramB, paramC); void functionDecl(int A, int B, int C) ``` Reviewed By: MyDeveloperDay Differential Revision: https://reviews.llvm.org/D90246
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
0 files changed, 0 insertions, 0 deletions