Lines Matching refs:FormatStyle
29 using clang::format::FormatStyle;
31 LLVM_YAML_IS_SEQUENCE_VECTOR(FormatStyle::RawStringFormat)
36 struct ScalarEnumerationTraits<FormatStyle::BreakBeforeNoexceptSpecifierStyle> {
38 enumeration(IO &IO, FormatStyle::BreakBeforeNoexceptSpecifierStyle &Value) { in enumeration()
39 IO.enumCase(Value, "Never", FormatStyle::BBNSS_Never); in enumeration()
40 IO.enumCase(Value, "OnlyWithParen", FormatStyle::BBNSS_OnlyWithParen); in enumeration()
41 IO.enumCase(Value, "Always", FormatStyle::BBNSS_Always); in enumeration()
45 template <> struct MappingTraits<FormatStyle::AlignConsecutiveStyle> {
46 static void enumInput(IO &IO, FormatStyle::AlignConsecutiveStyle &Value) { in enumInput()
48 FormatStyle::AlignConsecutiveStyle( in enumInput()
53 FormatStyle::AlignConsecutiveStyle( in enumInput()
58 FormatStyle::AlignConsecutiveStyle( in enumInput()
63 FormatStyle::AlignConsecutiveStyle( in enumInput()
68 FormatStyle::AlignConsecutiveStyle( in enumInput()
75 FormatStyle::AlignConsecutiveStyle( in enumInput()
80 FormatStyle::AlignConsecutiveStyle( in enumInput()
86 static void mapping(IO &IO, FormatStyle::AlignConsecutiveStyle &Value) { in mapping()
97 struct MappingTraits<FormatStyle::ShortCaseStatementsAlignmentStyle> {
99 FormatStyle::ShortCaseStatementsAlignmentStyle &Value) { in mapping()
109 struct ScalarEnumerationTraits<FormatStyle::AttributeBreakingStyle> {
110 static void enumeration(IO &IO, FormatStyle::AttributeBreakingStyle &Value) { in enumeration()
111 IO.enumCase(Value, "Always", FormatStyle::ABS_Always); in enumeration()
112 IO.enumCase(Value, "Leave", FormatStyle::ABS_Leave); in enumeration()
113 IO.enumCase(Value, "Never", FormatStyle::ABS_Never); in enumeration()
118 struct ScalarEnumerationTraits<FormatStyle::ArrayInitializerAlignmentStyle> {
120 FormatStyle::ArrayInitializerAlignmentStyle &Value) { in enumeration()
121 IO.enumCase(Value, "None", FormatStyle::AIAS_None); in enumeration()
122 IO.enumCase(Value, "Left", FormatStyle::AIAS_Left); in enumeration()
123 IO.enumCase(Value, "Right", FormatStyle::AIAS_Right); in enumeration()
127 template <> struct ScalarEnumerationTraits<FormatStyle::BinaryOperatorStyle> {
128 static void enumeration(IO &IO, FormatStyle::BinaryOperatorStyle &Value) { in enumeration()
129 IO.enumCase(Value, "All", FormatStyle::BOS_All); in enumeration()
130 IO.enumCase(Value, "true", FormatStyle::BOS_All); in enumeration()
131 IO.enumCase(Value, "None", FormatStyle::BOS_None); in enumeration()
132 IO.enumCase(Value, "false", FormatStyle::BOS_None); in enumeration()
133 IO.enumCase(Value, "NonAssignment", FormatStyle::BOS_NonAssignment); in enumeration()
137 template <> struct ScalarEnumerationTraits<FormatStyle::BinPackStyle> {
138 static void enumeration(IO &IO, FormatStyle::BinPackStyle &Value) { in enumeration()
139 IO.enumCase(Value, "Auto", FormatStyle::BPS_Auto); in enumeration()
140 IO.enumCase(Value, "Always", FormatStyle::BPS_Always); in enumeration()
141 IO.enumCase(Value, "Never", FormatStyle::BPS_Never); in enumeration()
146 struct ScalarEnumerationTraits<FormatStyle::BitFieldColonSpacingStyle> {
148 FormatStyle::BitFieldColonSpacingStyle &Value) { in enumeration()
149 IO.enumCase(Value, "Both", FormatStyle::BFCS_Both); in enumeration()
150 IO.enumCase(Value, "None", FormatStyle::BFCS_None); in enumeration()
151 IO.enumCase(Value, "Before", FormatStyle::BFCS_Before); in enumeration()
152 IO.enumCase(Value, "After", FormatStyle::BFCS_After); in enumeration()
156 template <> struct ScalarEnumerationTraits<FormatStyle::BraceBreakingStyle> {
157 static void enumeration(IO &IO, FormatStyle::BraceBreakingStyle &Value) { in enumeration()
158 IO.enumCase(Value, "Attach", FormatStyle::BS_Attach); in enumeration()
159 IO.enumCase(Value, "Linux", FormatStyle::BS_Linux); in enumeration()
160 IO.enumCase(Value, "Mozilla", FormatStyle::BS_Mozilla); in enumeration()
161 IO.enumCase(Value, "Stroustrup", FormatStyle::BS_Stroustrup); in enumeration()
162 IO.enumCase(Value, "Allman", FormatStyle::BS_Allman); in enumeration()
163 IO.enumCase(Value, "Whitesmiths", FormatStyle::BS_Whitesmiths); in enumeration()
164 IO.enumCase(Value, "GNU", FormatStyle::BS_GNU); in enumeration()
165 IO.enumCase(Value, "WebKit", FormatStyle::BS_WebKit); in enumeration()
166 IO.enumCase(Value, "Custom", FormatStyle::BS_Custom); in enumeration()
170 template <> struct MappingTraits<FormatStyle::BraceWrappingFlags> {
171 static void mapping(IO &IO, FormatStyle::BraceWrappingFlags &Wrapping) { in mapping()
193 template <> struct ScalarEnumerationTraits<FormatStyle::BracketAlignmentStyle> {
194 static void enumeration(IO &IO, FormatStyle::BracketAlignmentStyle &Value) { in enumeration()
195 IO.enumCase(Value, "Align", FormatStyle::BAS_Align); in enumeration()
196 IO.enumCase(Value, "DontAlign", FormatStyle::BAS_DontAlign); in enumeration()
197 IO.enumCase(Value, "AlwaysBreak", FormatStyle::BAS_AlwaysBreak); in enumeration()
198 IO.enumCase(Value, "BlockIndent", FormatStyle::BAS_BlockIndent); in enumeration()
201 IO.enumCase(Value, "true", FormatStyle::BAS_Align); in enumeration()
202 IO.enumCase(Value, "false", FormatStyle::BAS_DontAlign); in enumeration()
208 FormatStyle::BraceWrappingAfterControlStatementStyle> {
211 FormatStyle::BraceWrappingAfterControlStatementStyle &Value) { in enumeration()
212 IO.enumCase(Value, "Never", FormatStyle::BWACS_Never); in enumeration()
213 IO.enumCase(Value, "MultiLine", FormatStyle::BWACS_MultiLine); in enumeration()
214 IO.enumCase(Value, "Always", FormatStyle::BWACS_Always); in enumeration()
217 IO.enumCase(Value, "false", FormatStyle::BWACS_Never); in enumeration()
218 IO.enumCase(Value, "true", FormatStyle::BWACS_Always); in enumeration()
224 FormatStyle::BreakBeforeConceptDeclarationsStyle> {
226 enumeration(IO &IO, FormatStyle::BreakBeforeConceptDeclarationsStyle &Value) { in enumeration()
227 IO.enumCase(Value, "Never", FormatStyle::BBCDS_Never); in enumeration()
228 IO.enumCase(Value, "Allowed", FormatStyle::BBCDS_Allowed); in enumeration()
229 IO.enumCase(Value, "Always", FormatStyle::BBCDS_Always); in enumeration()
232 IO.enumCase(Value, "true", FormatStyle::BBCDS_Always); in enumeration()
233 IO.enumCase(Value, "false", FormatStyle::BBCDS_Allowed); in enumeration()
238 struct ScalarEnumerationTraits<FormatStyle::BreakBeforeInlineASMColonStyle> {
240 FormatStyle::BreakBeforeInlineASMColonStyle &Value) { in enumeration()
241 IO.enumCase(Value, "Never", FormatStyle::BBIAS_Never); in enumeration()
242 IO.enumCase(Value, "OnlyMultiline", FormatStyle::BBIAS_OnlyMultiline); in enumeration()
243 IO.enumCase(Value, "Always", FormatStyle::BBIAS_Always); in enumeration()
248 struct ScalarEnumerationTraits<FormatStyle::BreakConstructorInitializersStyle> {
250 enumeration(IO &IO, FormatStyle::BreakConstructorInitializersStyle &Value) { in enumeration()
251 IO.enumCase(Value, "BeforeColon", FormatStyle::BCIS_BeforeColon); in enumeration()
252 IO.enumCase(Value, "BeforeComma", FormatStyle::BCIS_BeforeComma); in enumeration()
253 IO.enumCase(Value, "AfterColon", FormatStyle::BCIS_AfterColon); in enumeration()
258 struct ScalarEnumerationTraits<FormatStyle::BreakInheritanceListStyle> {
260 FormatStyle::BreakInheritanceListStyle &Value) { in enumeration()
261 IO.enumCase(Value, "BeforeColon", FormatStyle::BILS_BeforeColon); in enumeration()
262 IO.enumCase(Value, "BeforeComma", FormatStyle::BILS_BeforeComma); in enumeration()
263 IO.enumCase(Value, "AfterColon", FormatStyle::BILS_AfterColon); in enumeration()
264 IO.enumCase(Value, "AfterComma", FormatStyle::BILS_AfterComma); in enumeration()
269 struct ScalarEnumerationTraits<FormatStyle::BreakTemplateDeclarationsStyle> {
271 FormatStyle::BreakTemplateDeclarationsStyle &Value) { in enumeration()
272 IO.enumCase(Value, "Leave", FormatStyle::BTDS_Leave); in enumeration()
273 IO.enumCase(Value, "No", FormatStyle::BTDS_No); in enumeration()
274 IO.enumCase(Value, "MultiLine", FormatStyle::BTDS_MultiLine); in enumeration()
275 IO.enumCase(Value, "Yes", FormatStyle::BTDS_Yes); in enumeration()
278 IO.enumCase(Value, "false", FormatStyle::BTDS_MultiLine); in enumeration()
279 IO.enumCase(Value, "true", FormatStyle::BTDS_Yes); in enumeration()
283 template <> struct ScalarEnumerationTraits<FormatStyle::DAGArgStyle> {
284 static void enumeration(IO &IO, FormatStyle::DAGArgStyle &Value) { in enumeration()
285 IO.enumCase(Value, "DontBreak", FormatStyle::DAS_DontBreak); in enumeration()
286 IO.enumCase(Value, "BreakElements", FormatStyle::DAS_BreakElements); in enumeration()
287 IO.enumCase(Value, "BreakAll", FormatStyle::DAS_BreakAll); in enumeration()
292 struct ScalarEnumerationTraits<FormatStyle::DefinitionReturnTypeBreakingStyle> {
294 enumeration(IO &IO, FormatStyle::DefinitionReturnTypeBreakingStyle &Value) { in enumeration()
295 IO.enumCase(Value, "None", FormatStyle::DRTBS_None); in enumeration()
296 IO.enumCase(Value, "All", FormatStyle::DRTBS_All); in enumeration()
297 IO.enumCase(Value, "TopLevel", FormatStyle::DRTBS_TopLevel); in enumeration()
300 IO.enumCase(Value, "false", FormatStyle::DRTBS_None); in enumeration()
301 IO.enumCase(Value, "true", FormatStyle::DRTBS_All); in enumeration()
306 struct ScalarEnumerationTraits<FormatStyle::EscapedNewlineAlignmentStyle> {
308 FormatStyle::EscapedNewlineAlignmentStyle &Value) { in enumeration()
309 IO.enumCase(Value, "DontAlign", FormatStyle::ENAS_DontAlign); in enumeration()
310 IO.enumCase(Value, "Left", FormatStyle::ENAS_Left); in enumeration()
311 IO.enumCase(Value, "LeftWithLastLine", FormatStyle::ENAS_LeftWithLastLine); in enumeration()
312 IO.enumCase(Value, "Right", FormatStyle::ENAS_Right); in enumeration()
315 IO.enumCase(Value, "true", FormatStyle::ENAS_Left); in enumeration()
316 IO.enumCase(Value, "false", FormatStyle::ENAS_Right); in enumeration()
321 struct ScalarEnumerationTraits<FormatStyle::EmptyLineAfterAccessModifierStyle> {
323 enumeration(IO &IO, FormatStyle::EmptyLineAfterAccessModifierStyle &Value) { in enumeration()
324 IO.enumCase(Value, "Never", FormatStyle::ELAAMS_Never); in enumeration()
325 IO.enumCase(Value, "Leave", FormatStyle::ELAAMS_Leave); in enumeration()
326 IO.enumCase(Value, "Always", FormatStyle::ELAAMS_Always); in enumeration()
332 FormatStyle::EmptyLineBeforeAccessModifierStyle> {
334 enumeration(IO &IO, FormatStyle::EmptyLineBeforeAccessModifierStyle &Value) { in enumeration()
335 IO.enumCase(Value, "Never", FormatStyle::ELBAMS_Never); in enumeration()
336 IO.enumCase(Value, "Leave", FormatStyle::ELBAMS_Leave); in enumeration()
337 IO.enumCase(Value, "LogicalBlock", FormatStyle::ELBAMS_LogicalBlock); in enumeration()
338 IO.enumCase(Value, "Always", FormatStyle::ELBAMS_Always); in enumeration()
343 struct ScalarEnumerationTraits<FormatStyle::IndentExternBlockStyle> {
344 static void enumeration(IO &IO, FormatStyle::IndentExternBlockStyle &Value) { in enumeration()
345 IO.enumCase(Value, "AfterExternBlock", FormatStyle::IEBS_AfterExternBlock); in enumeration()
346 IO.enumCase(Value, "Indent", FormatStyle::IEBS_Indent); in enumeration()
347 IO.enumCase(Value, "NoIndent", FormatStyle::IEBS_NoIndent); in enumeration()
348 IO.enumCase(Value, "true", FormatStyle::IEBS_Indent); in enumeration()
349 IO.enumCase(Value, "false", FormatStyle::IEBS_NoIndent); in enumeration()
353 template <> struct MappingTraits<FormatStyle::IntegerLiteralSeparatorStyle> {
354 static void mapping(IO &IO, FormatStyle::IntegerLiteralSeparatorStyle &Base) { in mapping()
364 template <> struct ScalarEnumerationTraits<FormatStyle::JavaScriptQuoteStyle> {
365 static void enumeration(IO &IO, FormatStyle::JavaScriptQuoteStyle &Value) { in enumeration()
366 IO.enumCase(Value, "Leave", FormatStyle::JSQS_Leave); in enumeration()
367 IO.enumCase(Value, "Single", FormatStyle::JSQS_Single); in enumeration()
368 IO.enumCase(Value, "Double", FormatStyle::JSQS_Double); in enumeration()
372 template <> struct MappingTraits<FormatStyle::KeepEmptyLinesStyle> {
373 static void mapping(IO &IO, FormatStyle::KeepEmptyLinesStyle &Value) { in mapping()
380 template <> struct ScalarEnumerationTraits<FormatStyle::LanguageKind> {
381 static void enumeration(IO &IO, FormatStyle::LanguageKind &Value) { in enumeration()
382 IO.enumCase(Value, "Cpp", FormatStyle::LK_Cpp); in enumeration()
383 IO.enumCase(Value, "Java", FormatStyle::LK_Java); in enumeration()
384 IO.enumCase(Value, "JavaScript", FormatStyle::LK_JavaScript); in enumeration()
385 IO.enumCase(Value, "ObjC", FormatStyle::LK_ObjC); in enumeration()
386 IO.enumCase(Value, "Proto", FormatStyle::LK_Proto); in enumeration()
387 IO.enumCase(Value, "TableGen", FormatStyle::LK_TableGen); in enumeration()
388 IO.enumCase(Value, "TextProto", FormatStyle::LK_TextProto); in enumeration()
389 IO.enumCase(Value, "CSharp", FormatStyle::LK_CSharp); in enumeration()
390 IO.enumCase(Value, "Json", FormatStyle::LK_Json); in enumeration()
391 IO.enumCase(Value, "Verilog", FormatStyle::LK_Verilog); in enumeration()
395 template <> struct ScalarEnumerationTraits<FormatStyle::LanguageStandard> {
396 static void enumeration(IO &IO, FormatStyle::LanguageStandard &Value) { in enumeration()
397 IO.enumCase(Value, "c++03", FormatStyle::LS_Cpp03); in enumeration()
398 IO.enumCase(Value, "C++03", FormatStyle::LS_Cpp03); // Legacy alias in enumeration()
399 IO.enumCase(Value, "Cpp03", FormatStyle::LS_Cpp03); // Legacy alias in enumeration()
401 IO.enumCase(Value, "c++11", FormatStyle::LS_Cpp11); in enumeration()
402 IO.enumCase(Value, "C++11", FormatStyle::LS_Cpp11); // Legacy alias in enumeration()
404 IO.enumCase(Value, "c++14", FormatStyle::LS_Cpp14); in enumeration()
405 IO.enumCase(Value, "c++17", FormatStyle::LS_Cpp17); in enumeration()
406 IO.enumCase(Value, "c++20", FormatStyle::LS_Cpp20); in enumeration()
408 IO.enumCase(Value, "Latest", FormatStyle::LS_Latest); in enumeration()
409 IO.enumCase(Value, "Cpp11", FormatStyle::LS_Latest); // Legacy alias in enumeration()
410 IO.enumCase(Value, "Auto", FormatStyle::LS_Auto); in enumeration()
415 struct ScalarEnumerationTraits<FormatStyle::LambdaBodyIndentationKind> {
417 FormatStyle::LambdaBodyIndentationKind &Value) { in enumeration()
418 IO.enumCase(Value, "Signature", FormatStyle::LBI_Signature); in enumeration()
419 IO.enumCase(Value, "OuterScope", FormatStyle::LBI_OuterScope); in enumeration()
423 template <> struct ScalarEnumerationTraits<FormatStyle::LineEndingStyle> {
424 static void enumeration(IO &IO, FormatStyle::LineEndingStyle &Value) { in enumeration()
425 IO.enumCase(Value, "LF", FormatStyle::LE_LF); in enumeration()
426 IO.enumCase(Value, "CRLF", FormatStyle::LE_CRLF); in enumeration()
427 IO.enumCase(Value, "DeriveLF", FormatStyle::LE_DeriveLF); in enumeration()
428 IO.enumCase(Value, "DeriveCRLF", FormatStyle::LE_DeriveCRLF); in enumeration()
433 struct ScalarEnumerationTraits<FormatStyle::NamespaceIndentationKind> {
435 FormatStyle::NamespaceIndentationKind &Value) { in enumeration()
436 IO.enumCase(Value, "None", FormatStyle::NI_None); in enumeration()
437 IO.enumCase(Value, "Inner", FormatStyle::NI_Inner); in enumeration()
438 IO.enumCase(Value, "All", FormatStyle::NI_All); in enumeration()
442 template <> struct ScalarEnumerationTraits<FormatStyle::OperandAlignmentStyle> {
443 static void enumeration(IO &IO, FormatStyle::OperandAlignmentStyle &Value) { in enumeration()
444 IO.enumCase(Value, "DontAlign", FormatStyle::OAS_DontAlign); in enumeration()
445 IO.enumCase(Value, "Align", FormatStyle::OAS_Align); in enumeration()
447 FormatStyle::OAS_AlignAfterOperator); in enumeration()
450 IO.enumCase(Value, "true", FormatStyle::OAS_Align); in enumeration()
451 IO.enumCase(Value, "false", FormatStyle::OAS_DontAlign); in enumeration()
456 struct ScalarEnumerationTraits<FormatStyle::PackConstructorInitializersStyle> {
458 enumeration(IO &IO, FormatStyle::PackConstructorInitializersStyle &Value) { in enumeration()
459 IO.enumCase(Value, "Never", FormatStyle::PCIS_Never); in enumeration()
460 IO.enumCase(Value, "BinPack", FormatStyle::PCIS_BinPack); in enumeration()
461 IO.enumCase(Value, "CurrentLine", FormatStyle::PCIS_CurrentLine); in enumeration()
462 IO.enumCase(Value, "NextLine", FormatStyle::PCIS_NextLine); in enumeration()
463 IO.enumCase(Value, "NextLineOnly", FormatStyle::PCIS_NextLineOnly); in enumeration()
467 template <> struct ScalarEnumerationTraits<FormatStyle::PointerAlignmentStyle> {
468 static void enumeration(IO &IO, FormatStyle::PointerAlignmentStyle &Value) { in enumeration()
469 IO.enumCase(Value, "Middle", FormatStyle::PAS_Middle); in enumeration()
470 IO.enumCase(Value, "Left", FormatStyle::PAS_Left); in enumeration()
471 IO.enumCase(Value, "Right", FormatStyle::PAS_Right); in enumeration()
474 IO.enumCase(Value, "true", FormatStyle::PAS_Left); in enumeration()
475 IO.enumCase(Value, "false", FormatStyle::PAS_Right); in enumeration()
480 struct ScalarEnumerationTraits<FormatStyle::PPDirectiveIndentStyle> {
481 static void enumeration(IO &IO, FormatStyle::PPDirectiveIndentStyle &Value) { in enumeration()
482 IO.enumCase(Value, "None", FormatStyle::PPDIS_None); in enumeration()
483 IO.enumCase(Value, "AfterHash", FormatStyle::PPDIS_AfterHash); in enumeration()
484 IO.enumCase(Value, "BeforeHash", FormatStyle::PPDIS_BeforeHash); in enumeration()
489 struct ScalarEnumerationTraits<FormatStyle::QualifierAlignmentStyle> {
490 static void enumeration(IO &IO, FormatStyle::QualifierAlignmentStyle &Value) { in enumeration()
491 IO.enumCase(Value, "Leave", FormatStyle::QAS_Leave); in enumeration()
492 IO.enumCase(Value, "Left", FormatStyle::QAS_Left); in enumeration()
493 IO.enumCase(Value, "Right", FormatStyle::QAS_Right); in enumeration()
494 IO.enumCase(Value, "Custom", FormatStyle::QAS_Custom); in enumeration()
498 template <> struct MappingTraits<FormatStyle::RawStringFormat> {
499 static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) { in mapping()
509 struct ScalarEnumerationTraits<FormatStyle::ReferenceAlignmentStyle> {
510 static void enumeration(IO &IO, FormatStyle::ReferenceAlignmentStyle &Value) { in enumeration()
511 IO.enumCase(Value, "Pointer", FormatStyle::RAS_Pointer); in enumeration()
512 IO.enumCase(Value, "Middle", FormatStyle::RAS_Middle); in enumeration()
513 IO.enumCase(Value, "Left", FormatStyle::RAS_Left); in enumeration()
514 IO.enumCase(Value, "Right", FormatStyle::RAS_Right); in enumeration()
519 struct ScalarEnumerationTraits<FormatStyle::RemoveParenthesesStyle> {
520 static void enumeration(IO &IO, FormatStyle::RemoveParenthesesStyle &Value) { in enumeration()
521 IO.enumCase(Value, "Leave", FormatStyle::RPS_Leave); in enumeration()
523 FormatStyle::RPS_MultipleParentheses); in enumeration()
524 IO.enumCase(Value, "ReturnStatement", FormatStyle::RPS_ReturnStatement); in enumeration()
529 struct ScalarEnumerationTraits<FormatStyle::RequiresClausePositionStyle> {
531 FormatStyle::RequiresClausePositionStyle &Value) { in enumeration()
532 IO.enumCase(Value, "OwnLine", FormatStyle::RCPS_OwnLine); in enumeration()
533 IO.enumCase(Value, "WithPreceding", FormatStyle::RCPS_WithPreceding); in enumeration()
534 IO.enumCase(Value, "WithFollowing", FormatStyle::RCPS_WithFollowing); in enumeration()
535 IO.enumCase(Value, "SingleLine", FormatStyle::RCPS_SingleLine); in enumeration()
540 struct ScalarEnumerationTraits<FormatStyle::RequiresExpressionIndentationKind> {
542 enumeration(IO &IO, FormatStyle::RequiresExpressionIndentationKind &Value) { in enumeration()
543 IO.enumCase(Value, "Keyword", FormatStyle::REI_Keyword); in enumeration()
544 IO.enumCase(Value, "OuterScope", FormatStyle::REI_OuterScope); in enumeration()
549 struct ScalarEnumerationTraits<FormatStyle::ReturnTypeBreakingStyle> {
550 static void enumeration(IO &IO, FormatStyle::ReturnTypeBreakingStyle &Value) { in enumeration()
551 IO.enumCase(Value, "None", FormatStyle::RTBS_None); in enumeration()
552 IO.enumCase(Value, "Automatic", FormatStyle::RTBS_Automatic); in enumeration()
553 IO.enumCase(Value, "ExceptShortType", FormatStyle::RTBS_ExceptShortType); in enumeration()
554 IO.enumCase(Value, "All", FormatStyle::RTBS_All); in enumeration()
555 IO.enumCase(Value, "TopLevel", FormatStyle::RTBS_TopLevel); in enumeration()
557 FormatStyle::RTBS_TopLevelDefinitions); in enumeration()
558 IO.enumCase(Value, "AllDefinitions", FormatStyle::RTBS_AllDefinitions); in enumeration()
563 struct ScalarEnumerationTraits<FormatStyle::SeparateDefinitionStyle> {
564 static void enumeration(IO &IO, FormatStyle::SeparateDefinitionStyle &Value) { in enumeration()
565 IO.enumCase(Value, "Leave", FormatStyle::SDS_Leave); in enumeration()
566 IO.enumCase(Value, "Always", FormatStyle::SDS_Always); in enumeration()
567 IO.enumCase(Value, "Never", FormatStyle::SDS_Never); in enumeration()
571 template <> struct ScalarEnumerationTraits<FormatStyle::ShortBlockStyle> {
572 static void enumeration(IO &IO, FormatStyle::ShortBlockStyle &Value) { in enumeration()
573 IO.enumCase(Value, "Never", FormatStyle::SBS_Never); in enumeration()
574 IO.enumCase(Value, "false", FormatStyle::SBS_Never); in enumeration()
575 IO.enumCase(Value, "Always", FormatStyle::SBS_Always); in enumeration()
576 IO.enumCase(Value, "true", FormatStyle::SBS_Always); in enumeration()
577 IO.enumCase(Value, "Empty", FormatStyle::SBS_Empty); in enumeration()
581 template <> struct ScalarEnumerationTraits<FormatStyle::ShortFunctionStyle> {
582 static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) { in enumeration()
583 IO.enumCase(Value, "None", FormatStyle::SFS_None); in enumeration()
584 IO.enumCase(Value, "false", FormatStyle::SFS_None); in enumeration()
585 IO.enumCase(Value, "All", FormatStyle::SFS_All); in enumeration()
586 IO.enumCase(Value, "true", FormatStyle::SFS_All); in enumeration()
587 IO.enumCase(Value, "Inline", FormatStyle::SFS_Inline); in enumeration()
588 IO.enumCase(Value, "InlineOnly", FormatStyle::SFS_InlineOnly); in enumeration()
589 IO.enumCase(Value, "Empty", FormatStyle::SFS_Empty); in enumeration()
593 template <> struct ScalarEnumerationTraits<FormatStyle::ShortIfStyle> {
594 static void enumeration(IO &IO, FormatStyle::ShortIfStyle &Value) { in enumeration()
595 IO.enumCase(Value, "Never", FormatStyle::SIS_Never); in enumeration()
596 IO.enumCase(Value, "WithoutElse", FormatStyle::SIS_WithoutElse); in enumeration()
597 IO.enumCase(Value, "OnlyFirstIf", FormatStyle::SIS_OnlyFirstIf); in enumeration()
598 IO.enumCase(Value, "AllIfsAndElse", FormatStyle::SIS_AllIfsAndElse); in enumeration()
601 IO.enumCase(Value, "Always", FormatStyle::SIS_OnlyFirstIf); in enumeration()
602 IO.enumCase(Value, "false", FormatStyle::SIS_Never); in enumeration()
603 IO.enumCase(Value, "true", FormatStyle::SIS_WithoutElse); in enumeration()
607 template <> struct ScalarEnumerationTraits<FormatStyle::ShortLambdaStyle> {
608 static void enumeration(IO &IO, FormatStyle::ShortLambdaStyle &Value) { in enumeration()
609 IO.enumCase(Value, "None", FormatStyle::SLS_None); in enumeration()
610 IO.enumCase(Value, "false", FormatStyle::SLS_None); in enumeration()
611 IO.enumCase(Value, "Empty", FormatStyle::SLS_Empty); in enumeration()
612 IO.enumCase(Value, "Inline", FormatStyle::SLS_Inline); in enumeration()
613 IO.enumCase(Value, "All", FormatStyle::SLS_All); in enumeration()
614 IO.enumCase(Value, "true", FormatStyle::SLS_All); in enumeration()
618 template <> struct ScalarEnumerationTraits<FormatStyle::SortIncludesOptions> {
619 static void enumeration(IO &IO, FormatStyle::SortIncludesOptions &Value) { in enumeration()
620 IO.enumCase(Value, "Never", FormatStyle::SI_Never); in enumeration()
621 IO.enumCase(Value, "CaseInsensitive", FormatStyle::SI_CaseInsensitive); in enumeration()
622 IO.enumCase(Value, "CaseSensitive", FormatStyle::SI_CaseSensitive); in enumeration()
625 IO.enumCase(Value, "false", FormatStyle::SI_Never); in enumeration()
626 IO.enumCase(Value, "true", FormatStyle::SI_CaseSensitive); in enumeration()
631 struct ScalarEnumerationTraits<FormatStyle::SortJavaStaticImportOptions> {
633 FormatStyle::SortJavaStaticImportOptions &Value) { in enumeration()
634 IO.enumCase(Value, "Before", FormatStyle::SJSIO_Before); in enumeration()
635 IO.enumCase(Value, "After", FormatStyle::SJSIO_After); in enumeration()
640 struct ScalarEnumerationTraits<FormatStyle::SortUsingDeclarationsOptions> {
642 FormatStyle::SortUsingDeclarationsOptions &Value) { in enumeration()
643 IO.enumCase(Value, "Never", FormatStyle::SUD_Never); in enumeration()
644 IO.enumCase(Value, "Lexicographic", FormatStyle::SUD_Lexicographic); in enumeration()
646 FormatStyle::SUD_LexicographicNumeric); in enumeration()
649 IO.enumCase(Value, "false", FormatStyle::SUD_Never); in enumeration()
650 IO.enumCase(Value, "true", FormatStyle::SUD_LexicographicNumeric); in enumeration()
655 struct ScalarEnumerationTraits<FormatStyle::SpaceAroundPointerQualifiersStyle> {
657 enumeration(IO &IO, FormatStyle::SpaceAroundPointerQualifiersStyle &Value) { in enumeration()
658 IO.enumCase(Value, "Default", FormatStyle::SAPQ_Default); in enumeration()
659 IO.enumCase(Value, "Before", FormatStyle::SAPQ_Before); in enumeration()
660 IO.enumCase(Value, "After", FormatStyle::SAPQ_After); in enumeration()
661 IO.enumCase(Value, "Both", FormatStyle::SAPQ_Both); in enumeration()
665 template <> struct MappingTraits<FormatStyle::SpaceBeforeParensCustom> {
666 static void mapping(IO &IO, FormatStyle::SpaceBeforeParensCustom &Spacing) { in mapping()
685 struct ScalarEnumerationTraits<FormatStyle::SpaceBeforeParensStyle> {
686 static void enumeration(IO &IO, FormatStyle::SpaceBeforeParensStyle &Value) { in enumeration()
687 IO.enumCase(Value, "Never", FormatStyle::SBPO_Never); in enumeration()
689 FormatStyle::SBPO_ControlStatements); in enumeration()
691 FormatStyle::SBPO_ControlStatementsExceptControlMacros); in enumeration()
693 FormatStyle::SBPO_NonEmptyParentheses); in enumeration()
694 IO.enumCase(Value, "Always", FormatStyle::SBPO_Always); in enumeration()
695 IO.enumCase(Value, "Custom", FormatStyle::SBPO_Custom); in enumeration()
698 IO.enumCase(Value, "false", FormatStyle::SBPO_Never); in enumeration()
699 IO.enumCase(Value, "true", FormatStyle::SBPO_ControlStatements); in enumeration()
701 FormatStyle::SBPO_ControlStatementsExceptControlMacros); in enumeration()
705 template <> struct ScalarEnumerationTraits<FormatStyle::SpacesInAnglesStyle> {
706 static void enumeration(IO &IO, FormatStyle::SpacesInAnglesStyle &Value) { in enumeration()
707 IO.enumCase(Value, "Never", FormatStyle::SIAS_Never); in enumeration()
708 IO.enumCase(Value, "Always", FormatStyle::SIAS_Always); in enumeration()
709 IO.enumCase(Value, "Leave", FormatStyle::SIAS_Leave); in enumeration()
712 IO.enumCase(Value, "false", FormatStyle::SIAS_Never); in enumeration()
713 IO.enumCase(Value, "true", FormatStyle::SIAS_Always); in enumeration()
717 template <> struct MappingTraits<FormatStyle::SpacesInLineComment> {
718 static void mapping(IO &IO, FormatStyle::SpacesInLineComment &Space) { in mapping()
730 template <> struct MappingTraits<FormatStyle::SpacesInParensCustom> {
731 static void mapping(IO &IO, FormatStyle::SpacesInParensCustom &Spaces) { in mapping()
740 template <> struct ScalarEnumerationTraits<FormatStyle::SpacesInParensStyle> {
741 static void enumeration(IO &IO, FormatStyle::SpacesInParensStyle &Value) { in enumeration()
742 IO.enumCase(Value, "Never", FormatStyle::SIPO_Never); in enumeration()
743 IO.enumCase(Value, "Custom", FormatStyle::SIPO_Custom); in enumeration()
747 template <> struct ScalarEnumerationTraits<FormatStyle::TrailingCommaStyle> {
748 static void enumeration(IO &IO, FormatStyle::TrailingCommaStyle &Value) { in enumeration()
749 IO.enumCase(Value, "None", FormatStyle::TCS_None); in enumeration()
750 IO.enumCase(Value, "Wrapped", FormatStyle::TCS_Wrapped); in enumeration()
755 struct ScalarEnumerationTraits<FormatStyle::TrailingCommentsAlignmentKinds> {
757 FormatStyle::TrailingCommentsAlignmentKinds &Value) { in enumeration()
758 IO.enumCase(Value, "Leave", FormatStyle::TCAS_Leave); in enumeration()
759 IO.enumCase(Value, "Always", FormatStyle::TCAS_Always); in enumeration()
760 IO.enumCase(Value, "Never", FormatStyle::TCAS_Never); in enumeration()
764 template <> struct MappingTraits<FormatStyle::TrailingCommentsAlignmentStyle> {
766 FormatStyle::TrailingCommentsAlignmentStyle &Value) { in enumInput()
768 FormatStyle::TrailingCommentsAlignmentStyle( in enumInput()
769 {FormatStyle::TCAS_Leave, 0})); in enumInput()
772 FormatStyle::TrailingCommentsAlignmentStyle( in enumInput()
773 {FormatStyle::TCAS_Always, 0})); in enumInput()
776 FormatStyle::TrailingCommentsAlignmentStyle( in enumInput()
777 {FormatStyle::TCAS_Never, 0})); in enumInput()
781 FormatStyle::TrailingCommentsAlignmentStyle( in enumInput()
782 {FormatStyle::TCAS_Always, 0})); in enumInput()
784 FormatStyle::TrailingCommentsAlignmentStyle( in enumInput()
785 {FormatStyle::TCAS_Never, 0})); in enumInput()
789 FormatStyle::TrailingCommentsAlignmentStyle &Value) { in mapping()
795 template <> struct ScalarEnumerationTraits<FormatStyle::UseTabStyle> {
796 static void enumeration(IO &IO, FormatStyle::UseTabStyle &Value) { in enumeration()
797 IO.enumCase(Value, "Never", FormatStyle::UT_Never); in enumeration()
798 IO.enumCase(Value, "false", FormatStyle::UT_Never); in enumeration()
799 IO.enumCase(Value, "Always", FormatStyle::UT_Always); in enumeration()
800 IO.enumCase(Value, "true", FormatStyle::UT_Always); in enumeration()
801 IO.enumCase(Value, "ForIndentation", FormatStyle::UT_ForIndentation); in enumeration()
803 FormatStyle::UT_ForContinuationAndIndentation); in enumeration()
804 IO.enumCase(Value, "AlignWithSpaces", FormatStyle::UT_AlignWithSpaces); in enumeration()
808 template <> struct MappingTraits<FormatStyle> {
809 static void mapping(IO &IO, FormatStyle &Style) { in mapping()
818 FormatStyle PredefinedStyle; in mapping()
828 FormatStyle::LanguageKind OldLanguage = Style.Language; in mapping()
829 FormatStyle::LanguageKind Language = in mapping()
830 ((FormatStyle *)IO.getContext())->Language; in mapping()
1062 if (Style.QualifierAlignment == FormatStyle::QAS_Right) in mapping()
1064 else if (Style.QualifierAlignment == FormatStyle::QAS_Left) in mapping()
1066 else if (Style.QualifierAlignment == FormatStyle::QAS_Custom) in mapping()
1136 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None && in mapping()
1137 Style.BreakAfterReturnType == FormatStyle::RTBS_None) { in mapping()
1139 FormatStyle::DRTBS_All) { in mapping()
1140 Style.BreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in mapping()
1142 FormatStyle::DRTBS_TopLevel) { in mapping()
1143 Style.BreakAfterReturnType = FormatStyle::RTBS_TopLevelDefinitions; in mapping()
1150 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) { in mapping()
1151 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in mapping()
1158 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon) { in mapping()
1159 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in mapping()
1163 if (Style.PackConstructorInitializers == FormatStyle::PCIS_BinPack && in mapping()
1166 ? FormatStyle::PCIS_NextLine in mapping()
1167 : FormatStyle::PCIS_CurrentLine; in mapping()
1170 FormatStyle::PCIS_NextLine) { in mapping()
1172 Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack; in mapping()
1174 Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine; in mapping()
1177 if (Style.LineEnding == FormatStyle::LE_DeriveLF) { in mapping()
1179 Style.LineEnding = UseCRLF ? FormatStyle::LE_CRLF : FormatStyle::LE_LF; in mapping()
1181 Style.LineEnding = FormatStyle::LE_DeriveCRLF; in mapping()
1184 if (Style.SpacesInParens != FormatStyle::SIPO_Custom && in mapping()
1205 Style.SpacesInParens = FormatStyle::SIPO_Custom; in mapping()
1215 template <> struct DocumentListTraits<std::vector<FormatStyle>> {
1216 static size_t size(IO &IO, std::vector<FormatStyle> &Seq) { in size()
1219 static FormatStyle &element(IO &IO, std::vector<FormatStyle> &Seq, in element()
1223 FormatStyle Template; in element()
1224 if (!Seq.empty() && Seq[0].Language == FormatStyle::LK_None) { in element()
1227 Template = *((const FormatStyle *)IO.getContext()); in element()
1228 Template.Language = FormatStyle::LK_None; in element()
1280 static void expandPresetsBraceWrapping(FormatStyle &Expanded) { in expandPresetsBraceWrapping()
1281 if (Expanded.BreakBeforeBraces == FormatStyle::BS_Custom) in expandPresetsBraceWrapping()
1285 /*AfterControlStatement=*/FormatStyle::BWACS_Never, in expandPresetsBraceWrapping()
1302 case FormatStyle::BS_Linux: in expandPresetsBraceWrapping()
1307 case FormatStyle::BS_Mozilla: in expandPresetsBraceWrapping()
1317 case FormatStyle::BS_Stroustrup: in expandPresetsBraceWrapping()
1322 case FormatStyle::BS_Allman: in expandPresetsBraceWrapping()
1325 Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in expandPresetsBraceWrapping()
1337 case FormatStyle::BS_Whitesmiths: in expandPresetsBraceWrapping()
1340 Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in expandPresetsBraceWrapping()
1351 case FormatStyle::BS_GNU: in expandPresetsBraceWrapping()
1355 /*AfterControlStatement=*/FormatStyle::BWACS_Always, in expandPresetsBraceWrapping()
1372 case FormatStyle::BS_WebKit: in expandPresetsBraceWrapping()
1380 static void expandPresetsSpaceBeforeParens(FormatStyle &Expanded) { in expandPresetsSpaceBeforeParens()
1381 if (Expanded.SpaceBeforeParens == FormatStyle::SBPO_Custom) in expandPresetsSpaceBeforeParens()
1388 case FormatStyle::SBPO_ControlStatements: in expandPresetsSpaceBeforeParens()
1393 case FormatStyle::SBPO_ControlStatementsExceptControlMacros: in expandPresetsSpaceBeforeParens()
1396 case FormatStyle::SBPO_NonEmptyParentheses: in expandPresetsSpaceBeforeParens()
1404 static void expandPresetsSpacesInParens(FormatStyle &Expanded) { in expandPresetsSpacesInParens()
1405 if (Expanded.SpacesInParens == FormatStyle::SIPO_Custom) in expandPresetsSpacesInParens()
1407 assert(Expanded.SpacesInParens == FormatStyle::SIPO_Never); in expandPresetsSpacesInParens()
1412 FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { in getLLVMStyle()
1413 FormatStyle LLVMStyle; in getLLVMStyle()
1415 LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; in getLLVMStyle()
1416 LLVMStyle.AlignArrayOfStructures = FormatStyle::AIAS_None; in getLLVMStyle()
1431 LLVMStyle.AlignEscapedNewlines = FormatStyle::ENAS_Right; in getLLVMStyle()
1432 LLVMStyle.AlignOperands = FormatStyle::OAS_Align; in getLLVMStyle()
1434 LLVMStyle.AlignTrailingComments.Kind = FormatStyle::TCAS_Always; in getLLVMStyle()
1438 LLVMStyle.AllowBreakBeforeNoexceptSpecifier = FormatStyle::BBNSS_Never; in getLLVMStyle()
1439 LLVMStyle.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never; in getLLVMStyle()
1444 LLVMStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; in getLLVMStyle()
1445 LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getLLVMStyle()
1446 LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All; in getLLVMStyle()
1448 LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getLLVMStyle()
1453 LLVMStyle.BitFieldColonSpacing = FormatStyle::BFCS_Both; in getLLVMStyle()
1457 /*AfterControlStatement=*/FormatStyle::BWACS_Never, in getLLVMStyle()
1474 LLVMStyle.BreakAfterAttributes = FormatStyle::ABS_Leave; in getLLVMStyle()
1476 LLVMStyle.BreakAfterReturnType = FormatStyle::RTBS_None; in getLLVMStyle()
1478 LLVMStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_None; in getLLVMStyle()
1479 LLVMStyle.BreakBeforeBraces = FormatStyle::BS_Attach; in getLLVMStyle()
1480 LLVMStyle.BreakBeforeConceptDeclarations = FormatStyle::BBCDS_Always; in getLLVMStyle()
1481 LLVMStyle.BreakBeforeInlineASMColon = FormatStyle::BBIAS_OnlyMultiline; in getLLVMStyle()
1483 LLVMStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon; in getLLVMStyle()
1485 LLVMStyle.BreakInheritanceList = FormatStyle::BILS_BeforeColon; in getLLVMStyle()
1487 LLVMStyle.BreakTemplateDeclarations = FormatStyle::BTDS_MultiLine; in getLLVMStyle()
1496 LLVMStyle.EmptyLineAfterAccessModifier = FormatStyle::ELAAMS_Never; in getLLVMStyle()
1497 LLVMStyle.EmptyLineBeforeAccessModifier = FormatStyle::ELBAMS_LogicalBlock; in getLLVMStyle()
1514 LLVMStyle.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in getLLVMStyle()
1516 LLVMStyle.IndentPPDirectives = FormatStyle::PPDIS_None; in getLLVMStyle()
1523 LLVMStyle.InsertTrailingCommas = FormatStyle::TCS_None; in getLLVMStyle()
1528 LLVMStyle.JavaScriptQuotes = FormatStyle::JSQS_Leave; in getLLVMStyle()
1535 LLVMStyle.LambdaBodyIndentation = FormatStyle::LBI_Signature; in getLLVMStyle()
1537 LLVMStyle.LineEnding = FormatStyle::LE_DeriveLF; in getLLVMStyle()
1539 LLVMStyle.NamespaceIndentation = FormatStyle::NI_None; in getLLVMStyle()
1540 LLVMStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Auto; in getLLVMStyle()
1545 LLVMStyle.PackConstructorInitializers = FormatStyle::PCIS_BinPack; in getLLVMStyle()
1546 LLVMStyle.PointerAlignment = FormatStyle::PAS_Right; in getLLVMStyle()
1548 LLVMStyle.QualifierAlignment = FormatStyle::QAS_Leave; in getLLVMStyle()
1549 LLVMStyle.ReferenceAlignment = FormatStyle::RAS_Pointer; in getLLVMStyle()
1552 LLVMStyle.RemoveParentheses = FormatStyle::RPS_Leave; in getLLVMStyle()
1554 LLVMStyle.RequiresClausePosition = FormatStyle::RCPS_OwnLine; in getLLVMStyle()
1555 LLVMStyle.RequiresExpressionIndentation = FormatStyle::REI_OuterScope; in getLLVMStyle()
1556 LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave; in getLLVMStyle()
1559 LLVMStyle.SortIncludes = FormatStyle::SI_CaseSensitive; in getLLVMStyle()
1560 LLVMStyle.SortJavaStaticImport = FormatStyle::SJSIO_Before; in getLLVMStyle()
1561 LLVMStyle.SortUsingDeclarations = FormatStyle::SUD_LexicographicNumeric; in getLLVMStyle()
1565 LLVMStyle.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Default; in getLLVMStyle()
1572 LLVMStyle.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements; in getLLVMStyle()
1581 LLVMStyle.SpacesInAngles = FormatStyle::SIAS_Never; in getLLVMStyle()
1584 LLVMStyle.SpacesInParens = FormatStyle::SIPO_Never; in getLLVMStyle()
1586 LLVMStyle.Standard = FormatStyle::LS_Latest; in getLLVMStyle()
1591 LLVMStyle.TableGenBreakInsideDAGArg = FormatStyle::DAS_DontBreak; in getLLVMStyle()
1593 LLVMStyle.UseTab = FormatStyle::UT_Never; in getLLVMStyle()
1615 case FormatStyle::LK_TableGen: in getLLVMStyle()
1618 case FormatStyle::LK_Json: in getLLVMStyle()
1621 case FormatStyle::LK_Verilog: in getLLVMStyle()
1632 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { in getGoogleStyle()
1633 if (Language == FormatStyle::LK_TextProto) { in getGoogleStyle()
1634 FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto); in getGoogleStyle()
1635 GoogleStyle.Language = FormatStyle::LK_TextProto; in getGoogleStyle()
1640 FormatStyle GoogleStyle = getLLVMStyle(Language); in getGoogleStyle()
1643 GoogleStyle.AlignEscapedNewlines = FormatStyle::ENAS_Left; in getGoogleStyle()
1645 FormatStyle::SIS_WithoutElse; in getGoogleStyle()
1648 GoogleStyle.BreakTemplateDeclarations = FormatStyle::BTDS_Yes; in getGoogleStyle()
1658 GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never; in getGoogleStyle()
1661 GoogleStyle.PackConstructorInitializers = FormatStyle::PCIS_NextLine; in getGoogleStyle()
1662 GoogleStyle.PointerAlignment = FormatStyle::PAS_Left; in getGoogleStyle()
1665 FormatStyle::LK_Cpp, in getGoogleStyle()
1682 FormatStyle::LK_TextProto, in getGoogleStyle()
1708 GoogleStyle.Standard = FormatStyle::LS_Auto; in getGoogleStyle()
1713 if (Language == FormatStyle::LK_Java) { in getGoogleStyle()
1714 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getGoogleStyle()
1715 GoogleStyle.AlignOperands = FormatStyle::OAS_DontAlign; in getGoogleStyle()
1717 GoogleStyle.AlignTrailingComments.Kind = FormatStyle::TCAS_Never; in getGoogleStyle()
1718 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1719 GoogleStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getGoogleStyle()
1721 GoogleStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment; in getGoogleStyle()
1725 } else if (Language == FormatStyle::LK_JavaScript) { in getGoogleStyle()
1726 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak; in getGoogleStyle()
1727 GoogleStyle.AlignOperands = FormatStyle::OAS_DontAlign; in getGoogleStyle()
1728 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1730 GoogleStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_Empty; in getGoogleStyle()
1739 GoogleStyle.JavaScriptQuotes = FormatStyle::JSQS_Single; in getGoogleStyle()
1742 GoogleStyle.NamespaceIndentation = FormatStyle::NI_All; in getGoogleStyle()
1744 } else if (Language == FormatStyle::LK_Proto) { in getGoogleStyle()
1745 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1755 } else if (Language == FormatStyle::LK_ObjC) { in getGoogleStyle()
1763 } else if (Language == FormatStyle::LK_CSharp) { in getGoogleStyle()
1764 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1765 GoogleStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getGoogleStyle()
1768 GoogleStyle.NamespaceIndentation = FormatStyle::NI_All; in getGoogleStyle()
1774 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { in getChromiumStyle()
1775 FormatStyle ChromiumStyle = getGoogleStyle(Language); in getChromiumStyle()
1797 if (Language == FormatStyle::LK_Java) { in getChromiumStyle()
1799 FormatStyle::SIS_WithoutElse; in getChromiumStyle()
1817 ChromiumStyle.SortIncludes = FormatStyle::SI_CaseSensitive; in getChromiumStyle()
1818 } else if (Language == FormatStyle::LK_JavaScript) { in getChromiumStyle()
1819 ChromiumStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getChromiumStyle()
1823 ChromiumStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; in getChromiumStyle()
1824 ChromiumStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getChromiumStyle()
1828 if (Language == FormatStyle::LK_ObjC) in getChromiumStyle()
1834 FormatStyle getMozillaStyle() { in getMozillaStyle()
1835 FormatStyle MozillaStyle = getLLVMStyle(); in getMozillaStyle()
1837 MozillaStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; in getMozillaStyle()
1839 FormatStyle::DRTBS_TopLevel; in getMozillaStyle()
1842 MozillaStyle.BreakAfterReturnType = FormatStyle::RTBS_TopLevel; in getMozillaStyle()
1843 MozillaStyle.BreakBeforeBraces = FormatStyle::BS_Mozilla; in getMozillaStyle()
1844 MozillaStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getMozillaStyle()
1845 MozillaStyle.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in getMozillaStyle()
1846 MozillaStyle.BreakTemplateDeclarations = FormatStyle::BTDS_Yes; in getMozillaStyle()
1855 MozillaStyle.PointerAlignment = FormatStyle::PAS_Left; in getMozillaStyle()
1860 FormatStyle getWebKitStyle() { in getWebKitStyle()
1861 FormatStyle Style = getLLVMStyle(); in getWebKitStyle()
1863 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getWebKitStyle()
1864 Style.AlignOperands = FormatStyle::OAS_DontAlign; in getWebKitStyle()
1866 Style.AlignTrailingComments.Kind = FormatStyle::TCAS_Never; in getWebKitStyle()
1867 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty; in getWebKitStyle()
1868 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getWebKitStyle()
1869 Style.BreakBeforeBraces = FormatStyle::BS_WebKit; in getWebKitStyle()
1870 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getWebKitStyle()
1875 Style.NamespaceIndentation = FormatStyle::NI_Inner; in getWebKitStyle()
1878 Style.PointerAlignment = FormatStyle::PAS_Left; in getWebKitStyle()
1884 FormatStyle getGNUStyle() { in getGNUStyle()
1885 FormatStyle Style = getLLVMStyle(); in getGNUStyle()
1886 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; in getGNUStyle()
1887 Style.BreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in getGNUStyle()
1888 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getGNUStyle()
1889 Style.BreakBeforeBraces = FormatStyle::BS_GNU; in getGNUStyle()
1894 Style.SpaceBeforeParens = FormatStyle::SBPO_Always; in getGNUStyle()
1895 Style.Standard = FormatStyle::LS_Cpp03; in getGNUStyle()
1899 FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language) { in getMicrosoftStyle()
1900 FormatStyle Style = getLLVMStyle(Language); in getMicrosoftStyle()
1904 Style.UseTab = FormatStyle::UT_Never; in getMicrosoftStyle()
1905 Style.BreakBeforeBraces = FormatStyle::BS_Custom; in getMicrosoftStyle()
1907 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in getMicrosoftStyle()
1919 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None; in getMicrosoftStyle()
1921 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getMicrosoftStyle()
1923 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getMicrosoftStyle()
1924 Style.BreakAfterReturnType = FormatStyle::RTBS_None; in getMicrosoftStyle()
1928 FormatStyle getClangFormatStyle() { in getClangFormatStyle()
1929 FormatStyle Style = getLLVMStyle(); in getClangFormatStyle()
1934 Style.LineEnding = FormatStyle::LE_LF; in getClangFormatStyle()
1936 Style.RemoveParentheses = FormatStyle::RPS_ReturnStatement; in getClangFormatStyle()
1941 FormatStyle getNoStyle() { in getNoStyle()
1942 FormatStyle NoStyle = getLLVMStyle(); in getNoStyle()
1944 NoStyle.SortIncludes = FormatStyle::SI_Never; in getNoStyle()
1945 NoStyle.SortUsingDeclarations = FormatStyle::SUD_Never; in getNoStyle()
1949 bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language, in getPredefinedStyle()
1950 FormatStyle *Style) { in getPredefinedStyle()
1978 ParseError validateQualifierOrder(FormatStyle *Style) { in validateQualifierOrder()
2011 FormatStyle *Style, bool AllowUnknownOptions, in parseConfiguration()
2015 FormatStyle::LanguageKind Language = Style->Language; in parseConfiguration()
2016 assert(Language != FormatStyle::LK_None); in parseConfiguration()
2020 std::vector<FormatStyle> Styles; in parseConfiguration()
2035 if (Styles[i].Language == FormatStyle::LK_None && i != 0) in parseConfiguration()
2050 FormatStyle::FormatStyleSet StyleSet; in parseConfiguration()
2052 for (const FormatStyle &Style : llvm::reverse(Styles)) { in parseConfiguration()
2053 if (Style.Language != FormatStyle::LK_None) in parseConfiguration()
2059 if (Styles.empty() || Styles[0].Language != FormatStyle::LK_None) in parseConfiguration()
2061 FormatStyle DefaultStyle = Styles[0]; in parseConfiguration()
2066 if (Style->InsertTrailingCommas != FormatStyle::TCS_None && in parseConfiguration()
2071 if (Style->QualifierAlignment != FormatStyle::QAS_Leave) in parseConfiguration()
2076 std::string configurationAsText(const FormatStyle &Style) { in configurationAsText()
2082 FormatStyle NonConstStyle = Style; in configurationAsText()
2091 std::optional<FormatStyle>
2092 FormatStyle::FormatStyleSet::Get(FormatStyle::LanguageKind Language) const { in Get()
2098 FormatStyle Style = It->second; in Get()
2103 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) { in Add()
2114 void FormatStyle::FormatStyleSet::Clear() { Styles.reset(); } in Clear()
2116 std::optional<FormatStyle>
2117 FormatStyle::GetLanguageStyle(FormatStyle::LanguageKind Language) const { in GetLanguageStyle()
2125 ParensRemover(const Environment &Env, const FormatStyle &Style) in ParensRemover()
2169 BracesInserter(const Environment &Env, const FormatStyle &Style) in BracesInserter()
2222 BracesRemover(const Environment &Env, const FormatStyle &Style) in BracesRemover()
2273 SemiRemover(const Environment &Env, const FormatStyle &Style) in SemiRemover()
2333 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style) in JavaScriptRequoter()
2361 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single && in requoteJSStringLiteral()
2363 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double && in requoteJSStringLiteral()
2369 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single; in requoteJSStringLiteral()
2421 Formatter(const Environment &Env, const FormatStyle &Style, in Formatter()
2438 Style.LineEnding > FormatStyle::LE_CRLF in analyze()
2441 Style.LineEnding == FormatStyle::LE_DeriveCRLF) in analyze()
2442 : Style.LineEnding == FormatStyle::LE_CRLF); in analyze()
2532 Style.PointerAlignment = FormatStyle::PAS_Right; in deriveLocalStyle()
2534 Style.PointerAlignment = FormatStyle::PAS_Left; in deriveLocalStyle()
2535 Style.ReferenceAlignment = FormatStyle::RAS_Pointer; in deriveLocalStyle()
2537 if (Style.Standard == FormatStyle::LS_Auto) { in deriveLocalStyle()
2539 ? FormatStyle::LS_Latest in deriveLocalStyle()
2540 : FormatStyle::LS_Cpp03; in deriveLocalStyle()
2563 TrailingCommaInserter(const Environment &Env, const FormatStyle &Style) in TrailingCommaInserter()
2624 Cleaner(const Environment &Env, const FormatStyle &Style) in Cleaner()
2847 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style) in ObjCHeaderStyleGuesser()
2854 assert(Style.Language == FormatStyle::LK_Cpp); in analyze()
3075 static void sortCppIncludes(const FormatStyle &Style, in sortCppIncludes()
3090 if (Style.SortIncludes == FormatStyle::SI_CaseInsensitive) { in sortCppIncludes()
3176 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, in sortCppIncludes()
3291 static unsigned findJavaImportGroup(const FormatStyle &Style, in findJavaImportGroup()
3311 static void sortJavaImports(const FormatStyle &Style, in sortJavaImports()
3330 Style.SortJavaStaticImport == FormatStyle::SJSIO_After; in sortJavaImports()
3393 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code, in sortJavaImports()
3454 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, in sortIncludes()
3462 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && in sortIncludes()
3466 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript) in sortIncludes()
3468 if (Style.Language == FormatStyle::LanguageKind::LK_Java) in sortIncludes()
3478 const FormatStyle &Style) { in processReplacements()
3496 const FormatStyle &Style) { in formatReplacements()
3499 auto SortIncludes = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
3511 auto Reformat = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
3534 const FormatStyle &Style) { in fixCppIncludeInsertions()
3606 const FormatStyle &Style) { in cleanupAroundReplacements()
3609 auto Cleanup = [](const FormatStyle &Style, StringRef Code, in cleanupAroundReplacements()
3622 reformat(const FormatStyle &Style, StringRef Code, in reformat()
3626 FormatStyle Expanded = Style; in reformat()
3632 Expanded.RemoveParentheses = FormatStyle::RPS_Leave; in reformat()
3635 case FormatStyle::RCPS_SingleLine: in reformat()
3636 case FormatStyle::RCPS_WithPreceding: in reformat()
3647 if (Expanded.Language == FormatStyle::LK_JavaScript && isMpegTS(Code)) in reformat()
3685 if (Style.QualifierAlignment != FormatStyle::QAS_Leave) in reformat()
3688 if (Style.RemoveParentheses != FormatStyle::RPS_Leave) { in reformat()
3689 FormatStyle S = Expanded; in reformat()
3697 FormatStyle S = Expanded; in reformat()
3705 FormatStyle S = Expanded; in reformat()
3713 FormatStyle S = Expanded; in reformat()
3726 if (Style.SortUsingDeclarations != FormatStyle::SUD_Never) { in reformat()
3733 if (Style.SeparateDefinitionBlocks != FormatStyle::SDS_Leave) { in reformat()
3739 if (Style.Language == FormatStyle::LK_ObjC && in reformat()
3747 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave) { in reformat()
3758 Style.InsertTrailingCommas == FormatStyle::TCS_Wrapped) { in reformat()
3786 if (Style.QualifierAlignment != FormatStyle::QAS_Leave) { in reformat()
3808 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat()
3819 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, in cleanup()
3823 if (Style.Language != FormatStyle::LK_Cpp) in cleanup()
3831 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat()
3841 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, in fixNamespaceEndComments()
3851 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, in sortUsingDeclarations()
3861 LangOptions getFormattingLangOpts(const FormatStyle &Style) { in getFormattingLangOpts()
3864 FormatStyle::LanguageStandard LexingStd = Style.Standard; in getFormattingLangOpts()
3865 if (LexingStd == FormatStyle::LS_Auto) in getFormattingLangOpts()
3866 LexingStd = FormatStyle::LS_Latest; in getFormattingLangOpts()
3867 if (LexingStd == FormatStyle::LS_Latest) in getFormattingLangOpts()
3868 LexingStd = FormatStyle::LS_Cpp20; in getFormattingLangOpts()
3870 LangOpts.CPlusPlus11 = LexingStd >= FormatStyle::LS_Cpp11; in getFormattingLangOpts()
3871 LangOpts.CPlusPlus14 = LexingStd >= FormatStyle::LS_Cpp14; in getFormattingLangOpts()
3872 LangOpts.CPlusPlus17 = LexingStd >= FormatStyle::LS_Cpp17; in getFormattingLangOpts()
3873 LangOpts.CPlusPlus20 = LexingStd >= FormatStyle::LS_Cpp20; in getFormattingLangOpts()
3874 LangOpts.Char8 = LexingStd >= FormatStyle::LS_Cpp20; in getFormattingLangOpts()
3878 LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; in getFormattingLangOpts()
3905 static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) { in getLanguageByFileName()
3907 return FormatStyle::LK_Java; in getLanguageByFileName()
3911 return FormatStyle::LK_JavaScript; // (module) JavaScript or TypeScript. in getLanguageByFileName()
3914 return FormatStyle::LK_ObjC; in getLanguageByFileName()
3917 return FormatStyle::LK_Proto; in getLanguageByFileName()
3927 return FormatStyle::LK_TextProto; in getLanguageByFileName()
3930 return FormatStyle::LK_TableGen; in getLanguageByFileName()
3932 return FormatStyle::LK_CSharp; in getLanguageByFileName()
3934 return FormatStyle::LK_Json; in getLanguageByFileName()
3939 return FormatStyle::LK_Verilog; in getLanguageByFileName()
3941 return FormatStyle::LK_Cpp; in getLanguageByFileName()
3944 FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code) { in guessLanguage()
3946 if (GuessedLanguage == FormatStyle::LK_Cpp) { in guessLanguage()
3956 return FormatStyle::LK_ObjC; in guessLanguage()
3969 FormatStyle *Style, bool AllowUnknownOptions, in loadAndParseConfigFile()
3982 Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName, in getStyle()
3987 FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code)); in getStyle()
3988 FormatStyle FallbackStyle = getNoStyle(); in getStyle()
4057 auto applyChildFormatTexts = [&](FormatStyle *Style) { in getStyle()