Lines Matching refs:Style

764   static void mapping(IO &IO, FormatStyle &Style) {  in mapping()
766 IO.mapOptional("Language", Style.Language); in mapping()
774 if (getPredefinedStyle(StyleName, Style.Language, &PredefinedStyle) && in mapping()
775 Style == PredefinedStyle) { in mapping()
784 FormatStyle::LanguageKind OldLanguage = Style.Language; in mapping()
787 if (!getPredefinedStyle(BasedOnStyle, Language, &Style)) { in mapping()
791 Style.Language = OldLanguage; in mapping()
819 IO.mapOptional("AlignEscapedNewlinesLeft", Style.AlignEscapedNewlines); in mapping()
828 IO.mapOptional("DerivePointerBinding", Style.DerivePointerAlignment); in mapping()
830 Style.IndentWrappedFunctionNames); in mapping()
831 IO.mapOptional("IndentRequires", Style.IndentRequiresClause); in mapping()
832 IO.mapOptional("PointerBindsToType", Style.PointerAlignment); in mapping()
834 Style.SpaceBeforeParens); in mapping()
838 IO.mapOptional("AccessModifierOffset", Style.AccessModifierOffset); in mapping()
839 IO.mapOptional("AlignAfterOpenBracket", Style.AlignAfterOpenBracket); in mapping()
840 IO.mapOptional("AlignArrayOfStructures", Style.AlignArrayOfStructures); in mapping()
842 Style.AlignConsecutiveAssignments); in mapping()
844 Style.AlignConsecutiveBitFields); in mapping()
846 Style.AlignConsecutiveDeclarations); in mapping()
847 IO.mapOptional("AlignConsecutiveMacros", Style.AlignConsecutiveMacros); in mapping()
848 IO.mapOptional("AlignEscapedNewlines", Style.AlignEscapedNewlines); in mapping()
849 IO.mapOptional("AlignOperands", Style.AlignOperands); in mapping()
850 IO.mapOptional("AlignTrailingComments", Style.AlignTrailingComments); in mapping()
852 Style.AllowAllArgumentsOnNextLine); in mapping()
854 Style.AllowAllParametersOfDeclarationOnNextLine); in mapping()
856 Style.AllowShortBlocksOnASingleLine); in mapping()
858 Style.AllowShortCaseLabelsOnASingleLine); in mapping()
860 Style.AllowShortEnumsOnASingleLine); in mapping()
862 Style.AllowShortFunctionsOnASingleLine); in mapping()
864 Style.AllowShortIfStatementsOnASingleLine); in mapping()
866 Style.AllowShortLambdasOnASingleLine); in mapping()
868 Style.AllowShortLoopsOnASingleLine); in mapping()
870 Style.AlwaysBreakAfterDefinitionReturnType); in mapping()
872 Style.AlwaysBreakAfterReturnType); in mapping()
874 Style.AlwaysBreakBeforeMultilineStrings); in mapping()
876 Style.AlwaysBreakTemplateDeclarations); in mapping()
877 IO.mapOptional("AttributeMacros", Style.AttributeMacros); in mapping()
878 IO.mapOptional("BinPackArguments", Style.BinPackArguments); in mapping()
879 IO.mapOptional("BinPackParameters", Style.BinPackParameters); in mapping()
880 IO.mapOptional("BitFieldColonSpacing", Style.BitFieldColonSpacing); in mapping()
881 IO.mapOptional("BraceWrapping", Style.BraceWrapping); in mapping()
882 IO.mapOptional("BreakAfterAttributes", Style.BreakAfterAttributes); in mapping()
884 Style.BreakAfterJavaFieldAnnotations); in mapping()
885 IO.mapOptional("BreakArrays", Style.BreakArrays); in mapping()
887 Style.BreakBeforeBinaryOperators); in mapping()
889 Style.BreakBeforeConceptDeclarations); in mapping()
890 IO.mapOptional("BreakBeforeBraces", Style.BreakBeforeBraces); in mapping()
892 Style.BreakBeforeInlineASMColon); in mapping()
894 Style.BreakBeforeTernaryOperators); in mapping()
896 Style.BreakConstructorInitializers); in mapping()
897 IO.mapOptional("BreakInheritanceList", Style.BreakInheritanceList); in mapping()
898 IO.mapOptional("BreakStringLiterals", Style.BreakStringLiterals); in mapping()
899 IO.mapOptional("ColumnLimit", Style.ColumnLimit); in mapping()
900 IO.mapOptional("CommentPragmas", Style.CommentPragmas); in mapping()
901 IO.mapOptional("CompactNamespaces", Style.CompactNamespaces); in mapping()
903 Style.ConstructorInitializerIndentWidth); in mapping()
904 IO.mapOptional("ContinuationIndentWidth", Style.ContinuationIndentWidth); in mapping()
905 IO.mapOptional("Cpp11BracedListStyle", Style.Cpp11BracedListStyle); in mapping()
906 IO.mapOptional("DerivePointerAlignment", Style.DerivePointerAlignment); in mapping()
907 IO.mapOptional("DisableFormat", Style.DisableFormat); in mapping()
909 Style.EmptyLineAfterAccessModifier); in mapping()
911 Style.EmptyLineBeforeAccessModifier); in mapping()
913 Style.ExperimentalAutoDetectBinPacking); in mapping()
914 IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments); in mapping()
915 IO.mapOptional("ForEachMacros", Style.ForEachMacros); in mapping()
916 IO.mapOptional("IfMacros", Style.IfMacros); in mapping()
917 IO.mapOptional("IncludeBlocks", Style.IncludeStyle.IncludeBlocks); in mapping()
918 IO.mapOptional("IncludeCategories", Style.IncludeStyle.IncludeCategories); in mapping()
919 IO.mapOptional("IncludeIsMainRegex", Style.IncludeStyle.IncludeIsMainRegex); in mapping()
921 Style.IncludeStyle.IncludeIsMainSourceRegex); in mapping()
922 IO.mapOptional("IndentAccessModifiers", Style.IndentAccessModifiers); in mapping()
923 IO.mapOptional("IndentCaseBlocks", Style.IndentCaseBlocks); in mapping()
924 IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels); in mapping()
925 IO.mapOptional("IndentExternBlock", Style.IndentExternBlock); in mapping()
926 IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels); in mapping()
927 IO.mapOptional("IndentPPDirectives", Style.IndentPPDirectives); in mapping()
928 IO.mapOptional("IndentRequiresClause", Style.IndentRequiresClause); in mapping()
929 IO.mapOptional("IndentWidth", Style.IndentWidth); in mapping()
931 Style.IndentWrappedFunctionNames); in mapping()
932 IO.mapOptional("InsertBraces", Style.InsertBraces); in mapping()
933 IO.mapOptional("InsertNewlineAtEOF", Style.InsertNewlineAtEOF); in mapping()
934 IO.mapOptional("InsertTrailingCommas", Style.InsertTrailingCommas); in mapping()
935 IO.mapOptional("IntegerLiteralSeparator", Style.IntegerLiteralSeparator); in mapping()
936 IO.mapOptional("JavaImportGroups", Style.JavaImportGroups); in mapping()
937 IO.mapOptional("JavaScriptQuotes", Style.JavaScriptQuotes); in mapping()
938 IO.mapOptional("JavaScriptWrapImports", Style.JavaScriptWrapImports); in mapping()
940 Style.KeepEmptyLinesAtTheStartOfBlocks); in mapping()
941 IO.mapOptional("LambdaBodyIndentation", Style.LambdaBodyIndentation); in mapping()
942 IO.mapOptional("LineEnding", Style.LineEnding); in mapping()
943 IO.mapOptional("MacroBlockBegin", Style.MacroBlockBegin); in mapping()
944 IO.mapOptional("MacroBlockEnd", Style.MacroBlockEnd); in mapping()
945 IO.mapOptional("MaxEmptyLinesToKeep", Style.MaxEmptyLinesToKeep); in mapping()
946 IO.mapOptional("NamespaceIndentation", Style.NamespaceIndentation); in mapping()
947 IO.mapOptional("NamespaceMacros", Style.NamespaceMacros); in mapping()
948 IO.mapOptional("ObjCBinPackProtocolList", Style.ObjCBinPackProtocolList); in mapping()
949 IO.mapOptional("ObjCBlockIndentWidth", Style.ObjCBlockIndentWidth); in mapping()
951 Style.ObjCBreakBeforeNestedBlockParam); in mapping()
952 IO.mapOptional("ObjCSpaceAfterProperty", Style.ObjCSpaceAfterProperty); in mapping()
954 Style.ObjCSpaceBeforeProtocolList); in mapping()
956 Style.PackConstructorInitializers); in mapping()
957 IO.mapOptional("PenaltyBreakAssignment", Style.PenaltyBreakAssignment); in mapping()
959 Style.PenaltyBreakBeforeFirstCallParameter); in mapping()
960 IO.mapOptional("PenaltyBreakComment", Style.PenaltyBreakComment); in mapping()
962 Style.PenaltyBreakFirstLessLess); in mapping()
964 Style.PenaltyBreakOpenParenthesis); in mapping()
965 IO.mapOptional("PenaltyBreakString", Style.PenaltyBreakString); in mapping()
967 Style.PenaltyBreakTemplateDeclaration); in mapping()
968 IO.mapOptional("PenaltyExcessCharacter", Style.PenaltyExcessCharacter); in mapping()
970 Style.PenaltyIndentedWhitespace); in mapping()
972 Style.PenaltyReturnTypeOnItsOwnLine); in mapping()
973 IO.mapOptional("PointerAlignment", Style.PointerAlignment); in mapping()
974 IO.mapOptional("PPIndentWidth", Style.PPIndentWidth); in mapping()
975 IO.mapOptional("QualifierAlignment", Style.QualifierAlignment); in mapping()
977 if (Style.QualifierAlignment == FormatStyle::QAS_Right) in mapping()
978 Style.QualifierOrder = {"type", "const", "volatile"}; in mapping()
979 else if (Style.QualifierAlignment == FormatStyle::QAS_Left) in mapping()
980 Style.QualifierOrder = {"const", "volatile", "type"}; in mapping()
981 else if (Style.QualifierAlignment == FormatStyle::QAS_Custom) in mapping()
982 IO.mapOptional("QualifierOrder", Style.QualifierOrder); in mapping()
983 IO.mapOptional("RawStringFormats", Style.RawStringFormats); in mapping()
984 IO.mapOptional("ReferenceAlignment", Style.ReferenceAlignment); in mapping()
985 IO.mapOptional("ReflowComments", Style.ReflowComments); in mapping()
986 IO.mapOptional("RemoveBracesLLVM", Style.RemoveBracesLLVM); in mapping()
987 IO.mapOptional("RemoveSemicolon", Style.RemoveSemicolon); in mapping()
988 IO.mapOptional("RequiresClausePosition", Style.RequiresClausePosition); in mapping()
990 Style.RequiresExpressionIndentation); in mapping()
991 IO.mapOptional("SeparateDefinitionBlocks", Style.SeparateDefinitionBlocks); in mapping()
992 IO.mapOptional("ShortNamespaceLines", Style.ShortNamespaceLines); in mapping()
993 IO.mapOptional("SortIncludes", Style.SortIncludes); in mapping()
994 IO.mapOptional("SortJavaStaticImport", Style.SortJavaStaticImport); in mapping()
995 IO.mapOptional("SortUsingDeclarations", Style.SortUsingDeclarations); in mapping()
996 IO.mapOptional("SpaceAfterCStyleCast", Style.SpaceAfterCStyleCast); in mapping()
997 IO.mapOptional("SpaceAfterLogicalNot", Style.SpaceAfterLogicalNot); in mapping()
999 Style.SpaceAfterTemplateKeyword); in mapping()
1001 Style.SpaceAroundPointerQualifiers); in mapping()
1003 Style.SpaceBeforeAssignmentOperators); in mapping()
1004 IO.mapOptional("SpaceBeforeCaseColon", Style.SpaceBeforeCaseColon); in mapping()
1006 Style.SpaceBeforeCpp11BracedList); in mapping()
1008 Style.SpaceBeforeCtorInitializerColon); in mapping()
1010 Style.SpaceBeforeInheritanceColon); in mapping()
1011 IO.mapOptional("SpaceBeforeParens", Style.SpaceBeforeParens); in mapping()
1012 IO.mapOptional("SpaceBeforeParensOptions", Style.SpaceBeforeParensOptions); in mapping()
1014 Style.SpaceBeforeRangeBasedForLoopColon); in mapping()
1016 Style.SpaceBeforeSquareBrackets); in mapping()
1017 IO.mapOptional("SpaceInEmptyBlock", Style.SpaceInEmptyBlock); in mapping()
1018 IO.mapOptional("SpaceInEmptyParentheses", Style.SpaceInEmptyParentheses); in mapping()
1020 Style.SpacesBeforeTrailingComments); in mapping()
1021 IO.mapOptional("SpacesInAngles", Style.SpacesInAngles); in mapping()
1023 Style.SpacesInConditionalStatement); in mapping()
1025 Style.SpacesInContainerLiterals); in mapping()
1027 Style.SpacesInCStyleCastParentheses); in mapping()
1029 Style.SpacesInLineCommentPrefix); in mapping()
1030 IO.mapOptional("SpacesInParentheses", Style.SpacesInParentheses); in mapping()
1031 IO.mapOptional("SpacesInSquareBrackets", Style.SpacesInSquareBrackets); in mapping()
1032 IO.mapOptional("Standard", Style.Standard); in mapping()
1034 Style.StatementAttributeLikeMacros); in mapping()
1035 IO.mapOptional("StatementMacros", Style.StatementMacros); in mapping()
1036 IO.mapOptional("TabWidth", Style.TabWidth); in mapping()
1037 IO.mapOptional("TypenameMacros", Style.TypenameMacros); in mapping()
1038 IO.mapOptional("UseTab", Style.UseTab); in mapping()
1040 Style.WhitespaceSensitiveMacros); in mapping()
1045 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None && in mapping()
1046 Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) { in mapping()
1047 if (Style.AlwaysBreakAfterDefinitionReturnType == in mapping()
1049 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in mapping()
1050 } else if (Style.AlwaysBreakAfterDefinitionReturnType == in mapping()
1052 Style.AlwaysBreakAfterReturnType = in mapping()
1060 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) { in mapping()
1061 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma; in mapping()
1068 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon) { in mapping()
1069 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in mapping()
1073 if (Style.PackConstructorInitializers == FormatStyle::PCIS_BinPack && in mapping()
1075 Style.PackConstructorInitializers = OnNextLine in mapping()
1079 } else if (Style.PackConstructorInitializers == in mapping()
1082 Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack; in mapping()
1084 Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine; in mapping()
1087 if (Style.LineEnding == FormatStyle::LE_DeriveLF) { in mapping()
1089 Style.LineEnding = UseCRLF ? FormatStyle::LE_CRLF : FormatStyle::LE_LF; in mapping()
1091 Style.LineEnding = FormatStyle::LE_DeriveCRLF; in mapping()
1724 FormatStyle Style = getLLVMStyle(); in getWebKitStyle() local
1725 Style.AccessModifierOffset = -4; in getWebKitStyle()
1726 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign; in getWebKitStyle()
1727 Style.AlignOperands = FormatStyle::OAS_DontAlign; in getWebKitStyle()
1728 Style.AlignTrailingComments = {}; in getWebKitStyle()
1729 Style.AlignTrailingComments.Kind = FormatStyle::TCAS_Never; in getWebKitStyle()
1730 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty; in getWebKitStyle()
1731 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getWebKitStyle()
1732 Style.BreakBeforeBraces = FormatStyle::BS_WebKit; in getWebKitStyle()
1733 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; in getWebKitStyle()
1734 Style.Cpp11BracedListStyle = false; in getWebKitStyle()
1735 Style.ColumnLimit = 0; in getWebKitStyle()
1736 Style.FixNamespaceComments = false; in getWebKitStyle()
1737 Style.IndentWidth = 4; in getWebKitStyle()
1738 Style.NamespaceIndentation = FormatStyle::NI_Inner; in getWebKitStyle()
1739 Style.ObjCBlockIndentWidth = 4; in getWebKitStyle()
1740 Style.ObjCSpaceAfterProperty = true; in getWebKitStyle()
1741 Style.PointerAlignment = FormatStyle::PAS_Left; in getWebKitStyle()
1742 Style.SpaceBeforeCpp11BracedList = true; in getWebKitStyle()
1743 Style.SpaceInEmptyBlock = true; in getWebKitStyle()
1744 return Style; in getWebKitStyle()
1748 FormatStyle Style = getLLVMStyle(); in getGNUStyle() local
1749 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All; in getGNUStyle()
1750 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; in getGNUStyle()
1751 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; in getGNUStyle()
1752 Style.BreakBeforeBraces = FormatStyle::BS_GNU; in getGNUStyle()
1753 Style.BreakBeforeTernaryOperators = true; in getGNUStyle()
1754 Style.Cpp11BracedListStyle = false; in getGNUStyle()
1755 Style.ColumnLimit = 79; in getGNUStyle()
1756 Style.FixNamespaceComments = false; in getGNUStyle()
1757 Style.SpaceBeforeParens = FormatStyle::SBPO_Always; in getGNUStyle()
1758 Style.Standard = FormatStyle::LS_Cpp03; in getGNUStyle()
1759 return Style; in getGNUStyle()
1763 FormatStyle Style = getLLVMStyle(Language); in getMicrosoftStyle() local
1764 Style.ColumnLimit = 120; in getMicrosoftStyle()
1765 Style.TabWidth = 4; in getMicrosoftStyle()
1766 Style.IndentWidth = 4; in getMicrosoftStyle()
1767 Style.UseTab = FormatStyle::UT_Never; in getMicrosoftStyle()
1768 Style.BreakBeforeBraces = FormatStyle::BS_Custom; in getMicrosoftStyle()
1769 Style.BraceWrapping.AfterClass = true; in getMicrosoftStyle()
1770 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always; in getMicrosoftStyle()
1771 Style.BraceWrapping.AfterEnum = true; in getMicrosoftStyle()
1772 Style.BraceWrapping.AfterFunction = true; in getMicrosoftStyle()
1773 Style.BraceWrapping.AfterNamespace = true; in getMicrosoftStyle()
1774 Style.BraceWrapping.AfterObjCDeclaration = true; in getMicrosoftStyle()
1775 Style.BraceWrapping.AfterStruct = true; in getMicrosoftStyle()
1776 Style.BraceWrapping.AfterExternBlock = true; in getMicrosoftStyle()
1777 Style.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock; in getMicrosoftStyle()
1778 Style.BraceWrapping.BeforeCatch = true; in getMicrosoftStyle()
1779 Style.BraceWrapping.BeforeElse = true; in getMicrosoftStyle()
1780 Style.BraceWrapping.BeforeWhile = false; in getMicrosoftStyle()
1781 Style.PenaltyReturnTypeOnItsOwnLine = 1000; in getMicrosoftStyle()
1782 Style.AllowShortEnumsOnASingleLine = false; in getMicrosoftStyle()
1783 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None; in getMicrosoftStyle()
1784 Style.AllowShortCaseLabelsOnASingleLine = false; in getMicrosoftStyle()
1785 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; in getMicrosoftStyle()
1786 Style.AllowShortLoopsOnASingleLine = false; in getMicrosoftStyle()
1787 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None; in getMicrosoftStyle()
1788 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; in getMicrosoftStyle()
1789 return Style; in getMicrosoftStyle()
1801 FormatStyle *Style) { in getPredefinedStyle() argument
1803 *Style = getLLVMStyle(Language); in getPredefinedStyle()
1805 *Style = getChromiumStyle(Language); in getPredefinedStyle()
1807 *Style = getMozillaStyle(); in getPredefinedStyle()
1809 *Style = getGoogleStyle(Language); in getPredefinedStyle()
1811 *Style = getWebKitStyle(); in getPredefinedStyle()
1813 *Style = getGNUStyle(); in getPredefinedStyle()
1815 *Style = getMicrosoftStyle(Language); in getPredefinedStyle()
1817 *Style = getNoStyle(); in getPredefinedStyle()
1819 Style->InheritsParentConfig = true; in getPredefinedStyle()
1823 Style->Language = Language; in getPredefinedStyle()
1827 ParseError validateQualifierOrder(FormatStyle *Style) { in validateQualifierOrder() argument
1829 if (Style->QualifierOrder.empty()) in validateQualifierOrder()
1833 for (const auto &Qualifier : Style->QualifierOrder) { in validateQualifierOrder()
1843 std::set<std::string> UniqueQualifiers(Style->QualifierOrder.begin(), in validateQualifierOrder()
1844 Style->QualifierOrder.end()); in validateQualifierOrder()
1845 if (Style->QualifierOrder.size() != UniqueQualifiers.size()) { in validateQualifierOrder()
1847 << "Duplicate Qualifiers " << Style->QualifierOrder.size() in validateQualifierOrder()
1853 if (!llvm::is_contained(Style->QualifierOrder, "type")) in validateQualifierOrder()
1860 FormatStyle *Style, bool AllowUnknownOptions, in parseConfiguration() argument
1863 assert(Style); in parseConfiguration()
1864 FormatStyle::LanguageKind Language = Style->Language; in parseConfiguration()
1868 Style->StyleSet.Clear(); in parseConfiguration()
1876 Input.setContext(Style); in parseConfiguration()
1901 for (const FormatStyle &Style : llvm::reverse(Styles)) { in parseConfiguration() local
1902 if (Style.Language != FormatStyle::LK_None) in parseConfiguration()
1903 StyleSet.Add(Style); in parseConfiguration()
1904 if (Style.Language == Language) in parseConfiguration()
1914 *Style = *StyleSet.Get(Language); in parseConfiguration()
1915 if (Style->InsertTrailingCommas != FormatStyle::TCS_None && in parseConfiguration()
1916 Style->BinPackArguments) { in parseConfiguration()
1920 if (Style->QualifierAlignment != FormatStyle::QAS_Leave) in parseConfiguration()
1921 return make_error_code(validateQualifierOrder(Style)); in parseConfiguration()
1925 std::string configurationAsText(const FormatStyle &Style) { in configurationAsText() argument
1931 FormatStyle NonConstStyle = Style; in configurationAsText()
1946 FormatStyle Style = It->second; in Get() local
1947 Style.StyleSet = *this; in Get()
1948 return Style; in Get()
1951 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) { in Add() argument
1952 assert(Style.Language != LK_None && in Add()
1955 !Style.StyleSet.Styles && in Add()
1959 (*Styles)[Style.Language] = std::move(Style); in Add()
1973 BracesInserter(const Environment &Env, const FormatStyle &Style) in BracesInserter() argument
1974 : TokenAnalyzer(Env, Style) {} in BracesInserter()
2026 BracesRemover(const Environment &Env, const FormatStyle &Style) in BracesRemover() argument
2027 : TokenAnalyzer(Env, Style) {} in BracesRemover()
2077 SemiRemover(const Environment &Env, const FormatStyle &Style) in SemiRemover() argument
2078 : TokenAnalyzer(Env, Style) {} in SemiRemover()
2128 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style) in JavaScriptRequoter() argument
2129 : TokenAnalyzer(Env, Style) {} in JavaScriptRequoter()
2156 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single && in requoteJSStringLiteral()
2158 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double && in requoteJSStringLiteral()
2164 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single; in requoteJSStringLiteral()
2216 Formatter(const Environment &Env, const FormatStyle &Style, in Formatter() argument
2218 : TokenAnalyzer(Env, Style), Status(Status) {} in Formatter()
2232 Env.getSourceManager(), Style, in analyze()
2233 Style.LineEnding > FormatStyle::LE_CRLF in analyze()
2236 Style.LineEnding == FormatStyle::LE_DeriveCRLF) in analyze()
2237 : Style.LineEnding == FormatStyle::LE_CRLF); in analyze()
2238 ContinuationIndenter Indenter(Style, Tokens.getKeywords(), in analyze()
2242 UnwrappedLineFormatter(&Indenter, &Whitespaces, Style, in analyze()
2324 if (Style.DerivePointerAlignment) { in deriveLocalStyle()
2327 Style.PointerAlignment = FormatStyle::PAS_Right; in deriveLocalStyle()
2329 Style.PointerAlignment = FormatStyle::PAS_Left; in deriveLocalStyle()
2330 Style.ReferenceAlignment = FormatStyle::RAS_Pointer; in deriveLocalStyle()
2332 if (Style.Standard == FormatStyle::LS_Auto) { in deriveLocalStyle()
2333 Style.Standard = hasCpp03IncompatibleFormat(AnnotatedLines) in deriveLocalStyle()
2358 TrailingCommaInserter(const Environment &Env, const FormatStyle &Style) in TrailingCommaInserter() argument
2359 : TokenAnalyzer(Env, Style) {} in TrailingCommaInserter()
2404 if (ColumnNumber > Style.ColumnLimit) in insertTrailingCommas()
2419 Cleaner(const Environment &Env, const FormatStyle &Style) in Cleaner() argument
2420 : TokenAnalyzer(Env, Style), in Cleaner()
2494 if (Style.BraceWrapping.AfterNamespace) { in checkEmptyNamespace()
2642 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style) in ObjCHeaderStyleGuesser() argument
2643 : TokenAnalyzer(Env, Style), IsObjC(false) {} in ObjCHeaderStyleGuesser()
2649 assert(Style.Language == FormatStyle::LK_Cpp); in analyze()
2864 static void sortCppIncludes(const FormatStyle &Style, in sortCppIncludes() argument
2869 tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName); in sortCppIncludes()
2879 if (Style.SortIncludes == FormatStyle::SI_CaseInsensitive) { in sortCppIncludes()
2922 Style.IncludeStyle.IncludeBlocks == tooling::IncludeStyle::IBS_Preserve) { in sortCppIncludes()
2930 if (Style.IncludeStyle.IncludeBlocks == in sortCppIncludes()
2962 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code, in sortCppIncludes() argument
2981 tooling::IncludeCategoryManager Categories(Style.IncludeStyle, FileName); in sortCppIncludes()
3021 (Style.IncludeStyle.IncludeBlocks == tooling::IncludeStyle::IBS_Merge || in sortCppIncludes()
3022 Style.IncludeStyle.IncludeBlocks == in sortCppIncludes()
3048 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code, in sortCppIncludes()
3065 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code, Replaces, in sortCppIncludes()
3073 static unsigned findJavaImportGroup(const FormatStyle &Style, in findJavaImportGroup() argument
3077 for (unsigned I = 0; I < Style.JavaImportGroups.size(); I++) { in findJavaImportGroup()
3078 const std::string &GroupPrefix = Style.JavaImportGroups[I]; in findJavaImportGroup()
3093 static void sortJavaImports(const FormatStyle &Style, in sortJavaImports() argument
3109 JavaImportGroups.push_back(findJavaImportGroup(Style, Import.Identifier)); in sortJavaImports()
3112 Style.SortJavaStaticImport == FormatStyle::SJSIO_After; in sortJavaImports()
3175 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code, in sortJavaImports() argument
3223 sortJavaImports(Style, ImportsInBlock, Ranges, FileName, Code, Replaces); in sortJavaImports()
3236 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code, in sortIncludes() argument
3240 if (!Style.SortIncludes || Style.DisableFormat) in sortIncludes()
3244 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript && in sortIncludes()
3248 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript) in sortIncludes()
3249 return sortJavaScriptImports(Style, Code, Ranges, FileName); in sortIncludes()
3250 if (Style.Language == FormatStyle::LanguageKind::LK_Java) in sortIncludes()
3251 return sortJavaImports(Style, Code, Ranges, FileName, Replaces); in sortIncludes()
3252 sortCppIncludes(Style, Code, Ranges, FileName, Replaces, Cursor); in sortIncludes()
3260 const FormatStyle &Style) { in processReplacements() argument
3271 ProcessFunc(Style, *NewCode, ChangedRanges, FileName); in processReplacements()
3278 const FormatStyle &Style) { in formatReplacements() argument
3281 auto SortIncludes = [](const FormatStyle &Style, StringRef Code, in formatReplacements()
3284 return sortIncludes(Style, Code, Ranges, FileName); in formatReplacements()
3287 processReplacements(SortIncludes, Code, Replaces, Style); in formatReplacements()
3293 auto Reformat = [](const FormatStyle &Style, StringRef Code, in formatReplacements() argument
3296 return reformat(Style, Code, Ranges, FileName); in formatReplacements()
3298 return processReplacements(Reformat, Code, *SortedReplaces, Style); in formatReplacements()
3316 const FormatStyle &Style) { in fixCppIncludeInsertions() argument
3317 if (!Style.isCpp()) in fixCppIncludeInsertions()
3342 tooling::HeaderIncludes Includes(FileName, Code, Style.IncludeStyle); in fixCppIncludeInsertions()
3389 const FormatStyle &Style) { in cleanupAroundReplacements() argument
3392 auto Cleanup = [](const FormatStyle &Style, StringRef Code, in cleanupAroundReplacements()
3395 return cleanup(Style, Code, Ranges, FileName); in cleanupAroundReplacements()
3399 fixCppIncludeInsertions(Code, Replaces, Style); in cleanupAroundReplacements()
3400 return cantFail(processReplacements(Cleanup, Code, NewReplaces, Style)); in cleanupAroundReplacements()
3405 reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
3409 FormatStyle Expanded = Style; in reformat()
3432 if (Style.isJson()) { in reformat()
3440 Formatter(*Env, Style, Status).process().first; in reformat()
3464 if (Style.isCpp()) { in reformat()
3465 if (Style.QualifierAlignment != FormatStyle::QAS_Leave) { in reformat()
3474 if (Style.InsertBraces) { in reformat()
3482 if (Style.RemoveBracesLLVM) { in reformat()
3490 if (Style.RemoveSemicolon) { in reformat()
3498 if (Style.FixNamespaceComments) { in reformat()
3504 if (Style.SortUsingDeclarations != FormatStyle::SUD_Never) { in reformat()
3511 if (Style.SeparateDefinitionBlocks != FormatStyle::SDS_Leave) { in reformat()
3517 if (Style.isJavaScript() && in reformat()
3518 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave) { in reformat()
3528 if (Style.isJavaScript() && in reformat()
3529 Style.InsertTrailingCommas == FormatStyle::TCS_Wrapped) { in reformat()
3561 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
3565 return internal::reformat(Style, Code, Ranges, in reformat()
3572 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code, in cleanup() argument
3576 if (Style.Language != FormatStyle::LK_Cpp) in cleanup()
3581 return Cleaner(*Env, Style).process().first; in cleanup()
3584 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, in reformat() argument
3588 auto Result = reformat(Style, Code, Ranges, FileName, &Status); in reformat()
3594 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style, in fixNamespaceEndComments() argument
3601 return NamespaceEndCommentsFixer(*Env, Style).process().first; in fixNamespaceEndComments()
3604 tooling::Replacements separateDefinitionBlocks(const FormatStyle &Style, in separateDefinitionBlocks() argument
3611 return DefinitionBlockSeparator(*Env, Style).process().first; in separateDefinitionBlocks()
3614 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style, in sortUsingDeclarations() argument
3621 return UsingDeclarationsSorter(*Env, Style).process().first; in sortUsingDeclarations()
3624 LangOptions getFormattingLangOpts(const FormatStyle &Style) { in getFormattingLangOpts() argument
3627 FormatStyle::LanguageStandard LexingStd = Style.Standard; in getFormattingLangOpts()
3644 bool AlternativeOperators = Style.isCpp(); in getFormattingLangOpts()
3729 FormatStyle *Style, bool AllowUnknownOptions) { in loadAndParseConfigFile() argument
3734 if (auto EC = parseConfiguration(*Text.get(), Style, AllowUnknownOptions)) in loadAndParseConfigFile()
3745 FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code)); in getStyle() local
3748 if (!getPredefinedStyle(FallbackStyleName, Style.Language, &FallbackStyle)) in getStyle()
3758 parseConfiguration(llvm::MemoryBufferRef(StyleName, Source), &Style, in getStyle()
3762 if (Style.InheritsParentConfig) { in getStyle()
3766 return Style; in getStyle()
3771 if (!Style.InheritsParentConfig && in getStyle()
3775 loadAndParseConfigFile(ConfigFile, FS, &Style, AllowUnknownOptions); in getStyle()
3784 if (!Style.InheritsParentConfig) in getStyle()
3785 return Style; in getStyle()
3796 if (!Style.InheritsParentConfig && !StyleName.equals_insensitive("file")) { in getStyle()
3797 if (!getPredefinedStyle(StyleName, Style.Language, &Style)) in getStyle()
3799 if (!Style.InheritsParentConfig) in getStyle()
3800 return Style; in getStyle()
3804 Style.InheritsParentConfig = false; in getStyle()
3818 auto applyChildFormatTexts = [&](FormatStyle *Style) { in getStyle() argument
3820 auto EC = parseConfiguration(*MemBuf, Style, AllowUnknownOptions, in getStyle()
3848 loadAndParseConfigFile(ConfigFile, FS, &Style, AllowUnknownOptions); in getStyle()
3862 if (!Style.InheritsParentConfig) { in getStyle()
3864 return Style; in getStyle()
3867 applyChildFormatTexts(&Style); in getStyle()
3869 return Style; in getStyle()
3875 Style.InheritsParentConfig = false; in getStyle()
3889 getLanguageName(Style.Language) + ": " + in getStyle()