Lines Matching defs:clang
1 //===-- clang-format/ClangFormat.cpp - Clang format tool ------------------===//
10 /// This file implements a clang-format tool that automatically formats
15 #include "clang/Basic/Diagnostic.h"
16 #include "clang/Basic/DiagnosticOptions.h"
17 #include "clang/Basic/FileManager.h"
18 #include "clang/Basic/SourceManager.h"
19 #include "clang/Basic/Version.h"
20 #include "clang/Format/Format.h"
21 #include "clang/Rewrite/Core/Rewriter.h"
28 using clang::tooling::Replacements;
49 "-length, clang-format will format up to the end\n"
63 Style("style", cl::desc(clang::format::StyleOptionHelpDescription),
64 cl::init(clang::format::DefaultFormatStyle),
69 "fallback in case clang-format is invoked with\n"
70 "-style=file, but can not find the .clang-format\n"
73 cl::init(clang::format::DefaultFallbackStyle),
79 "When reading from stdin, clang-format assumes this\n"
98 "clang-format from an editor integration"),
131 NoWarnFormat("Wno-clang-format-violations",
138 cl::desc("Set the maximum number of clang-format errors to emit before "
162 namespace clang {
310 "code should be clang-formatted [-Wclang-format-violations]");
441 } // namespace clang
444 OS << clang::getClangToolFullVersion("clang-format") << '\n';
467 llvm::Expected<clang::format::FormatStyle> FormatStyle =
468 clang::format::getStyle(Style, FileName, FallbackStyle,
474 std::string Config = clang::format::configurationAsText(*FormatStyle);
505 Error = clang::format::format("-");
517 Error |= clang::format::format(FileName);