#include "ClangTidyOptions.h"
#include "ClangTidyModuleRegistry.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/YAMLTraits.h"
#include <algorithm>
#include <optional>
#include <utility>
#define DEBUG_TYPE …
ClangTidyOptions;
FileFilter;
OptionsSource;
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FileFilter)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FileFilter::LineRange)
namespace llvm::yaml {
template <> struct SequenceTraits<FileFilter::LineRange> { … };
template <> struct MappingTraits<FileFilter> { … };
template <> struct MappingTraits<ClangTidyOptions::StringPair> { … };
struct NOptionMap { … };
template <>
void yamlize(IO &IO, ClangTidyOptions::OptionMap &Val, bool,
EmptyContext &Ctx) { … }
struct ChecksVariant { … };
template <> void yamlize(IO &IO, ChecksVariant &Val, bool, EmptyContext &Ctx) { … }
static void mapChecks(IO &IO, std::optional<std::string> &Checks) { … }
template <> struct MappingTraits<ClangTidyOptions> { … };
}
namespace clang::tidy {
ClangTidyOptions ClangTidyOptions::getDefaults() { … }
template <typename T>
static void mergeVectors(std::optional<T> &Dest, const std::optional<T> &Src) { … }
static void mergeCommaSeparatedLists(std::optional<std::string> &Dest,
const std::optional<std::string> &Src) { … }
template <typename T>
static void overrideValue(std::optional<T> &Dest, const std::optional<T> &Src) { … }
ClangTidyOptions &ClangTidyOptions::mergeWith(const ClangTidyOptions &Other,
unsigned Order) { … }
ClangTidyOptions ClangTidyOptions::merge(const ClangTidyOptions &Other,
unsigned Order) const { … }
const char ClangTidyOptionsProvider::OptionsSourceTypeDefaultBinary[] = …;
const char ClangTidyOptionsProvider::OptionsSourceTypeCheckCommandLineOption[] = …;
const char
ClangTidyOptionsProvider::OptionsSourceTypeConfigCommandLineOption[] = …;
ClangTidyOptions
ClangTidyOptionsProvider::getOptions(llvm::StringRef FileName) { … }
std::vector<OptionsSource>
DefaultOptionsProvider::getRawOptions(llvm::StringRef FileName) { … }
ConfigOptionsProvider::ConfigOptionsProvider(
ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
ClangTidyOptions ConfigOptions, ClangTidyOptions OverrideOptions,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
: … { … }
std::vector<OptionsSource>
ConfigOptionsProvider::getRawOptions(llvm::StringRef FileName) { … }
FileOptionsBaseProvider::FileOptionsBaseProvider(
ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
ClangTidyOptions OverrideOptions,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS)
: … { … }
FileOptionsBaseProvider::FileOptionsBaseProvider(
ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
ClangTidyOptions OverrideOptions,
FileOptionsBaseProvider::ConfigFileHandlers ConfigHandlers)
: … { … }
void FileOptionsBaseProvider::addRawFileOptions(
llvm::StringRef AbsolutePath, std::vector<OptionsSource> &CurOptions) { … }
FileOptionsProvider::FileOptionsProvider(
ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
ClangTidyOptions OverrideOptions,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS)
: … { … }
FileOptionsProvider::FileOptionsProvider(
ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
ClangTidyOptions OverrideOptions,
FileOptionsBaseProvider::ConfigFileHandlers ConfigHandlers)
: … { … }
std::vector<OptionsSource>
FileOptionsProvider::getRawOptions(StringRef FileName) { … }
std::optional<OptionsSource>
FileOptionsBaseProvider::tryReadConfigFile(StringRef Directory) { … }
std::error_code parseLineFilter(StringRef LineFilter,
clang::tidy::ClangTidyGlobalOptions &Options) { … }
llvm::ErrorOr<ClangTidyOptions>
parseConfiguration(llvm::MemoryBufferRef Config) { … }
static void diagHandlerImpl(const llvm::SMDiagnostic &Diag, void *Ctx) { … }
llvm::ErrorOr<ClangTidyOptions>
parseConfigurationWithDiags(llvm::MemoryBufferRef Config,
DiagCallback Handler) { … }
std::string configurationAsText(const ClangTidyOptions &Options) { … }
}