Lines Matching refs:format

16 #define DEBUG_TYPE "format-formatter"
37 struct ScalarEnumerationTraits<clang::format::FormatStyle::LanguageStandard> {
39 clang::format::FormatStyle::LanguageStandard &Value) {
40 IO.enumCase(Value, "Cpp03", clang::format::FormatStyle::LS_Cpp03);
41 IO.enumCase(Value, "C++03", clang::format::FormatStyle::LS_Cpp03);
42 IO.enumCase(Value, "Cpp11", clang::format::FormatStyle::LS_Cpp11);
43 IO.enumCase(Value, "C++11", clang::format::FormatStyle::LS_Cpp11);
44 IO.enumCase(Value, "Auto", clang::format::FormatStyle::LS_Auto);
49 struct ScalarEnumerationTraits<clang::format::FormatStyle::UseTabStyle> {
51 clang::format::FormatStyle::UseTabStyle &Value) {
52 IO.enumCase(Value, "Never", clang::format::FormatStyle::UT_Never);
53 IO.enumCase(Value, "false", clang::format::FormatStyle::UT_Never);
54 IO.enumCase(Value, "Always", clang::format::FormatStyle::UT_Always);
55 IO.enumCase(Value, "true", clang::format::FormatStyle::UT_Always);
57 clang::format::FormatStyle::UT_ForIndentation);
62 struct ScalarEnumerationTraits<clang::format::FormatStyle::BraceBreakingStyle> {
64 enumeration(IO &IO, clang::format::FormatStyle::BraceBreakingStyle &Value) {
65 IO.enumCase(Value, "Attach", clang::format::FormatStyle::BS_Attach);
66 IO.enumCase(Value, "Linux", clang::format::FormatStyle::BS_Linux);
67 IO.enumCase(Value, "Stroustrup", clang::format::FormatStyle::BS_Stroustrup);
68 IO.enumCase(Value, "Allman", clang::format::FormatStyle::BS_Allman);
74 clang::format::FormatStyle::NamespaceIndentationKind> {
77 clang::format::FormatStyle::NamespaceIndentationKind &Value) {
78 IO.enumCase(Value, "None", clang::format::FormatStyle::NI_None);
79 IO.enumCase(Value, "Inner", clang::format::FormatStyle::NI_Inner);
80 IO.enumCase(Value, "All", clang::format::FormatStyle::NI_All);
84 template <> struct MappingTraits<clang::format::FormatStyle> {
85 static void mapping(llvm::yaml::IO &IO, clang::format::FormatStyle &Style) {
92 clang::format::FormatStyle PredefinedStyle;
93 if (clang::format::getPredefinedStyle(StyleName, &PredefinedStyle) &&
103 if (!clang::format::getPredefinedStyle(BasedOnStyle, &Style)) {
178 namespace format {
362 void format(unsigned FirstIndent, const AnnotatedLine *Line) {
537 unsigned format(const SmallVectorImpl<AnnotatedLine *> &Lines, bool DryRun,
611 Formatter.format(Indent, &TheLine);
613 Penalty += format(TheLine, Indent, DryRun);
663 unsigned format(const AnnotatedLine &Line, unsigned FirstIndent,
667 // If the ObjC method declaration does not fit on a line, we should format
926 /// format the nested block before it.
938 /// If \p NewLine is true, we format the nested block on separate lines, i.e.
939 /// break after the "{", format all lines with correct indentation and the put
958 Penalty += format(Previous.Children, DryRun, AdditionalIndent);
976 Penalty += format(*Previous.Children[0], State.Column + 1, DryRun);
1221 tooling::Replacements format() {
1236 format(AnnotatedLines, StructuralError, Tokens);
1254 tooling::Replacements format(SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,
1270 Formatter.format(AnnotatedLines, /*DryRun=*/false);
1359 return formatter.format();
1403 ".clang-format file located in one of the parent\n"
1440 llvm::sys::path::append(ConfigFile, ".clang-format");
1448 // Try _clang-format too, since dotfiles are not commonly used on Windows.
1450 llvm::sys::path::append(ConfigFile, "_clang-format");
1471 llvm::errs() << "Can't find usable .clang-format, using " << FallbackStyle
1476 } // namespace format