Index: clang/include/clang/Format/Format.h =================================================================== --- clang/include/clang/Format/Format.h +++ clang/include/clang/Format/Format.h @@ -1160,6 +1160,19 @@ /// \endcode BraceWrappingFlags BraceWrapping; + /// If ``true``, colons in ASM parameters will be placed after line breaks. + /// \code + /// true: + /// asm volatile("loooooooooooooooooooooooooooooooooooooooooooooong", + /// : + /// : val); + /// + /// false: + /// asm volatile("loooooooooooooooooooooooooooooooooooooooooooooong", + /// : : val); + /// \endcode + bool BreakBeforeInlineASMColon; + /// If ``true``, struct left brace will be placed after line breaks. /// \code /// true: @@ -2448,6 +2461,7 @@ BinPackParameters == R.BinPackParameters && BreakBeforeBinaryOperators == R.BreakBeforeBinaryOperators && BreakBeforeBraces == R.BreakBeforeBraces && + BreakBeforeInlineASMColon == R.BreakBeforeInlineASMColon && BreakBeforeStructInitialization == R.BreakBeforeStructInitialization && BreakBeforeTernaryOperators == R.BreakBeforeTernaryOperators && BreakConstructorInitializers == R.BreakConstructorInitializers && Index: clang/lib/Format/ContinuationIndenter.cpp =================================================================== --- clang/lib/Format/ContinuationIndenter.cpp +++ clang/lib/Format/ContinuationIndenter.cpp @@ -334,7 +334,7 @@ auto LambdaBodyLength = getLengthToMatchingParen(Current, State.Stack); return (LambdaBodyLength > getColumnLimit(State)); } - if (Current.MustBreakBefore || Current.is(TT_InlineASMColon)) + if (Current.MustBreakBefore || (Current.is(TT_InlineASMColon) && Style.BreakBeforeInlineASMColon)) return true; if (State.Stack.back().BreakBeforeClosingBrace && Current.closesBlockOrBlockTypeList(Style)) Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -513,6 +513,9 @@ Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; + IO.mapOptional("BreakBeforeInlineASMColon", + Style.BreakBeforeInlineASMColon); + IO.mapOptional("BreakBeforeStructInitialization", Style.BreakBeforeStructInitialization);