llvm/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

//===--- ClangTidyOptions.cpp - clang-tidy ----------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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 {

// Map std::pair<int, int> to a JSON array of size 2.
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 llvm::yaml

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)
    :{}

// FIXME: This method has some common logic with clang::format::getStyle().
// Consider pulling out common bits to a findParentFileWithName function or
// similar.
std::vector<OptionsSource>
FileOptionsProvider::getRawOptions(StringRef FileName) {}

std::optional<OptionsSource>
FileOptionsBaseProvider::tryReadConfigFile(StringRef Directory) {}

/// Parses -line-filter option and stores it to the \c Options.
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) {}

} // namespace clang::tidy