#include "ClangTidyCheck.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/YAMLParser.h"
#include <optional>
namespace clang::tidy {
ClangTidyCheck::ClangTidyCheck(StringRef CheckName, ClangTidyContext *Context)
: … { … }
DiagnosticBuilder ClangTidyCheck::diag(SourceLocation Loc,
StringRef Description,
DiagnosticIDs::Level Level) { … }
DiagnosticBuilder ClangTidyCheck::diag(StringRef Description,
DiagnosticIDs::Level Level) { … }
DiagnosticBuilder
ClangTidyCheck::configurationDiag(StringRef Description,
DiagnosticIDs::Level Level) const { … }
void ClangTidyCheck::run(const ast_matchers::MatchFinder::MatchResult &Result) { … }
ClangTidyCheck::OptionsView::OptionsView(
StringRef CheckName, const ClangTidyOptions::OptionMap &CheckOptions,
ClangTidyContext *Context)
: … { … }
std::optional<StringRef>
ClangTidyCheck::OptionsView::get(StringRef LocalName) const { … }
static ClangTidyOptions::OptionMap::const_iterator
findPriorityOption(const ClangTidyOptions::OptionMap &Options,
StringRef NamePrefix, StringRef LocalName,
llvm::StringSet<> *Collector) { … }
std::optional<StringRef>
ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const { … }
static std::optional<bool> getAsBool(StringRef Value,
const llvm::Twine &LookupName) { … }
template <>
std::optional<bool>
ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName) const { … }
template <>
std::optional<bool>
ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName) const { … }
void ClangTidyCheck::OptionsView::store(ClangTidyOptions::OptionMap &Options,
StringRef LocalName,
StringRef Value) const { … }
void ClangTidyCheck::OptionsView::storeInt(ClangTidyOptions::OptionMap &Options,
StringRef LocalName,
int64_t Value) const { … }
void ClangTidyCheck::OptionsView::storeUnsigned(
ClangTidyOptions::OptionMap &Options, StringRef LocalName,
uint64_t Value) const { … }
template <>
void ClangTidyCheck::OptionsView::store<bool>(
ClangTidyOptions::OptionMap &Options, StringRef LocalName,
bool Value) const { … }
std::optional<int64_t> ClangTidyCheck::OptionsView::getEnumInt(
StringRef LocalName, ArrayRef<NameAndValue> Mapping, bool CheckGlobal,
bool IgnoreCase) const { … }
static constexpr llvm::StringLiteral ConfigWarning(
"invalid configuration value '%0' for option '%1'%select{|; expected a "
"bool|; expected an integer|; did you mean '%3'?}2");
void ClangTidyCheck::OptionsView::diagnoseBadBooleanOption(
const Twine &Lookup, StringRef Unparsed) const { … }
void ClangTidyCheck::OptionsView::diagnoseBadIntegerOption(
const Twine &Lookup, StringRef Unparsed) const { … }
void ClangTidyCheck::OptionsView::diagnoseBadEnumOption(
const Twine &Lookup, StringRef Unparsed, StringRef Suggestion) const { … }
StringRef ClangTidyCheck::OptionsView::get(StringRef LocalName,
StringRef Default) const { … }
StringRef
ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName,
StringRef Default) const { … }
}