Go to the documentation of this file.
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDESORTER_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDESORTER_H
12 #include "../ClangTidyCheck.h"
39 IncludeSorter(
const SourceManager *SourceMgr,
const FileID FileID,
44 SourceLocation HashLocation, SourceLocation EndLocation);
51 typedef SmallVector<SourceRange, 1> SourceRangeVector;
53 const SourceManager *SourceMgr;
57 StringRef CanonicalFile;
59 SourceRangeVector SourceLocations;
61 llvm::StringMap<SourceRangeVector> IncludeLocations;
69 static ArrayRef<std::pair<utils::IncludeSorter::IncludeStyle, StringRef>>
74 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDESORTER_H
Class used by IncludeInserterCallback to record the names of the inclusions in a given source file be...
IncludeStyle
Supported include styles.
total number of valid IncludeKinds
This class should be specialized by any enum type that needs to be converted to and from an llvm::Str...
e.g. #include "foo.h" when editing foo.cc
void AddInclude(StringRef FileName, bool IsAngled, SourceLocation HashLocation, SourceLocation EndLocation)
Adds the given include directive to the sorter.
bool IsAngled
true if this was an include with angle brackets
static ArrayRef< std::pair< T, StringRef > > getEnumMapping()=delete
IncludeKinds
The classifications of inclusions, in the order they should be sorted.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Optional< FixItHint > CreateIncludeInsertion(StringRef FileName, bool IsAngled)
Creates a quoted inclusion directive in the right sort order.
IncludeSorter(const SourceManager *SourceMgr, const FileID FileID, StringRef FileName, IncludeStyle Style)
IncludeSorter constructor; takes the FileID and name of the file to be processed by the sorter.