28 #include "llvm/ADT/STLExtras.h" 29 #include "llvm/Support/Debug.h" 31 #define DEBUG_TYPE "format-formatter" 38 unsigned FirstStartColumn,
unsigned NextStartColumn,
39 unsigned LastStartColumn)
41 ID(VirtualSM->get().getMainFileID()), FirstStartColumn(FirstStartColumn),
42 NextStartColumn(NextStartColumn), LastStartColumn(LastStartColumn) {
52 : Style(Style), Env(Env),
58 llvm::dbgs() <<
"File encoding: " 61 LLVM_DEBUG(llvm::dbgs() <<
"Language: " <<
getLanguageName(Style.Language)
75 for (
unsigned Run = 0, RunE =
UnwrappedLines.size(); Run + 1 != RunE; ++Run) {
76 LLVM_DEBUG(llvm::dbgs() <<
"Run " << Run <<
"...\n");
82 Annotator.annotate(*AnnotatedLines.back());
85 std::pair<tooling::Replacements, unsigned> RunResult =
86 analyze(Annotator, AnnotatedLines, Tokens);
89 llvm::dbgs() <<
"Replacements for run " << Run <<
":\n";
91 E = RunResult.first.end();
93 llvm::dbgs() << I->toString() <<
"\n";
96 for (
unsigned i = 0, e = AnnotatedLines.size();
i != e; ++
i) {
97 delete AnnotatedLines[
i];
100 Penalty += RunResult.second;
101 for (
const auto &R : RunResult.first) {
102 auto Err = Result.
add(R);
111 return {Result, Penalty};
SourceLocation getLocForStartOfFile(FileID FID) const
Return the source location corresponding to the first byte of the specified file. ...
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
Defines the clang::FileManager interface and associated types.
Defines the SourceManager interface.
AffectedRangeManager class manages affected ranges in the code.
Parser - This implements a parser for the C family of languages.
Contains functions for text encoding manipulation.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
This file implements a token annotator, i.e.
SourceManager and necessary depdencies (e.g.
Defines the Diagnostic-related interfaces.
static CharSourceRange getCharRange(SourceRange R)
Encodes a location in the source.
This file contains the declaration of the UnwrappedLineParser, which turns a stream of tokens into Un...
Dataflow Directional Tag Classes.
This file declares an abstract TokenAnalyzer, and associated helper classes.