Lines Matching refs:FormatStyle
50 using clang::format::FormatStyle;
52 LLVM_YAML_IS_SEQUENCE_VECTOR(clang::format::FormatStyle::RawStringFormat)
56 template <> struct ScalarEnumerationTraits<FormatStyle::LanguageKind> {
57 static void enumeration(IO &IO, FormatStyle::LanguageKind &Value) { in enumeration()
58 IO.enumCase(Value, "Cpp", FormatStyle::LK_Cpp); in enumeration()
59 IO.enumCase(Value, "Java", FormatStyle::LK_Java); in enumeration()
60 IO.enumCase(Value, "JavaScript", FormatStyle::LK_JavaScript); in enumeration()
61 IO.enumCase(Value, "ObjC", FormatStyle::LK_ObjC); in enumeration()
62 IO.enumCase(Value, "Proto", FormatStyle::LK_Proto); in enumeration()
63 IO.enumCase(Value, "TableGen", FormatStyle::LK_TableGen); in enumeration()
64 IO.enumCase(Value, "TextProto", FormatStyle::LK_TextProto); in enumeration()
65 IO.enumCase(Value, "CSharp", FormatStyle::LK_CSharp); in enumeration()
66 IO.enumCase(Value, "Json", FormatStyle::LK_Json); in enumeration()
70 template <> struct ScalarEnumerationTraits<FormatStyle::LanguageStandard> {
71 static void enumeration(IO &IO, FormatStyle::LanguageStandard &Value) { in enumeration()
72 IO.enumCase(Value, "c++03", FormatStyle::LS_Cpp03); in enumeration()
73 IO.enumCase(Value, "C++03", FormatStyle::LS_Cpp03); // Legacy alias in enumeration()
74 IO.enumCase(Value, "Cpp03", FormatStyle::LS_Cpp03); // Legacy alias in enumeration()
76 IO.enumCase(Value, "c++11", FormatStyle::LS_Cpp11); in enumeration()
77 IO.enumCase(Value, "C++11", FormatStyle::LS_Cpp11); // Legacy alias in enumeration()
79 IO.enumCase(Value, "c++14", FormatStyle::LS_Cpp14); in enumeration()
80 IO.enumCase(Value, "c++17", FormatStyle::LS_Cpp17); in enumeration()
81 IO.enumCase(Value, "c++20", FormatStyle::LS_Cpp20); in enumeration()
83 IO.enumCase(Value, "Latest", FormatStyle::LS_Latest); in enumeration()
84 IO.enumCase(Value, "Cpp11", FormatStyle::LS_Latest); // Legacy alias in enumeration()
85 IO.enumCase(Value, "Auto", FormatStyle::LS_Auto); in enumeration()
90 struct ScalarEnumerationTraits<FormatStyle::LambdaBodyIndentationKind> {
92 FormatStyle::LambdaBodyIndentationKind &Value) { in enumeration()
93 IO.enumCase(Value, "Signature", FormatStyle::LBI_Signature); in enumeration()
94 IO.enumCase(Value, "OuterScope", FormatStyle::LBI_OuterScope); in enumeration()
98 template <> struct ScalarEnumerationTraits<FormatStyle::UseTabStyle> {
99 static void enumeration(IO &IO, FormatStyle::UseTabStyle &Value) { in enumeration()
100 IO.enumCase(Value, "Never", FormatStyle::UT_Never); in enumeration()
101 IO.enumCase(Value, "false", FormatStyle::UT_Never); in enumeration()
102 IO.enumCase(Value, "Always", FormatStyle::UT_Always); in enumeration()
103 IO.enumCase(Value, "true", FormatStyle::UT_Always); in enumeration()
104 IO.enumCase(Value, "ForIndentation", FormatStyle::UT_ForIndentation); in enumeration()
106 FormatStyle::UT_ForContinuationAndIndentation); in enumeration()
107 IO.enumCase(Value, "AlignWithSpaces", FormatStyle::UT_AlignWithSpaces); in enumeration()
111 template <> struct ScalarEnumerationTraits<FormatStyle::JavaScriptQuoteStyle> {
112 static void enumeration(IO &IO, FormatStyle::JavaScriptQuoteStyle &Value) { in enumeration()
113 IO.enumCase(Value, "Leave", FormatStyle::JSQS_Leave); in enumeration()
114 IO.enumCase(Value, "Single", FormatStyle::JSQS_Single); in enumeration()
115 IO.enumCase(Value, "Double", FormatStyle::JSQS_Double); in enumeration()
119 template <> struct ScalarEnumerationTraits<FormatStyle::ShortBlockStyle> {
120 static void enumeration(IO &IO, FormatStyle::ShortBlockStyle &Value) { in enumeration()
121 IO.enumCase(Value, "Never", FormatStyle::SBS_Never); in enumeration()
122 IO.enumCase(Value, "false", FormatStyle::SBS_Never); in enumeration()
123 IO.enumCase(Value, "Always", FormatStyle::SBS_Always); in enumeration()
124 IO.enumCase(Value, "true", FormatStyle::SBS_Always); in enumeration()
125 IO.enumCase(Value, "Empty", FormatStyle::SBS_Empty); in enumeration()
129 template <> struct ScalarEnumerationTraits<FormatStyle::ShortFunctionStyle> {
130 static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) { in enumeration()
131 IO.enumCase(Value, "None", FormatStyle::SFS_None); in enumeration()
132 IO.enumCase(Value, "false", FormatStyle::SFS_None); in enumeration()
133 IO.enumCase(Value, "All", FormatStyle::SFS_All); in enumeration()
134 IO.enumCase(Value, "true", FormatStyle::SFS_All); in enumeration()
135 IO.enumCase(Value, "Inline", FormatStyle::SFS_Inline); in enumeration()
136 IO.enumCase(Value, "InlineOnly", FormatStyle::SFS_InlineOnly); in enumeration()
137 IO.enumCase(Value, "Empty", FormatStyle::SFS_Empty); in enumeration()
141 template <> struct ScalarEnumerationTraits<FormatStyle::AlignConsecutiveStyle> {
142 static void enumeration(IO &IO, FormatStyle::AlignConsecutiveStyle &Value) { in enumeration()
143 IO.enumCase(Value, "None", FormatStyle::ACS_None); in enumeration()
144 IO.enumCase(Value, "Consecutive", FormatStyle::ACS_Consecutive); in enumeration()
145 IO.enumCase(Value, "AcrossEmptyLines", FormatStyle::ACS_AcrossEmptyLines); in enumeration()
146 IO.enumCase(Value, "AcrossComments", FormatStyle::ACS_AcrossComments); in enumeration()
148 FormatStyle::ACS_AcrossEmptyLinesAndComments); in enumeration()
151 IO.enumCase(Value, "true", FormatStyle::ACS_Consecutive); in enumeration()
152 IO.enumCase(Value, "false", FormatStyle::ACS_None); in enumeration()
157 struct ScalarEnumerationTraits<FormatStyle::ArrayInitializerAlignmentStyle> {
159 FormatStyle::ArrayInitializerAlignmentStyle &Value) { in enumeration()
160 IO.enumCase(Value, "None", FormatStyle::AIAS_None); in enumeration()
161 IO.enumCase(Value, "Left", FormatStyle::AIAS_Left); in enumeration()
162 IO.enumCase(Value, "Right", FormatStyle::AIAS_Right); in enumeration()
166 template <> struct ScalarEnumerationTraits<FormatStyle::ShortIfStyle> {
167 static void enumeration(IO &IO, FormatStyle::ShortIfStyle &Value) { in enumeration()
168 IO.enumCase(Value, "Never", FormatStyle::SIS_Never); in enumeration()
169 IO.enumCase(Value, "WithoutElse", FormatStyle::SIS_WithoutElse); in enumeration()
170 IO.enumCase(Value, "OnlyFirstIf", FormatStyle::SIS_OnlyFirstIf); in enumeration()
171 IO.enumCase(Value, "AllIfsAndElse", FormatStyle::SIS_AllIfsAndElse); in enumeration()
174 IO.enumCase(Value, "Always", FormatStyle::SIS_OnlyFirstIf); in enumeration()
175 IO.enumCase(Value, "false", FormatStyle::SIS_Never); in enumeration()
176 IO.enumCase(Value, "true", FormatStyle::SIS_WithoutElse); in enumeration()
180 template <> struct ScalarEnumerationTraits<FormatStyle::ShortLambdaStyle> {
181 static void enumeration(IO &IO, FormatStyle::ShortLambdaStyle &Value) { in enumeration()
182 IO.enumCase(Value, "None", FormatStyle::SLS_None); in enumeration()
183 IO.enumCase(Value, "false", FormatStyle::SLS_None); in enumeration()
184 IO.enumCase(Value, "Empty", FormatStyle::SLS_Empty); in enumeration()
185 IO.enumCase(Value, "Inline", FormatStyle::SLS_Inline); in enumeration()
186 IO.enumCase(Value, "All", FormatStyle::SLS_All); in enumeration()
187 IO.enumCase(Value, "true", FormatStyle::SLS_All); in enumeration()
191 template <> struct ScalarEnumerationTraits<FormatStyle::BinPackStyle> {
192 static void enumeration(IO &IO, FormatStyle::BinPackStyle &Value) { in enumeration()
193 IO.enumCase(Value, "Auto", FormatStyle::BPS_Auto); in enumeration()
194 IO.enumCase(Value, "Always", FormatStyle::BPS_Always); in enumeration()
195 IO.enumCase(Value, "Never", FormatStyle::BPS_Never); in enumeration()
199 template <> struct ScalarEnumerationTraits<FormatStyle::TrailingCommaStyle> {
200 static void enumeration(IO &IO, FormatStyle::TrailingCommaStyle &Value) { in enumeration()
201 IO.enumCase(Value, "None", FormatStyle::TCS_None); in enumeration()
202 IO.enumCase(Value, "Wrapped", FormatStyle::TCS_Wrapped); in enumeration()
206 template <> struct ScalarEnumerationTraits<FormatStyle::BinaryOperatorStyle> {
207 static void enumeration(IO &IO, FormatStyle::BinaryOperatorStyle &Value) { in enumeration()
208 IO.enumCase(Value, "All", FormatStyle::BOS_All); in enumeration()
209 IO.enumCase(Value, "true", FormatStyle::BOS_All); in enumeration()
210 IO.enumCase(Value, "None", FormatStyle::BOS_None); in enumeration()
211 IO.enumCase(Value, "false", FormatStyle::BOS_None); in enumeration()
212 IO.enumCase(Value, "NonAssignment", FormatStyle::BOS_NonAssignment); in enumeration()
216 template <> struct ScalarEnumerationTraits<FormatStyle::BraceBreakingStyle> {
217 static void enumeration(IO &IO, FormatStyle::BraceBreakingStyle &Value) { in enumeration()
218 IO.enumCase(Value, "Attach", FormatStyle::BS_Attach); in enumeration()
219 IO.enumCase(Value, "Linux", FormatStyle::BS_Linux); in enumeration()
220 IO.enumCase(Value, "Mozilla", FormatStyle::BS_Mozilla); in enumeration()
221 IO.enumCase(Value, "Stroustrup", FormatStyle::BS_Stroustrup); in enumeration()
222 IO.enumCase(Value, "Allman", FormatStyle::BS_Allman); in enumeration()
223 IO.enumCase(Value, "Whitesmiths", FormatStyle::BS_Whitesmiths); in enumeration()
224 IO.enumCase(Value, "GNU", FormatStyle::BS_GNU); in enumeration()
225 IO.enumCase(Value, "WebKit", FormatStyle::BS_WebKit); in enumeration()
226 IO.enumCase(Value, "Custom", FormatStyle::BS_Custom); in enumeration()
232 FormatStyle::BraceWrappingAfterControlStatementStyle> {
235 FormatStyle::BraceWrappingAfterControlStatementStyle &Value) { in enumeration()
236 IO.enumCase(Value, "Never", FormatStyle::BWACS_Never); in enumeration()
237 IO.enumCase(Value, "MultiLine", FormatStyle::BWACS_MultiLine); in enumeration()
238 IO.enumCase(Value, "Always", FormatStyle::BWACS_Always); in enumeration()
241 IO.enumCase(Value, "false", FormatStyle::BWACS_Never); in enumeration()
242 IO.enumCase(Value, "true", FormatStyle::BWACS_Always); in enumeration()
247 struct ScalarEnumerationTraits<FormatStyle::BreakConstructorInitializersStyle> {
249 enumeration(IO &IO, FormatStyle::BreakConstructorInitializersStyle &Value) { in enumeration()
250 IO.enumCase(Value, "BeforeColon", FormatStyle::BCIS_BeforeColon); in enumeration()
251 IO.enumCase(Value, "BeforeComma", FormatStyle::BCIS_BeforeComma); in enumeration()
252 IO.enumCase(Value, "AfterColon", FormatStyle::BCIS_AfterColon); in enumeration()
257 struct ScalarEnumerationTraits<FormatStyle::BreakInheritanceListStyle> {
259 FormatStyle::BreakInheritanceListStyle &Value) { in enumeration()
260 IO.enumCase(Value, "BeforeColon", FormatStyle::BILS_BeforeColon); in enumeration()
261 IO.enumCase(Value, "BeforeComma", FormatStyle::BILS_BeforeComma); in enumeration()
262 IO.enumCase(Value, "AfterColon", FormatStyle::BILS_AfterColon); in enumeration()
263 IO.enumCase(Value, "AfterComma", FormatStyle::BILS_AfterComma); in enumeration()
268 struct ScalarEnumerationTraits<FormatStyle::EmptyLineAfterAccessModifierStyle> {
270 enumeration(IO &IO, FormatStyle::EmptyLineAfterAccessModifierStyle &Value) { in enumeration()
271 IO.enumCase(Value, "Never", FormatStyle::ELAAMS_Never); in enumeration()
272 IO.enumCase(Value, "Leave", FormatStyle::ELAAMS_Leave); in enumeration()
273 IO.enumCase(Value, "Always", FormatStyle::ELAAMS_Always); in enumeration()
279 FormatStyle::EmptyLineBeforeAccessModifierStyle> {
281 enumeration(IO &IO, FormatStyle::EmptyLineBeforeAccessModifierStyle &Value) { in enumeration()
282 IO.enumCase(Value, "Never", FormatStyle::ELBAMS_Never); in enumeration()
283 IO.enumCase(Value, "Leave", FormatStyle::ELBAMS_Leave); in enumeration()
284 IO.enumCase(Value, "LogicalBlock", FormatStyle::ELBAMS_LogicalBlock); in enumeration()
285 IO.enumCase(Value, "Always", FormatStyle::ELBAMS_Always); in enumeration()
290 struct ScalarEnumerationTraits<FormatStyle::PPDirectiveIndentStyle> {
291 static void enumeration(IO &IO, FormatStyle::PPDirectiveIndentStyle &Value) { in enumeration()
292 IO.enumCase(Value, "None", FormatStyle::PPDIS_None); in enumeration()
293 IO.enumCase(Value, "AfterHash", FormatStyle::PPDIS_AfterHash); in enumeration()
294 IO.enumCase(Value, "BeforeHash", FormatStyle::PPDIS_BeforeHash); in enumeration()
299 struct ScalarEnumerationTraits<FormatStyle::IndentExternBlockStyle> {
300 static void enumeration(IO &IO, FormatStyle::IndentExternBlockStyle &Value) { in enumeration()
301 IO.enumCase(Value, "AfterExternBlock", FormatStyle::IEBS_AfterExternBlock); in enumeration()
302 IO.enumCase(Value, "Indent", FormatStyle::IEBS_Indent); in enumeration()
303 IO.enumCase(Value, "NoIndent", FormatStyle::IEBS_NoIndent); in enumeration()
304 IO.enumCase(Value, "true", FormatStyle::IEBS_Indent); in enumeration()
305 IO.enumCase(Value, "false", FormatStyle::IEBS_NoIndent); in enumeration()
310 struct ScalarEnumerationTraits<FormatStyle::ReturnTypeBreakingStyle> {
311 static void enumeration(IO &IO, FormatStyle::ReturnTypeBreakingStyle &Value) { in enumeration()
312 IO.enumCase(Value, "None", FormatStyle::RTBS_None); in enumeration()
313 IO.enumCase(Value, "All", FormatStyle::RTBS_All); in enumeration()
314 IO.enumCase(Value, "TopLevel", FormatStyle::RTBS_TopLevel); in enumeration()
316 FormatStyle::RTBS_TopLevelDefinitions); in enumeration()
317 IO.enumCase(Value, "AllDefinitions", FormatStyle::RTBS_AllDefinitions); in enumeration()
322 struct ScalarEnumerationTraits<FormatStyle::BreakTemplateDeclarationsStyle> {
324 FormatStyle::BreakTemplateDeclarationsStyle &Value) { in enumeration()
325 IO.enumCase(Value, "No", FormatStyle::BTDS_No); in enumeration()
326 IO.enumCase(Value, "MultiLine", FormatStyle::BTDS_MultiLine); in enumeration()
327 IO.enumCase(Value, "Yes", FormatStyle::BTDS_Yes); in enumeration()
330 IO.enumCase(Value, "false", FormatStyle::BTDS_MultiLine); in enumeration()
331 IO.enumCase(Value, "true", FormatStyle::BTDS_Yes); in enumeration()
336 struct ScalarEnumerationTraits<FormatStyle::DefinitionReturnTypeBreakingStyle> {
338 enumeration(IO &IO, FormatStyle::DefinitionReturnTypeBreakingStyle &Value) { in enumeration()
339 IO.enumCase(Value, "None", FormatStyle::DRTBS_None); in enumeration()
340 IO.enumCase(Value, "All", FormatStyle::DRTBS_All); in enumeration()
341 IO.enumCase(Value, "TopLevel", FormatStyle::DRTBS_TopLevel); in enumeration()
344 IO.enumCase(Value, "false", FormatStyle::DRTBS_None); in enumeration()
345 IO.enumCase(Value, "true", FormatStyle::DRTBS_All); in enumeration()
350 struct ScalarEnumerationTraits<FormatStyle::NamespaceIndentationKind> {
352 FormatStyle::NamespaceIndentationKind &Value) { in enumeration()
353 IO.enumCase(Value, "None", FormatStyle::NI_None); in enumeration()
354 IO.enumCase(Value, "Inner", FormatStyle::NI_Inner); in enumeration()
355 IO.enumCase(Value, "All", FormatStyle::NI_All); in enumeration()
359 template <> struct ScalarEnumerationTraits<FormatStyle::BracketAlignmentStyle> {
360 static void enumeration(IO &IO, FormatStyle::BracketAlignmentStyle &Value) { in enumeration()
361 IO.enumCase(Value, "Align", FormatStyle::BAS_Align); in enumeration()
362 IO.enumCase(Value, "DontAlign", FormatStyle::BAS_DontAlign); in enumeration()
363 IO.enumCase(Value, "AlwaysBreak", FormatStyle::BAS_AlwaysBreak); in enumeration()
366 IO.enumCase(Value, "true", FormatStyle::BAS_Align); in enumeration()
367 IO.enumCase(Value, "false", FormatStyle::BAS_DontAlign); in enumeration()
372 struct ScalarEnumerationTraits<FormatStyle::EscapedNewlineAlignmentStyle> {
374 FormatStyle::EscapedNewlineAlignmentStyle &Value) { in enumeration()
375 IO.enumCase(Value, "DontAlign", FormatStyle::ENAS_DontAlign); in enumeration()
376 IO.enumCase(Value, "Left", FormatStyle::ENAS_Left); in enumeration()
377 IO.enumCase(Value, "Right", FormatStyle::ENAS_Right); in enumeration()
380 IO.enumCase(Value, "true", FormatStyle::ENAS_Left); in enumeration()
381 IO.enumCase(Value, "false", FormatStyle::ENAS_Right); in enumeration()
385 template <> struct ScalarEnumerationTraits<FormatStyle::OperandAlignmentStyle> {
386 static void enumeration(IO &IO, FormatStyle::OperandAlignmentStyle &Value) { in enumeration()
387 IO.enumCase(Value, "DontAlign", FormatStyle::OAS_DontAlign); in enumeration()
388 IO.enumCase(Value, "Align", FormatStyle::OAS_Align); in enumeration()
390 FormatStyle::OAS_AlignAfterOperator); in enumeration()
393 IO.enumCase(Value, "true", FormatStyle::OAS_Align); in enumeration()
394 IO.enumCase(Value, "false", FormatStyle::OAS_DontAlign); in enumeration()
398 template <> struct ScalarEnumerationTraits<FormatStyle::PointerAlignmentStyle> {
399 static void enumeration(IO &IO, FormatStyle::PointerAlignmentStyle &Value) { in enumeration()
400 IO.enumCase(Value, "Middle", FormatStyle::PAS_Middle); in enumeration()
401 IO.enumCase(Value, "Left", FormatStyle::PAS_Left); in enumeration()
402 IO.enumCase(Value, "Right", FormatStyle::PAS_Right); in enumeration()
405 IO.enumCase(Value, "true", FormatStyle::PAS_Left); in enumeration()
406 IO.enumCase(Value, "false", FormatStyle::PAS_Right); in enumeration()
411 struct ScalarEnumerationTraits<FormatStyle::SpaceAroundPointerQualifiersStyle> {
413 enumeration(IO &IO, FormatStyle::SpaceAroundPointerQualifiersStyle &Value) { in enumeration()
414 IO.enumCase(Value, "Default", FormatStyle::SAPQ_Default); in enumeration()
415 IO.enumCase(Value, "Before", FormatStyle::SAPQ_Before); in enumeration()
416 IO.enumCase(Value, "After", FormatStyle::SAPQ_After); in enumeration()
417 IO.enumCase(Value, "Both", FormatStyle::SAPQ_Both); in enumeration()
422 struct ScalarEnumerationTraits<FormatStyle::ReferenceAlignmentStyle> {
423 static void enumeration(IO &IO, FormatStyle::ReferenceAlignmentStyle &Value) { in enumeration()
424 IO.enumCase(Value, "Pointer", FormatStyle::RAS_Pointer); in enumeration()
425 IO.enumCase(Value, "Middle", FormatStyle::RAS_Middle); in enumeration()
426 IO.enumCase(Value, "Left", FormatStyle::RAS_Left); in enumeration()
427 IO.enumCase(Value, "Right", FormatStyle::RAS_Right); in enumeration()
432 struct ScalarEnumerationTraits<FormatStyle::SpaceBeforeParensOptions> {
434 FormatStyle::SpaceBeforeParensOptions &Value) { in enumeration()
435 IO.enumCase(Value, "Never", FormatStyle::SBPO_Never); in enumeration()
437 FormatStyle::SBPO_ControlStatements); in enumeration()
439 FormatStyle::SBPO_ControlStatementsExceptControlMacros); in enumeration()
441 FormatStyle::SBPO_NonEmptyParentheses); in enumeration()
442 IO.enumCase(Value, "Always", FormatStyle::SBPO_Always); in enumeration()
445 IO.enumCase(Value, "false", FormatStyle::SBPO_Never); in enumeration()
446 IO.enumCase(Value, "true", FormatStyle::SBPO_ControlStatements); in enumeration()
448 FormatStyle::SBPO_ControlStatementsExceptControlMacros); in enumeration()
453 struct ScalarEnumerationTraits<FormatStyle::BitFieldColonSpacingStyle> {
455 FormatStyle::BitFieldColonSpacingStyle &Value) { in enumeration()
456 IO.enumCase(Value, "Both", FormatStyle::BFCS_Both); in enumeration()
457 IO.enumCase(Value, "None", FormatStyle::BFCS_None); in enumeration()
458 IO.enumCase(Value, "Before", FormatStyle::BFCS_Before); in enumeration()
459 IO.enumCase(Value, "After", FormatStyle::BFCS_After); in enumeration()
463 template <> struct ScalarEnumerationTraits<FormatStyle::SortIncludesOptions> {
464 static void enumeration(IO &IO, FormatStyle::SortIncludesOptions &Value) { in enumeration()
465 IO.enumCase(Value, "Never", FormatStyle::SI_Never); in enumeration()
466 IO.enumCase(Value, "CaseInsensitive", FormatStyle::SI_CaseInsensitive); in enumeration()
467 IO.enumCase(Value, "CaseSensitive", FormatStyle::SI_CaseSensitive); in enumeration()
470 IO.enumCase(Value, "false", FormatStyle::SI_Never); in enumeration()
471 IO.enumCase(Value, "true", FormatStyle::SI_CaseSensitive); in enumeration()
476 struct ScalarEnumerationTraits<FormatStyle::SortJavaStaticImportOptions> {
478 FormatStyle::SortJavaStaticImportOptions &Value) { in enumeration()
479 IO.enumCase(Value, "Before", FormatStyle::SJSIO_Before); in enumeration()
480 IO.enumCase(Value, "After", FormatStyle::SJSIO_After); in enumeration()
484 template <> struct ScalarEnumerationTraits<FormatStyle::SpacesInAnglesStyle> {
485 static void enumeration(IO &IO, FormatStyle::SpacesInAnglesStyle &Value) { in enumeration()
486 IO.enumCase(Value, "Never", FormatStyle::SIAS_Never); in enumeration()
487 IO.enumCase(Value, "Always", FormatStyle::SIAS_Always); in enumeration()
488 IO.enumCase(Value, "Leave", FormatStyle::SIAS_Leave); in enumeration()
491 IO.enumCase(Value, "false", FormatStyle::SIAS_Never); in enumeration()
492 IO.enumCase(Value, "true", FormatStyle::SIAS_Always); in enumeration()
496 template <> struct MappingTraits<FormatStyle> {
497 static void mapping(IO &IO, FormatStyle &Style) { in mapping()
507 FormatStyle PredefinedStyle; in mapping()
518 FormatStyle::LanguageKind OldLanguage = Style.Language; in mapping()
519 FormatStyle::LanguageKind Language = in mapping()
520 ((FormatStyle *)IO.getContext())->Language; in mapping()
581 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None && in mapping()
582 Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) { in mapping()
583 if (Style.AlwaysBreakAfterDefinitionReturnType == FormatStyle::DRTBS_All) in mapping()
584 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in mapping()
586 FormatStyle::DRTBS_TopLevel) in mapping()
588 FormatStyle::RTBS_TopLevelDefinitions; in mapping()
612 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) in mapping()
613 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in mapping()
627 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon) in mapping()
628 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in mapping()
761 template <> struct MappingTraits<FormatStyle::BraceWrappingFlags> {
762 static void mapping(IO &IO, FormatStyle::BraceWrappingFlags &Wrapping) { in mapping()
784 template <> struct MappingTraits<FormatStyle::RawStringFormat> {
785 static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) { in mapping()
794 template <> struct MappingTraits<FormatStyle::SpacesInLineComment> {
795 static void mapping(IO &IO, FormatStyle::SpacesInLineComment &Space) { in mapping()
813 template <> struct DocumentListTraits<std::vector<FormatStyle>> {
814 static size_t size(IO &IO, std::vector<FormatStyle> &Seq) { in size()
817 static FormatStyle &element(IO &IO, std::vector<FormatStyle> &Seq, in element()
821 FormatStyle Template; in element()
822 if (!Seq.empty() && Seq[0].Language == FormatStyle::LK_None) { in element()
825 Template = *((const FormatStyle *)IO.getContext()); in element()
826 Template.Language = FormatStyle::LK_None; in element()
870 static FormatStyle expandPresets(const FormatStyle &Style) { in expandPresets()
871 if (Style.BreakBeforeBraces == FormatStyle::BS_Custom) in expandPresets()
873 FormatStyle Expanded = Style; in expandPresets()
876 /*AfterControlStatement=*/FormatStyle::BWACS_Never, in expandPresets()
893 case FormatStyle::BS_Linux: in expandPresets()
898 case FormatStyle::BS_Mozilla: in expandPresets()
905 Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in expandPresets()
909 case FormatStyle::BS_Stroustrup: in expandPresets()
914 case FormatStyle::BS_Allman: in expandPresets()
917 Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in expandPresets()
925 Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in expandPresets()
930 case FormatStyle::BS_Whitesmiths: in expandPresets()
933 Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in expandPresets()
940 Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in expandPresets()
945 case FormatStyle::BS_GNU: in expandPresets()
949 /*AfterControlStatement=*/FormatStyle::BWACS_Always, in expandPresets()
965 Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in expandPresets()
967 case FormatStyle::BS_WebKit: in expandPresets()
976 FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { in getLLVMStyle()
977 FormatStyle LLVMStyle; in getLLVMStyle()
981 LLVMStyle.AlignEscapedNewlines = FormatStyle::ENAS_Right; in getLLVMStyle()
982 LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; in getLLVMStyle()
983 LLVMStyle.AlignArrayOfStructures = FormatStyle::AIAS_None; in getLLVMStyle()
984 LLVMStyle.AlignOperands = FormatStyle::OAS_Align; in getLLVMStyle()
986 LLVMStyle.AlignConsecutiveAssignments = FormatStyle::ACS_None; in getLLVMStyle()
987 LLVMStyle.AlignConsecutiveBitFields = FormatStyle::ACS_None; in getLLVMStyle()
988 LLVMStyle.AlignConsecutiveDeclarations = FormatStyle::ACS_None; in getLLVMStyle()
989 LLVMStyle.AlignConsecutiveMacros = FormatStyle::ACS_None; in getLLVMStyle()
994 LLVMStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; in getLLVMStyle()
995 LLVMStyle.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never; in getLLVMStyle()
997 LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getLLVMStyle()
998 LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All; in getLLVMStyle()
1000 LLVMStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; in getLLVMStyle()
1001 LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getLLVMStyle()
1003 LLVMStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_MultiLine; in getLLVMStyle()
1007 LLVMStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_None; in getLLVMStyle()
1010 LLVMStyle.BreakBeforeBraces = FormatStyle::BS_Attach; in getLLVMStyle()
1013 /*AfterControlStatement=*/FormatStyle::BWACS_Never, in getLLVMStyle()
1029 LLVMStyle.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in getLLVMStyle()
1031 LLVMStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon; in getLLVMStyle()
1032 LLVMStyle.BreakInheritanceList = FormatStyle::BILS_BeforeColon; in getLLVMStyle()
1043 LLVMStyle.EmptyLineAfterAccessModifier = FormatStyle::ELAAMS_Never; in getLLVMStyle()
1044 LLVMStyle.EmptyLineBeforeAccessModifier = FormatStyle::ELBAMS_LogicalBlock; in getLLVMStyle()
1061 LLVMStyle.IndentPPDirectives = FormatStyle::PPDIS_None; in getLLVMStyle()
1066 LLVMStyle.InsertTrailingCommas = FormatStyle::TCS_None; in getLLVMStyle()
1067 LLVMStyle.JavaScriptQuotes = FormatStyle::JSQS_Leave; in getLLVMStyle()
1070 LLVMStyle.LambdaBodyIndentation = FormatStyle::LBI_Signature; in getLLVMStyle()
1073 LLVMStyle.NamespaceIndentation = FormatStyle::NI_None; in getLLVMStyle()
1074 LLVMStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Auto; in getLLVMStyle()
1079 LLVMStyle.PointerAlignment = FormatStyle::PAS_Right; in getLLVMStyle()
1080 LLVMStyle.ReferenceAlignment = FormatStyle::RAS_Pointer; in getLLVMStyle()
1083 LLVMStyle.Standard = FormatStyle::LS_Latest; in getLLVMStyle()
1085 LLVMStyle.UseTab = FormatStyle::UT_Never; in getLLVMStyle()
1097 LLVMStyle.SpaceAroundPointerQualifiers = FormatStyle::SAPQ_Default; in getLLVMStyle()
1101 LLVMStyle.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements; in getLLVMStyle()
1106 LLVMStyle.BitFieldColonSpacing = FormatStyle::BFCS_Both; in getLLVMStyle()
1107 LLVMStyle.SpacesInAngles = FormatStyle::SIAS_Never; in getLLVMStyle()
1121 LLVMStyle.SortIncludes = FormatStyle::SI_CaseSensitive; in getLLVMStyle()
1122 LLVMStyle.SortJavaStaticImport = FormatStyle::SJSIO_Before; in getLLVMStyle()
1134 if (Language == FormatStyle::LK_TableGen) { in getLLVMStyle()
1144 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { in getGoogleStyle()
1145 if (Language == FormatStyle::LK_TextProto) { in getGoogleStyle()
1146 FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto); in getGoogleStyle()
1147 GoogleStyle.Language = FormatStyle::LK_TextProto; in getGoogleStyle()
1152 FormatStyle GoogleStyle = getLLVMStyle(Language); in getGoogleStyle()
1155 GoogleStyle.AlignEscapedNewlines = FormatStyle::ENAS_Left; in getGoogleStyle()
1157 FormatStyle::SIS_WithoutElse; in getGoogleStyle()
1160 GoogleStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; in getGoogleStyle()
1171 GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never; in getGoogleStyle()
1174 GoogleStyle.PointerAlignment = FormatStyle::PAS_Left; in getGoogleStyle()
1177 FormatStyle::LK_Cpp, in getGoogleStyle()
1194 FormatStyle::LK_TextProto, in getGoogleStyle()
1219 GoogleStyle.Standard = FormatStyle::LS_Auto; in getGoogleStyle()
1224 if (Language == FormatStyle::LK_Java) { in getGoogleStyle()
1225 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getGoogleStyle()
1226 GoogleStyle.AlignOperands = FormatStyle::OAS_DontAlign; in getGoogleStyle()
1228 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1229 GoogleStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getGoogleStyle()
1231 GoogleStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment; in getGoogleStyle()
1235 } else if (Language == FormatStyle::LK_JavaScript) { in getGoogleStyle()
1236 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak; in getGoogleStyle()
1237 GoogleStyle.AlignOperands = FormatStyle::OAS_DontAlign; in getGoogleStyle()
1238 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1240 GoogleStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_Empty; in getGoogleStyle()
1250 GoogleStyle.NamespaceIndentation = FormatStyle::NI_All; in getGoogleStyle()
1252 GoogleStyle.JavaScriptQuotes = FormatStyle::JSQS_Single; in getGoogleStyle()
1254 } else if (Language == FormatStyle::LK_Proto) { in getGoogleStyle()
1255 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1265 } else if (Language == FormatStyle::LK_ObjC) { in getGoogleStyle()
1273 } else if (Language == FormatStyle::LK_CSharp) { in getGoogleStyle()
1274 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; in getGoogleStyle()
1275 GoogleStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getGoogleStyle()
1278 GoogleStyle.NamespaceIndentation = FormatStyle::NI_All; in getGoogleStyle()
1284 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { in getChromiumStyle()
1285 FormatStyle ChromiumStyle = getGoogleStyle(Language); in getChromiumStyle()
1307 if (Language == FormatStyle::LK_Java) { in getChromiumStyle()
1309 FormatStyle::SIS_WithoutElse; in getChromiumStyle()
1327 ChromiumStyle.SortIncludes = FormatStyle::SI_CaseSensitive; in getChromiumStyle()
1328 } else if (Language == FormatStyle::LK_JavaScript) { in getChromiumStyle()
1329 ChromiumStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getChromiumStyle()
1333 ChromiumStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; in getChromiumStyle()
1334 ChromiumStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getChromiumStyle()
1338 if (Language == FormatStyle::LK_ObjC) in getChromiumStyle()
1344 FormatStyle getMozillaStyle() { in getMozillaStyle()
1345 FormatStyle MozillaStyle = getLLVMStyle(); in getMozillaStyle()
1347 MozillaStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; in getMozillaStyle()
1348 MozillaStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevel; in getMozillaStyle()
1350 FormatStyle::DRTBS_TopLevel; in getMozillaStyle()
1351 MozillaStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; in getMozillaStyle()
1354 MozillaStyle.BreakBeforeBraces = FormatStyle::BS_Mozilla; in getMozillaStyle()
1355 MozillaStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getMozillaStyle()
1356 MozillaStyle.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in getMozillaStyle()
1365 MozillaStyle.PointerAlignment = FormatStyle::PAS_Left; in getMozillaStyle()
1370 FormatStyle getWebKitStyle() { in getWebKitStyle()
1371 FormatStyle Style = getLLVMStyle(); in getWebKitStyle()
1373 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getWebKitStyle()
1374 Style.AlignOperands = FormatStyle::OAS_DontAlign; in getWebKitStyle()
1376 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty; in getWebKitStyle()
1377 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getWebKitStyle()
1378 Style.BreakBeforeBraces = FormatStyle::BS_WebKit; in getWebKitStyle()
1379 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getWebKitStyle()
1384 Style.NamespaceIndentation = FormatStyle::NI_Inner; in getWebKitStyle()
1387 Style.PointerAlignment = FormatStyle::PAS_Left; in getWebKitStyle()
1393 FormatStyle getGNUStyle() { in getGNUStyle()
1394 FormatStyle Style = getLLVMStyle(); in getGNUStyle()
1395 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; in getGNUStyle()
1396 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in getGNUStyle()
1397 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getGNUStyle()
1398 Style.BreakBeforeBraces = FormatStyle::BS_GNU; in getGNUStyle()
1403 Style.SpaceBeforeParens = FormatStyle::SBPO_Always; in getGNUStyle()
1404 Style.Standard = FormatStyle::LS_Cpp03; in getGNUStyle()
1408 FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language) { in getMicrosoftStyle()
1409 FormatStyle Style = getLLVMStyle(Language); in getMicrosoftStyle()
1413 Style.UseTab = FormatStyle::UT_Never; in getMicrosoftStyle()
1414 Style.BreakBeforeBraces = FormatStyle::BS_Custom; in getMicrosoftStyle()
1416 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in getMicrosoftStyle()
1423 Style.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in getMicrosoftStyle()
1429 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None; in getMicrosoftStyle()
1431 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getMicrosoftStyle()
1433 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getMicrosoftStyle()
1434 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; in getMicrosoftStyle()
1438 FormatStyle getNoStyle() { in getNoStyle()
1439 FormatStyle NoStyle = getLLVMStyle(); in getNoStyle()
1441 NoStyle.SortIncludes = FormatStyle::SI_Never; in getNoStyle()
1446 bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language, in getPredefinedStyle()
1447 FormatStyle *Style) { in getPredefinedStyle()
1475 FormatStyle *Style, bool AllowUnknownOptions, in parseConfiguration()
1479 FormatStyle::LanguageKind Language = Style->Language; in parseConfiguration()
1480 assert(Language != FormatStyle::LK_None); in parseConfiguration()
1484 std::vector<FormatStyle> Styles; in parseConfiguration()
1499 if (Styles[i].Language == FormatStyle::LK_None && i != 0) in parseConfiguration()
1514 FormatStyle::FormatStyleSet StyleSet; in parseConfiguration()
1517 if (Styles[i].Language != FormatStyle::LK_None) in parseConfiguration()
1523 if (Styles.empty() || Styles[0].Language != FormatStyle::LK_None) in parseConfiguration()
1525 FormatStyle DefaultStyle = Styles[0]; in parseConfiguration()
1530 if (Style->InsertTrailingCommas != FormatStyle::TCS_None && in parseConfiguration()
1538 std::string configurationAsText(const FormatStyle &Style) { in configurationAsText()
1544 FormatStyle NonConstStyle = expandPresets(Style); in configurationAsText()
1549 llvm::Optional<FormatStyle>
1550 FormatStyle::FormatStyleSet::Get(FormatStyle::LanguageKind Language) const { in Get()
1556 FormatStyle Style = It->second; in Get()
1561 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) { in Add()
1572 void FormatStyle::FormatStyleSet::Clear() { Styles.reset(); } in Clear()
1574 llvm::Optional<FormatStyle>
1575 FormatStyle::GetLanguageStyle(FormatStyle::LanguageKind Language) const { in GetLanguageStyle()
1583 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style) in JavaScriptRequoter()
1611 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single && in requoteJSStringLiteral()
1613 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double && in requoteJSStringLiteral()
1618 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single; in requoteJSStringLiteral()
1670 Formatter(const Environment &Env, const FormatStyle &Style, in Formatter()
1776 ? FormatStyle::PAS_Left in deriveLocalStyle()
1777 : FormatStyle::PAS_Right; in deriveLocalStyle()
1778 Style.ReferenceAlignment = FormatStyle::RAS_Pointer; in deriveLocalStyle()
1780 if (Style.Standard == FormatStyle::LS_Auto) in deriveLocalStyle()
1782 ? FormatStyle::LS_Latest in deriveLocalStyle()
1783 : FormatStyle::LS_Cpp03; in deriveLocalStyle()
1805 TrailingCommaInserter(const Environment &Env, const FormatStyle &Style) in TrailingCommaInserter()
1865 Cleaner(const Environment &Env, const FormatStyle &Style) in Cleaner()
2090 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style) in ObjCHeaderStyleGuesser()
2097 assert(Style.Language == FormatStyle::LK_Cpp); in analyze()
2310 static void sortCppIncludes(const FormatStyle &Style, in sortCppIncludes()
2327 if (Style.SortIncludes == FormatStyle::SI_CaseInsensitive) { in sortCppIncludes()
2410 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, in sortCppIncludes()
2492 static unsigned findJavaImportGroup(const FormatStyle &Style, in findJavaImportGroup()
2512 static void sortJavaImports(const FormatStyle &Style, in sortJavaImports()
2530 Style.SortJavaStaticImport == FormatStyle::SJSIO_After; in sortJavaImports()
2591 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code, in sortJavaImports()
2653 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, in sortIncludes()
2661 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && in sortIncludes()
2664 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript) in sortIncludes()
2666 if (Style.Language == FormatStyle::LanguageKind::LK_Java) in sortIncludes()
2676 const FormatStyle &Style) { in processReplacements()
2694 const FormatStyle &Style) { in formatReplacements()
2697 auto SortIncludes = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
2709 auto Reformat = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
2732 const FormatStyle &Style) { in fixCppIncludeInsertions()
2804 const FormatStyle &Style) { in cleanupAroundReplacements()
2807 auto Cleanup = [](const FormatStyle &Style, StringRef Code, in cleanupAroundReplacements()
2820 reformat(const FormatStyle &Style, StringRef Code, in reformat()
2824 FormatStyle Expanded = expandPresets(Style); in reformat()
2829 if (Expanded.Language == FormatStyle::LK_JavaScript && isMpegTS(Code)) in reformat()
2856 if (Style.Language == FormatStyle::LK_Cpp) { in reformat()
2868 if (Style.Language == FormatStyle::LK_JavaScript && in reformat()
2869 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave) in reformat()
2878 if (Style.Language == FormatStyle::LK_JavaScript && in reformat()
2879 Style.InsertTrailingCommas == FormatStyle::TCS_Wrapped) in reformat()
2911 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat()
2922 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, in cleanup()
2926 if (Style.Language != FormatStyle::LK_Cpp) in cleanup()
2931 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat()
2941 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, in fixNamespaceEndComments()
2950 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, in sortUsingDeclarations()
2959 LangOptions getFormattingLangOpts(const FormatStyle &Style) { in getFormattingLangOpts()
2962 FormatStyle::LanguageStandard LexingStd = Style.Standard; in getFormattingLangOpts()
2963 if (LexingStd == FormatStyle::LS_Auto) in getFormattingLangOpts()
2964 LexingStd = FormatStyle::LS_Latest; in getFormattingLangOpts()
2965 if (LexingStd == FormatStyle::LS_Latest) in getFormattingLangOpts()
2966 LexingStd = FormatStyle::LS_Cpp20; in getFormattingLangOpts()
2968 LangOpts.CPlusPlus11 = LexingStd >= FormatStyle::LS_Cpp11; in getFormattingLangOpts()
2969 LangOpts.CPlusPlus14 = LexingStd >= FormatStyle::LS_Cpp14; in getFormattingLangOpts()
2970 LangOpts.CPlusPlus17 = LexingStd >= FormatStyle::LS_Cpp17; in getFormattingLangOpts()
2971 LangOpts.CPlusPlus20 = LexingStd >= FormatStyle::LS_Cpp20; in getFormattingLangOpts()
2972 LangOpts.Char8 = LexingStd >= FormatStyle::LS_Cpp20; in getFormattingLangOpts()
2996 static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) { in getLanguageByFileName()
2998 return FormatStyle::LK_Java; in getLanguageByFileName()
3002 return FormatStyle::LK_JavaScript; // (module) JavaScript or TypeScript. in getLanguageByFileName()
3004 return FormatStyle::LK_ObjC; in getLanguageByFileName()
3007 return FormatStyle::LK_Proto; in getLanguageByFileName()
3012 return FormatStyle::LK_TextProto; in getLanguageByFileName()
3014 return FormatStyle::LK_TableGen; in getLanguageByFileName()
3016 return FormatStyle::LK_CSharp; in getLanguageByFileName()
3018 return FormatStyle::LK_Json; in getLanguageByFileName()
3019 return FormatStyle::LK_Cpp; in getLanguageByFileName()
3022 FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code) { in guessLanguage()
3024 if (GuessedLanguage == FormatStyle::LK_Cpp) { in guessLanguage()
3034 return FormatStyle::LK_ObjC; in guessLanguage()
3044 llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName, in getStyle()
3051 FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code)); in getStyle()
3053 FormatStyle FallbackStyle = getNoStyle(); in getStyle()