#include "IncludeSorter.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include <algorithm>
#include <optional>
namespace clang::tidy {
namespace utils {
namespace {
StringRef removeFirstSuffix(StringRef Str, ArrayRef<const char *> Suffixes) { … }
StringRef makeCanonicalName(StringRef Str, IncludeSorter::IncludeStyle Style) { … }
size_t findNextLine(const char *Text) { … }
IncludeSorter::IncludeKinds
determineIncludeKind(StringRef CanonicalFile, StringRef IncludeFile,
bool IsAngled, IncludeSorter::IncludeStyle Style) { … }
int compareHeaders(StringRef LHS, StringRef RHS,
IncludeSorter::IncludeStyle Style) { … }
}
IncludeSorter::IncludeSorter(const SourceManager *SourceMgr,
const FileID FileID, StringRef FileName,
IncludeStyle Style)
: … { … }
void IncludeSorter::addInclude(StringRef FileName, bool IsAngled,
SourceLocation HashLocation,
SourceLocation EndLocation) { … }
std::optional<FixItHint>
IncludeSorter::createIncludeInsertion(StringRef FileName, bool IsAngled) { … }
}
llvm::ArrayRef<std::pair<utils::IncludeSorter::IncludeStyle, StringRef>>
OptionEnumMapping<utils::IncludeSorter::IncludeStyle>::getEnumMapping() { … }
}