Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidy.h b/linux-x64/clang/include/clang-tidy/ClangTidy.h
new file mode 100644
index 0000000..99dcbb6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidy.h
@@ -0,0 +1,105 @@
+//===--- ClangTidy.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDY_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDY_H
+
+#include "ClangTidyDiagnosticConsumer.h"
+#include "ClangTidyOptions.h"
+#include <memory>
+#include <vector>
+
+namespace llvm {
+class raw_ostream;
+} // namespace llvm
+
+namespace clang {
+
+class ASTConsumer;
+class CompilerInstance;
+namespace tooling {
+class CompilationDatabase;
+} // namespace tooling
+
+namespace tidy {
+
+class ClangTidyCheckFactories;
+
+class ClangTidyASTConsumerFactory {
+public:
+ ClangTidyASTConsumerFactory(
+ ClangTidyContext &Context,
+ IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS = nullptr);
+
+ /// Returns an ASTConsumer that runs the specified clang-tidy checks.
+ std::unique_ptr<clang::ASTConsumer>
+ CreateASTConsumer(clang::CompilerInstance &Compiler, StringRef File);
+
+ /// Get the list of enabled checks.
+ std::vector<std::string> getCheckNames();
+
+ /// Get the union of options from all checks.
+ ClangTidyOptions::OptionMap getCheckOptions();
+
+private:
+ ClangTidyContext &Context;
+ IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS;
+ std::unique_ptr<ClangTidyCheckFactories> CheckFactories;
+};
+
+/// Fills the list of check names that are enabled when the provided
+/// filters are applied.
+std::vector<std::string> getCheckNames(const ClangTidyOptions &Options,
+ bool AllowEnablingAnalyzerAlphaCheckers);
+
+/// Returns the effective check-specific options.
+///
+/// The method configures ClangTidy with the specified \p Options and collects
+/// effective options from all created checks. The returned set of options
+/// includes default check-specific options for all keys not overridden by \p
+/// Options.
+ClangTidyOptions::OptionMap
+getCheckOptions(const ClangTidyOptions &Options,
+ bool AllowEnablingAnalyzerAlphaCheckers);
+
+/// Run a set of clang-tidy checks on a set of files.
+///
+/// \param EnableCheckProfile If provided, it enables check profile collection
+/// in MatchFinder, and will contain the result of the profile.
+/// \param StoreCheckProfile If provided, and EnableCheckProfile is true,
+/// the profile will not be output to stderr, but will instead be stored
+/// as a JSON file in the specified directory.
+std::vector<ClangTidyError>
+runClangTidy(clang::tidy::ClangTidyContext &Context,
+ const tooling::CompilationDatabase &Compilations,
+ ArrayRef<std::string> InputFiles,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> BaseFS,
+ bool EnableCheckProfile = false,
+ llvm::StringRef StoreCheckProfile = StringRef());
+
+// FIXME: This interface will need to be significantly extended to be useful.
+// FIXME: Implement confidence levels for displaying/fixing errors.
+//
+/// Displays the found \p Errors to the users. If \p Fix is true, \p
+/// Errors containing fixes are automatically applied and reformatted. If no
+/// clang-format configuration file is found, the given \P FormatStyle is used.
+void handleErrors(llvm::ArrayRef<ClangTidyError> Errors,
+ ClangTidyContext &Context, bool Fix,
+ unsigned &WarningsAsErrorsCount,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS);
+
+/// Serializes replacements into YAML and writes them to the specified
+/// output stream.
+void exportReplacements(StringRef MainFilePath,
+ const std::vector<ClangTidyError> &Errors,
+ raw_ostream &OS);
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDY_H
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyCheck.h b/linux-x64/clang/include/clang-tidy/ClangTidyCheck.h
new file mode 100644
index 0000000..9fa0d63
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyCheck.h
@@ -0,0 +1,580 @@
+//===--- ClangTidyCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYCHECK_H
+
+#include "ClangTidyDiagnosticConsumer.h"
+#include "ClangTidyOptions.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Basic/Diagnostic.h"
+#include "llvm/ADT/Optional.h"
+#include "llvm/Support/Error.h"
+#include <type_traits>
+#include <utility>
+#include <vector>
+
+namespace clang {
+
+class CompilerInstance;
+class SourceManager;
+
+namespace tidy {
+
+/// This class should be specialized by any enum type that needs to be converted
+/// to and from an \ref llvm::StringRef.
+template <class T> struct OptionEnumMapping {
+ // Specializations of this struct must implement this function.
+ static ArrayRef<std::pair<T, StringRef>> getEnumMapping() = delete;
+};
+
+template <typename T> class OptionError : public llvm::ErrorInfo<T> {
+ std::error_code convertToErrorCode() const override {
+ return llvm::inconvertibleErrorCode();
+ }
+
+public:
+ void log(raw_ostream &OS) const override { OS << this->message(); }
+};
+
+class MissingOptionError : public OptionError<MissingOptionError> {
+public:
+ explicit MissingOptionError(std::string OptionName)
+ : OptionName(OptionName) {}
+
+ std::string message() const override;
+ static char ID;
+private:
+ const std::string OptionName;
+};
+
+class UnparseableEnumOptionError
+ : public OptionError<UnparseableEnumOptionError> {
+public:
+ explicit UnparseableEnumOptionError(std::string LookupName,
+ std::string LookupValue)
+ : LookupName(LookupName), LookupValue(LookupValue) {}
+ explicit UnparseableEnumOptionError(std::string LookupName,
+ std::string LookupValue,
+ std::string SuggestedValue)
+ : LookupName(LookupName), LookupValue(LookupValue),
+ SuggestedValue(SuggestedValue) {}
+
+ std::string message() const override;
+ static char ID;
+
+private:
+ const std::string LookupName;
+ const std::string LookupValue;
+ const llvm::Optional<std::string> SuggestedValue;
+};
+
+class UnparseableIntegerOptionError
+ : public OptionError<UnparseableIntegerOptionError> {
+public:
+ explicit UnparseableIntegerOptionError(std::string LookupName,
+ std::string LookupValue,
+ bool IsBoolean = false)
+ : LookupName(LookupName), LookupValue(LookupValue), IsBoolean(IsBoolean) {
+ }
+
+ std::string message() const override;
+ static char ID;
+
+private:
+ const std::string LookupName;
+ const std::string LookupValue;
+ const bool IsBoolean;
+};
+
+/// Base class for all clang-tidy checks.
+///
+/// To implement a ``ClangTidyCheck``, write a subclass and override some of the
+/// base class's methods. E.g. to implement a check that validates namespace
+/// declarations, override ``registerMatchers``:
+///
+/// ~~~{.cpp}
+/// void registerMatchers(ast_matchers::MatchFinder *Finder) override {
+/// Finder->addMatcher(namespaceDecl().bind("namespace"), this);
+/// }
+/// ~~~
+///
+/// and then override ``check(const MatchResult &Result)`` to do the actual
+/// check for each match.
+///
+/// A new ``ClangTidyCheck`` instance is created per translation unit.
+///
+/// FIXME: Figure out whether carrying information from one TU to another is
+/// useful/necessary.
+class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
+public:
+ /// Initializes the check with \p CheckName and \p Context.
+ ///
+ /// Derived classes must implement the constructor with this signature or
+ /// delegate it. If a check needs to read options, it can do this in the
+ /// constructor using the Options.get() methods below.
+ ClangTidyCheck(StringRef CheckName, ClangTidyContext *Context);
+
+ /// Override this to disable registering matchers and PP callbacks if an
+ /// invalid language version is being used.
+ ///
+ /// For example if a check is examining overloaded functions then this should
+ /// be overridden to return false when the CPlusPlus flag is not set in
+ /// \p LangOpts.
+ virtual bool isLanguageVersionSupported(const LangOptions &LangOpts) const {
+ return true;
+ }
+
+ /// Override this to register ``PPCallbacks`` in the preprocessor.
+ ///
+ /// This should be used for clang-tidy checks that analyze preprocessor-
+ /// dependent properties, e.g. include directives and macro definitions.
+ ///
+ /// This will only be executed if the function isLanguageVersionSupported
+ /// returns true.
+ ///
+ /// There are two Preprocessors to choose from that differ in how they handle
+ /// modular #includes:
+ /// - PP is the real Preprocessor. It doesn't walk into modular #includes and
+ /// thus doesn't generate PPCallbacks for their contents.
+ /// - ModuleExpanderPP preprocesses the whole translation unit in the
+ /// non-modular mode, which allows it to generate PPCallbacks not only for
+ /// the main file and textual headers, but also for all transitively
+ /// included modular headers when the analysis runs with modules enabled.
+ /// When modules are not enabled ModuleExpanderPP just points to the real
+ /// preprocessor.
+ virtual void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) {}
+
+ /// Override this to register AST matchers with \p Finder.
+ ///
+ /// This should be used by clang-tidy checks that analyze code properties that
+ /// dependent on AST knowledge.
+ ///
+ /// You can register as many matchers as necessary with \p Finder. Usually,
+ /// "this" will be used as callback, but you can also specify other callback
+ /// classes. Thereby, different matchers can trigger different callbacks.
+ ///
+ /// This will only be executed if the function isLanguageVersionSupported
+ /// returns true.
+ ///
+ /// If you need to merge information between the different matchers, you can
+ /// store these as members of the derived class. However, note that all
+ /// matches occur in the order of the AST traversal.
+ virtual void registerMatchers(ast_matchers::MatchFinder *Finder) {}
+
+ /// ``ClangTidyChecks`` that register ASTMatchers should do the actual
+ /// work in here.
+ virtual void check(const ast_matchers::MatchFinder::MatchResult &Result) {}
+
+ /// Add a diagnostic with the check's name.
+ DiagnosticBuilder diag(SourceLocation Loc, StringRef Description,
+ DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
+
+ /// Add a diagnostic with the check's name.
+ DiagnosticBuilder diag(StringRef Description,
+ DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
+
+ /// Adds a diagnostic to report errors in the check's configuration.
+ DiagnosticBuilder
+ configurationDiag(StringRef Description,
+ DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
+
+ /// Should store all options supported by this check with their
+ /// current values or default values for options that haven't been overridden.
+ ///
+ /// The check should use ``Options.store()`` to store each option it supports
+ /// whether it has the default value or it has been overridden.
+ virtual void storeOptions(ClangTidyOptions::OptionMap &Options) {}
+
+ /// Provides access to the ``ClangTidyCheck`` options via check-local
+ /// names.
+ ///
+ /// Methods of this class prepend ``CheckName + "."`` to translate check-local
+ /// option names to global option names.
+ class OptionsView {
+ public:
+ /// Initializes the instance using \p CheckName + "." as a prefix.
+ OptionsView(StringRef CheckName,
+ const ClangTidyOptions::OptionMap &CheckOptions,
+ ClangTidyContext *Context);
+
+ /// Read a named option from the ``Context``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from the
+ /// ``CheckOptions``. If the corresponding key is not present, returns
+ /// a ``MissingOptionError``.
+ llvm::Expected<std::string> get(StringRef LocalName) const;
+
+ /// Read a named option from the ``Context``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from the
+ /// ``CheckOptions``. If the corresponding key is not present, returns
+ /// \p Default.
+ std::string get(StringRef LocalName, StringRef Default) const {
+ if (llvm::Expected<std::string> Val = get(LocalName))
+ return *Val;
+ else
+ llvm::consumeError(Val.takeError());
+ return Default.str();
+ }
+
+ /// Read a named option from the ``Context``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from local or
+ /// global ``CheckOptions``. Gets local option first. If local is not
+ /// present, falls back to get global option. If global option is not
+ /// present either, returns a ``MissingOptionError``.
+ llvm::Expected<std::string> getLocalOrGlobal(StringRef LocalName) const;
+
+ /// Read a named option from the ``Context``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from local or
+ /// global ``CheckOptions``. Gets local option first. If local is not
+ /// present, falls back to get global option. If global option is not
+ /// present either, returns \p Default.
+ std::string getLocalOrGlobal(StringRef LocalName, StringRef Default) const {
+ if (llvm::Expected<std::string> Val = getLocalOrGlobal(LocalName))
+ return *Val;
+ else
+ llvm::consumeError(Val.takeError());
+ return Default.str();
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// integral type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from the
+ /// ``CheckOptions``. If the corresponding key is not present, returns
+ /// a ``MissingOptionError``. If the corresponding key can't be parsed as
+ /// a ``T``, return an ``UnparseableIntegerOptionError``.
+ template <typename T>
+ std::enable_if_t<std::is_integral<T>::value, llvm::Expected<T>>
+ get(StringRef LocalName) const {
+ if (llvm::Expected<std::string> Value = get(LocalName)) {
+ T Result{};
+ if (!StringRef(*Value).getAsInteger(10, Result))
+ return Result;
+ return llvm::make_error<UnparseableIntegerOptionError>(
+ (NamePrefix + LocalName).str(), *Value);
+ } else
+ return std::move(Value.takeError());
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// integral type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from the
+ /// ``CheckOptions``. If the corresponding key is not present or it can't be
+ /// parsed as a ``T``, returns \p Default.
+ template <typename T>
+ std::enable_if_t<std::is_integral<T>::value, T> get(StringRef LocalName,
+ T Default) const {
+ if (llvm::Expected<T> ValueOr = get<T>(LocalName))
+ return *ValueOr;
+ else
+ reportOptionParsingError(ValueOr.takeError());
+ return Default;
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// integral type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from local or
+ /// global ``CheckOptions``. Gets local option first. If local is not
+ /// present, falls back to get global option. If global option is not
+ /// present either, returns a ``MissingOptionError``. If the corresponding
+ /// key can't be parsed as a ``T``, return an
+ /// ``UnparseableIntegerOptionError``.
+ template <typename T>
+ std::enable_if_t<std::is_integral<T>::value, llvm::Expected<T>>
+ getLocalOrGlobal(StringRef LocalName) const {
+ llvm::Expected<std::string> ValueOr = get(LocalName);
+ bool IsGlobal = false;
+ if (!ValueOr) {
+ IsGlobal = true;
+ llvm::consumeError(ValueOr.takeError());
+ ValueOr = getLocalOrGlobal(LocalName);
+ if (!ValueOr)
+ return std::move(ValueOr.takeError());
+ }
+ T Result{};
+ if (!StringRef(*ValueOr).getAsInteger(10, Result))
+ return Result;
+ return llvm::make_error<UnparseableIntegerOptionError>(
+ (IsGlobal ? LocalName.str() : (NamePrefix + LocalName).str()),
+ *ValueOr);
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// integral type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from local or
+ /// global ``CheckOptions``. Gets local option first. If local is not
+ /// present, falls back to get global option. If global option is not
+ /// present either or it can't be parsed as a ``T``, returns \p Default.
+ template <typename T>
+ std::enable_if_t<std::is_integral<T>::value, T>
+ getLocalOrGlobal(StringRef LocalName, T Default) const {
+ if (llvm::Expected<T> ValueOr = getLocalOrGlobal<T>(LocalName))
+ return *ValueOr;
+ else
+ reportOptionParsingError(ValueOr.takeError());
+ return Default;
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// enum type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from the
+ /// ``CheckOptions``. If the corresponding key is not present, returns a
+ /// ``MissingOptionError``. If the key can't be parsed as a ``T`` returns a
+ /// ``UnparseableEnumOptionError``.
+ ///
+ /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to
+ /// supply the mapping required to convert between ``T`` and a string.
+ template <typename T>
+ std::enable_if_t<std::is_enum<T>::value, llvm::Expected<T>>
+ get(StringRef LocalName, bool IgnoreCase = false) const {
+ if (llvm::Expected<int64_t> ValueOr =
+ getEnumInt(LocalName, typeEraseMapping<T>(), false, IgnoreCase))
+ return static_cast<T>(*ValueOr);
+ else
+ return std::move(ValueOr.takeError());
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// enum type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from the
+ /// ``CheckOptions``. If the corresponding key is not present or it can't be
+ /// parsed as a ``T``, returns \p Default.
+ ///
+ /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to
+ /// supply the mapping required to convert between ``T`` and a string.
+ template <typename T>
+ std::enable_if_t<std::is_enum<T>::value, T>
+ get(StringRef LocalName, T Default, bool IgnoreCase = false) const {
+ if (auto ValueOr = get<T>(LocalName, IgnoreCase))
+ return *ValueOr;
+ else
+ reportOptionParsingError(ValueOr.takeError());
+ return Default;
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// enum type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from local or
+ /// global ``CheckOptions``. Gets local option first. If local is not
+ /// present, falls back to get global option. If global option is not
+ /// present either, returns a ``MissingOptionError``. If the key can't be
+ /// parsed as a ``T`` returns a ``UnparseableEnumOptionError``.
+ ///
+ /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to
+ /// supply the mapping required to convert between ``T`` and a string.
+ template <typename T>
+ std::enable_if_t<std::is_enum<T>::value, llvm::Expected<T>>
+ getLocalOrGlobal(StringRef LocalName, bool IgnoreCase = false) const {
+ if (llvm::Expected<int64_t> ValueOr =
+ getEnumInt(LocalName, typeEraseMapping<T>(), true, IgnoreCase))
+ return static_cast<T>(*ValueOr);
+ else
+ return std::move(ValueOr.takeError());
+ }
+
+ /// Read a named option from the ``Context`` and parse it as an
+ /// enum type ``T``.
+ ///
+ /// Reads the option with the check-local name \p LocalName from local or
+ /// global ``CheckOptions``. Gets local option first. If local is not
+ /// present, falls back to get global option. If global option is not
+ /// present either or it can't be parsed as a ``T``, returns \p Default.
+ ///
+ /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to
+ /// supply the mapping required to convert between ``T`` and a string.
+ template <typename T>
+ std::enable_if_t<std::is_enum<T>::value, T>
+ getLocalOrGlobal(StringRef LocalName, T Default,
+ bool IgnoreCase = false) const {
+ if (auto ValueOr = getLocalOrGlobal<T>(LocalName, IgnoreCase))
+ return *ValueOr;
+ else
+ reportOptionParsingError(ValueOr.takeError());
+ return Default;
+ }
+
+ /// Returns the value for the option \p LocalName represented as a ``T``.
+ /// If the option is missing returns None, if the option can't be parsed
+ /// as a ``T``, log that to stderr and return None.
+ template <typename T = std::string>
+ llvm::Optional<T> getOptional(StringRef LocalName) const {
+ if (auto ValueOr = get<T>(LocalName))
+ return *ValueOr;
+ else
+ reportOptionParsingError(ValueOr.takeError());
+ return llvm::None;
+ }
+
+ /// Returns the value for the local or global option \p LocalName
+ /// represented as a ``T``.
+ /// If the option is missing returns None, if the
+ /// option can't be parsed as a ``T``, log that to stderr and return None.
+ template <typename T = std::string>
+ llvm::Optional<T> getOptionalLocalOrGlobal(StringRef LocalName) const {
+ if (auto ValueOr = getLocalOrGlobal<T>(LocalName))
+ return *ValueOr;
+ else
+ reportOptionParsingError(ValueOr.takeError());
+ return llvm::None;
+ }
+
+ /// Stores an option with the check-local name \p LocalName with
+ /// string value \p Value to \p Options.
+ void store(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
+ StringRef Value) const;
+
+ /// Stores an option with the check-local name \p LocalName with
+ /// integer value \p Value to \p Options.
+ template <typename T>
+ std::enable_if_t<std::is_integral<T>::value>
+ store(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
+ T Value) const {
+ storeInt(Options, LocalName, Value);
+ }
+
+ /// Stores an option with the check-local name \p LocalName as the string
+ /// representation of the Enum \p Value to \p Options.
+ ///
+ /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to
+ /// supply the mapping required to convert between ``T`` and a string.
+ template <typename T>
+ std::enable_if_t<std::is_enum<T>::value>
+ store(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
+ T Value) const {
+ ArrayRef<std::pair<T, StringRef>> Mapping =
+ OptionEnumMapping<T>::getEnumMapping();
+ auto Iter = llvm::find_if(
+ Mapping, [&](const std::pair<T, StringRef> &NameAndEnum) {
+ return NameAndEnum.first == Value;
+ });
+ assert(Iter != Mapping.end() && "Unknown Case Value");
+ store(Options, LocalName, Iter->second);
+ }
+
+ private:
+ using NameAndValue = std::pair<int64_t, StringRef>;
+
+ llvm::Expected<int64_t> getEnumInt(StringRef LocalName,
+ ArrayRef<NameAndValue> Mapping,
+ bool CheckGlobal, bool IgnoreCase) const;
+
+ template <typename T>
+ std::enable_if_t<std::is_enum<T>::value, std::vector<NameAndValue>>
+ typeEraseMapping() const {
+ ArrayRef<std::pair<T, StringRef>> Mapping =
+ OptionEnumMapping<T>::getEnumMapping();
+ std::vector<NameAndValue> Result;
+ Result.reserve(Mapping.size());
+ for (auto &MappedItem : Mapping) {
+ Result.emplace_back(static_cast<int64_t>(MappedItem.first),
+ MappedItem.second);
+ }
+ return Result;
+ }
+
+ void storeInt(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
+ int64_t Value) const;
+
+ /// Emits a diagnostic if \p Err is not a MissingOptionError.
+ void reportOptionParsingError(llvm::Error &&Err) const;
+
+ std::string NamePrefix;
+ const ClangTidyOptions::OptionMap &CheckOptions;
+ ClangTidyContext *Context;
+ };
+
+private:
+ void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ StringRef getID() const override { return CheckName; }
+ std::string CheckName;
+ ClangTidyContext *Context;
+
+protected:
+ OptionsView Options;
+ /// Returns the main file name of the current translation unit.
+ StringRef getCurrentMainFile() const { return Context->getCurrentFile(); }
+ /// Returns the language options from the context.
+ const LangOptions &getLangOpts() const { return Context->getLangOpts(); }
+};
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from the
+/// ``CheckOptions``. If the corresponding key is not present, returns
+/// a ``MissingOptionError``. If the corresponding key can't be parsed as
+/// a bool, return an ``UnparseableIntegerOptionError``.
+template <>
+llvm::Expected<bool>
+ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName) const;
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from the
+/// ``CheckOptions``. If the corresponding key is not present or it can't be
+/// parsed as a bool, returns \p Default.
+template <>
+bool ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName,
+ bool Default) const;
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from local or
+/// global ``CheckOptions``. Gets local option first. If local is not
+/// present, falls back to get global option. If global option is not
+/// present either, returns a ``MissingOptionError``. If the corresponding
+/// key can't be parsed as a bool, return an
+/// ``UnparseableIntegerOptionError``.
+template <>
+llvm::Expected<bool>
+ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName) const;
+
+/// Read a named option from the ``Context`` and parse it as a bool.
+///
+/// Reads the option with the check-local name \p LocalName from local or
+/// global ``CheckOptions``. Gets local option first. If local is not
+/// present, falls back to get global option. If global option is not
+/// present either or it can't be parsed as a bool, returns \p Default.
+template <>
+bool ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName,
+ bool Default) const;
+
+/// Stores an option with the check-local name \p LocalName with
+/// bool value \p Value to \p Options.
+template <>
+void ClangTidyCheck::OptionsView::store<bool>(
+ ClangTidyOptions::OptionMap &Options, StringRef LocalName,
+ bool Value) const;
+
+/// Returns the value for the option \p LocalName.
+/// If the option is missing returns None.
+template <>
+Optional<std::string> ClangTidyCheck::OptionsView::getOptional<std::string>(
+ StringRef LocalName) const;
+
+/// Returns the value for the local or global option \p LocalName.
+/// If the option is missing returns None.
+template <>
+Optional<std::string>
+ClangTidyCheck::OptionsView::getOptionalLocalOrGlobal<std::string>(
+ StringRef LocalName) const;
+
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyDiagnosticConsumer.h b/linux-x64/clang/include/clang-tidy/ClangTidyDiagnosticConsumer.h
new file mode 100644
index 0000000..0792931
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyDiagnosticConsumer.h
@@ -0,0 +1,278 @@
+//===--- ClangTidyDiagnosticConsumer.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H
+
+#include "ClangTidyOptions.h"
+#include "ClangTidyProfiling.h"
+#include "clang/Basic/Diagnostic.h"
+#include "clang/Tooling/Core/Diagnostic.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Regex.h"
+
+namespace clang {
+
+class ASTContext;
+class CompilerInstance;
+class SourceManager;
+namespace ast_matchers {
+class MatchFinder;
+}
+namespace tooling {
+class CompilationDatabase;
+}
+
+namespace tidy {
+
+/// A detected error complete with information to display diagnostic and
+/// automatic fix.
+///
+/// This is used as an intermediate format to transport Diagnostics without a
+/// dependency on a SourceManager.
+///
+/// FIXME: Make Diagnostics flexible enough to support this directly.
+struct ClangTidyError : tooling::Diagnostic {
+ ClangTidyError(StringRef CheckName, Level DiagLevel, StringRef BuildDirectory,
+ bool IsWarningAsError);
+
+ bool IsWarningAsError;
+ std::vector<std::string> EnabledDiagnosticAliases;
+};
+
+/// Contains displayed and ignored diagnostic counters for a ClangTidy
+/// run.
+struct ClangTidyStats {
+ ClangTidyStats()
+ : ErrorsDisplayed(0), ErrorsIgnoredCheckFilter(0), ErrorsIgnoredNOLINT(0),
+ ErrorsIgnoredNonUserCode(0), ErrorsIgnoredLineFilter(0) {}
+
+ unsigned ErrorsDisplayed;
+ unsigned ErrorsIgnoredCheckFilter;
+ unsigned ErrorsIgnoredNOLINT;
+ unsigned ErrorsIgnoredNonUserCode;
+ unsigned ErrorsIgnoredLineFilter;
+
+ unsigned errorsIgnored() const {
+ return ErrorsIgnoredNOLINT + ErrorsIgnoredCheckFilter +
+ ErrorsIgnoredNonUserCode + ErrorsIgnoredLineFilter;
+ }
+};
+
+/// Every \c ClangTidyCheck reports errors through a \c DiagnosticsEngine
+/// provided by this context.
+///
+/// A \c ClangTidyCheck always has access to the active context to report
+/// warnings like:
+/// \code
+/// Context->Diag(Loc, "Single-argument constructors must be explicit")
+/// << FixItHint::CreateInsertion(Loc, "explicit ");
+/// \endcode
+class ClangTidyContext {
+public:
+ /// Initializes \c ClangTidyContext instance.
+ ClangTidyContext(std::unique_ptr<ClangTidyOptionsProvider> OptionsProvider,
+ bool AllowEnablingAnalyzerAlphaCheckers = false);
+ /// Sets the DiagnosticsEngine that diag() will emit diagnostics to.
+ // FIXME: this is required initialization, and should be a constructor param.
+ // Fix the context -> diag engine -> consumer -> context initialization cycle.
+ void setDiagnosticsEngine(DiagnosticsEngine *DiagEngine) {
+ this->DiagEngine = DiagEngine;
+ }
+
+ ~ClangTidyContext();
+
+ /// Report any errors detected using this method.
+ ///
+ /// This is still under heavy development and will likely change towards using
+ /// tablegen'd diagnostic IDs.
+ /// FIXME: Figure out a way to manage ID spaces.
+ DiagnosticBuilder diag(StringRef CheckName, SourceLocation Loc,
+ StringRef Message,
+ DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
+
+ DiagnosticBuilder diag(StringRef CheckName, StringRef Message,
+ DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
+
+ /// Report any errors to do with reading the configuration using this method.
+ DiagnosticBuilder
+ configurationDiag(StringRef Message,
+ DiagnosticIDs::Level Level = DiagnosticIDs::Warning);
+
+ /// Sets the \c SourceManager of the used \c DiagnosticsEngine.
+ ///
+ /// This is called from the \c ClangTidyCheck base class.
+ void setSourceManager(SourceManager *SourceMgr);
+
+ /// Should be called when starting to process new translation unit.
+ void setCurrentFile(StringRef File);
+
+ /// Returns the main file name of the current translation unit.
+ StringRef getCurrentFile() const { return CurrentFile; }
+
+ /// Sets ASTContext for the current translation unit.
+ void setASTContext(ASTContext *Context);
+
+ /// Gets the language options from the AST context.
+ const LangOptions &getLangOpts() const { return LangOpts; }
+
+ /// Returns the name of the clang-tidy check which produced this
+ /// diagnostic ID.
+ std::string getCheckName(unsigned DiagnosticID) const;
+
+ /// Returns \c true if the check is enabled for the \c CurrentFile.
+ ///
+ /// The \c CurrentFile can be changed using \c setCurrentFile.
+ bool isCheckEnabled(StringRef CheckName) const;
+
+ /// Returns \c true if the check should be upgraded to error for the
+ /// \c CurrentFile.
+ bool treatAsError(StringRef CheckName) const;
+
+ /// Returns global options.
+ const ClangTidyGlobalOptions &getGlobalOptions() const;
+
+ /// Returns options for \c CurrentFile.
+ ///
+ /// The \c CurrentFile can be changed using \c setCurrentFile.
+ const ClangTidyOptions &getOptions() const;
+
+ /// Returns options for \c File. Does not change or depend on
+ /// \c CurrentFile.
+ ClangTidyOptions getOptionsForFile(StringRef File) const;
+
+ /// Returns \c ClangTidyStats containing issued and ignored diagnostic
+ /// counters.
+ const ClangTidyStats &getStats() const { return Stats; }
+
+ /// Control profile collection in clang-tidy.
+ void setEnableProfiling(bool Profile);
+ bool getEnableProfiling() const { return Profile; }
+
+ /// Control storage of profile date.
+ void setProfileStoragePrefix(StringRef ProfilePrefix);
+ llvm::Optional<ClangTidyProfiling::StorageParams>
+ getProfileStorageParams() const;
+
+ /// Should be called when starting to process new translation unit.
+ void setCurrentBuildDirectory(StringRef BuildDirectory) {
+ CurrentBuildDirectory = std::string(BuildDirectory);
+ }
+
+ /// Returns build directory of the current translation unit.
+ const std::string &getCurrentBuildDirectory() {
+ return CurrentBuildDirectory;
+ }
+
+ /// If the experimental alpha checkers from the static analyzer can be
+ /// enabled.
+ bool canEnableAnalyzerAlphaCheckers() const {
+ return AllowEnablingAnalyzerAlphaCheckers;
+ }
+
+ using DiagLevelAndFormatString = std::pair<DiagnosticIDs::Level, std::string>;
+ DiagLevelAndFormatString getDiagLevelAndFormatString(unsigned DiagnosticID,
+ SourceLocation Loc) {
+ return DiagLevelAndFormatString(
+ static_cast<DiagnosticIDs::Level>(
+ DiagEngine->getDiagnosticLevel(DiagnosticID, Loc)),
+ std::string(
+ DiagEngine->getDiagnosticIDs()->getDescription(DiagnosticID)));
+ }
+
+private:
+ // Writes to Stats.
+ friend class ClangTidyDiagnosticConsumer;
+
+ DiagnosticsEngine *DiagEngine;
+ std::unique_ptr<ClangTidyOptionsProvider> OptionsProvider;
+
+ std::string CurrentFile;
+ ClangTidyOptions CurrentOptions;
+ class CachedGlobList;
+ std::unique_ptr<CachedGlobList> CheckFilter;
+ std::unique_ptr<CachedGlobList> WarningAsErrorFilter;
+
+ LangOptions LangOpts;
+
+ ClangTidyStats Stats;
+
+ std::string CurrentBuildDirectory;
+
+ llvm::DenseMap<unsigned, std::string> CheckNamesByDiagnosticID;
+
+ bool Profile;
+ std::string ProfilePrefix;
+
+ bool AllowEnablingAnalyzerAlphaCheckers;
+};
+
+/// Check whether a given diagnostic should be suppressed due to the presence
+/// of a "NOLINT" suppression comment.
+/// This is exposed so that other tools that present clang-tidy diagnostics
+/// (such as clangd) can respect the same suppression rules as clang-tidy.
+/// This does not handle suppression of notes following a suppressed diagnostic;
+/// that is left to the caller is it requires maintaining state in between calls
+/// to this function.
+/// If `AllowIO` is false, the function does not attempt to read source files
+/// from disk which are not already mapped into memory; such files are treated
+/// as not containing a suppression comment.
+bool shouldSuppressDiagnostic(DiagnosticsEngine::Level DiagLevel,
+ const Diagnostic &Info, ClangTidyContext &Context,
+ bool AllowIO = true);
+
+/// A diagnostic consumer that turns each \c Diagnostic into a
+/// \c SourceManager-independent \c ClangTidyError.
+//
+// FIXME: If we move away from unit-tests, this can be moved to a private
+// implementation file.
+class ClangTidyDiagnosticConsumer : public DiagnosticConsumer {
+public:
+ ClangTidyDiagnosticConsumer(ClangTidyContext &Ctx,
+ DiagnosticsEngine *ExternalDiagEngine = nullptr,
+ bool RemoveIncompatibleErrors = true);
+
+ // FIXME: The concept of converting between FixItHints and Replacements is
+ // more generic and should be pulled out into a more useful Diagnostics
+ // library.
+ void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
+ const Diagnostic &Info) override;
+
+ // Retrieve the diagnostics that were captured.
+ std::vector<ClangTidyError> take();
+
+private:
+ void finalizeLastError();
+ void removeIncompatibleErrors();
+ void removeDuplicatedDiagnosticsOfAliasCheckers();
+
+ /// Returns the \c HeaderFilter constructed for the options set in the
+ /// context.
+ llvm::Regex *getHeaderFilter();
+
+ /// Updates \c LastErrorRelatesToUserCode and LastErrorPassesLineFilter
+ /// according to the diagnostic \p Location.
+ void checkFilters(SourceLocation Location, const SourceManager &Sources);
+ bool passesLineFilter(StringRef FileName, unsigned LineNumber) const;
+
+ void forwardDiagnostic(const Diagnostic &Info);
+
+ ClangTidyContext &Context;
+ DiagnosticsEngine *ExternalDiagEngine;
+ bool RemoveIncompatibleErrors;
+ std::vector<ClangTidyError> Errors;
+ std::unique_ptr<llvm::Regex> HeaderFilter;
+ bool LastErrorRelatesToUserCode;
+ bool LastErrorPassesLineFilter;
+ bool LastErrorWasIgnored;
+};
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyForceLinker.h b/linux-x64/clang/include/clang-tidy/ClangTidyForceLinker.h
new file mode 100644
index 0000000..2691d90
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyForceLinker.h
@@ -0,0 +1,144 @@
+//===- ClangTidyForceLinker.h - clang-tidy --------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
+
+#include "clang-tidy-config.h"
+#include "llvm/Support/Compiler.h"
+
+namespace clang {
+namespace tidy {
+
+// This anchor is used to force the linker to link the AbseilModule.
+extern volatile int AbseilModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED AbseilModuleAnchorDestination =
+ AbseilModuleAnchorSource;
+
+// This anchor is used to force the linker to link the AlteraModule.
+extern volatile int AlteraModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED AlteraModuleAnchorDestination =
+ AlteraModuleAnchorSource;
+
+// This anchor is used to force the linker to link the AndroidModule.
+extern volatile int AndroidModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED AndroidModuleAnchorDestination =
+ AndroidModuleAnchorSource;
+
+// This anchor is used to force the linker to link the BoostModule.
+extern volatile int BoostModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED BoostModuleAnchorDestination =
+ BoostModuleAnchorSource;
+
+// This anchor is used to force the linker to link the BugproneModule.
+extern volatile int BugproneModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED BugproneModuleAnchorDestination =
+ BugproneModuleAnchorSource;
+
+// This anchor is used to force the linker to link the CERTModule.
+extern volatile int CERTModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED CERTModuleAnchorDestination =
+ CERTModuleAnchorSource;
+
+// This anchor is used to force the linker to link the ConcurrencyModule.
+extern volatile int ConcurrencyModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ConcurrencyModuleAnchorDestination =
+ ConcurrencyModuleAnchorSource;
+
+// This anchor is used to force the linker to link the CppCoreGuidelinesModule.
+extern volatile int CppCoreGuidelinesModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED CppCoreGuidelinesModuleAnchorDestination =
+ CppCoreGuidelinesModuleAnchorSource;
+
+// This anchor is used to force the linker to link the DarwinModule.
+extern volatile int DarwinModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED DarwinModuleAnchorDestination =
+ DarwinModuleAnchorSource;
+
+// This anchor is used to force the linker to link the FuchsiaModule.
+extern volatile int FuchsiaModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED FuchsiaModuleAnchorDestination =
+ FuchsiaModuleAnchorSource;
+
+// This anchor is used to force the linker to link the GoogleModule.
+extern volatile int GoogleModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED GoogleModuleAnchorDestination =
+ GoogleModuleAnchorSource;
+
+// This anchor is used to force the linker to link the HICPPModule.
+extern volatile int HICPPModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED HICPPModuleAnchorDestination =
+ HICPPModuleAnchorSource;
+
+// This anchor is used to force the linker to link the LinuxKernelModule.
+extern volatile int LinuxKernelModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED LinuxKernelModuleAnchorDestination =
+ LinuxKernelModuleAnchorSource;
+
+// This anchor is used to force the linker to link the LLVMModule.
+extern volatile int LLVMModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED LLVMModuleAnchorDestination =
+ LLVMModuleAnchorSource;
+
+// This anchor is used to force the linker to link the LLVMLibcModule.
+extern volatile int LLVMLibcModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED LLVMLibcModuleAnchorDestination =
+ LLVMLibcModuleAnchorSource;
+
+// This anchor is used to force the linker to link the MiscModule.
+extern volatile int MiscModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED MiscModuleAnchorDestination =
+ MiscModuleAnchorSource;
+
+// This anchor is used to force the linker to link the ModernizeModule.
+extern volatile int ModernizeModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ModernizeModuleAnchorDestination =
+ ModernizeModuleAnchorSource;
+
+#if CLANG_TIDY_ENABLE_STATIC_ANALYZER && \
+ !defined(CLANG_TIDY_DISABLE_STATIC_ANALYZER_CHECKS)
+// This anchor is used to force the linker to link the MPIModule.
+extern volatile int MPIModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED MPIModuleAnchorDestination =
+ MPIModuleAnchorSource;
+#endif
+
+// This anchor is used to force the linker to link the ObjCModule.
+extern volatile int ObjCModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ObjCModuleAnchorDestination =
+ ObjCModuleAnchorSource;
+
+// This anchor is used to force the linker to link the OpenMPModule.
+extern volatile int OpenMPModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED OpenMPModuleAnchorDestination =
+ OpenMPModuleAnchorSource;
+
+// This anchor is used to force the linker to link the PerformanceModule.
+extern volatile int PerformanceModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED PerformanceModuleAnchorDestination =
+ PerformanceModuleAnchorSource;
+
+// This anchor is used to force the linker to link the PortabilityModule.
+extern volatile int PortabilityModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED PortabilityModuleAnchorDestination =
+ PortabilityModuleAnchorSource;
+
+// This anchor is used to force the linker to link the ReadabilityModule.
+extern volatile int ReadabilityModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ReadabilityModuleAnchorDestination =
+ ReadabilityModuleAnchorSource;
+
+// This anchor is used to force the linker to link the ZirconModule.
+extern volatile int ZirconModuleAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ZirconModuleAnchorDestination =
+ ZirconModuleAnchorSource;
+
+} // namespace tidy
+} // namespace clang
+
+#endif
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyModule.h b/linux-x64/clang/include/clang-tidy/ClangTidyModule.h
new file mode 100644
index 0000000..dd21a8d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyModule.h
@@ -0,0 +1,96 @@
+//===--- ClangTidyModule.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULE_H
+
+#include "ClangTidyOptions.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringRef.h"
+#include <functional>
+#include <memory>
+
+namespace clang {
+namespace tidy {
+
+class ClangTidyCheck;
+class ClangTidyContext;
+
+/// A collection of \c ClangTidyCheckFactory instances.
+///
+/// All clang-tidy modules register their check factories with an instance of
+/// this object.
+class ClangTidyCheckFactories {
+public:
+ using CheckFactory = std::function<std::unique_ptr<ClangTidyCheck>(
+ llvm::StringRef Name, ClangTidyContext *Context)>;
+
+ /// Registers check \p Factory with name \p Name.
+ ///
+ /// For all checks that have default constructors, use \c registerCheck.
+ void registerCheckFactory(llvm::StringRef Name, CheckFactory Factory);
+
+ /// Registers the \c CheckType with the name \p Name.
+ ///
+ /// This method should be used for all \c ClangTidyChecks that don't require
+ /// constructor parameters.
+ ///
+ /// For example, if have a clang-tidy check like:
+ /// \code
+ /// class MyTidyCheck : public ClangTidyCheck {
+ /// void registerMatchers(ast_matchers::MatchFinder *Finder) override {
+ /// ..
+ /// }
+ /// };
+ /// \endcode
+ /// you can register it with:
+ /// \code
+ /// class MyModule : public ClangTidyModule {
+ /// void addCheckFactories(ClangTidyCheckFactories &Factories) override {
+ /// Factories.registerCheck<MyTidyCheck>("myproject-my-check");
+ /// }
+ /// };
+ /// \endcode
+ template <typename CheckType> void registerCheck(llvm::StringRef CheckName) {
+ registerCheckFactory(CheckName,
+ [](llvm::StringRef Name, ClangTidyContext *Context) {
+ return std::make_unique<CheckType>(Name, Context);
+ });
+ }
+
+ /// Create instances of checks that are enabled.
+ std::vector<std::unique_ptr<ClangTidyCheck>>
+ createChecks(ClangTidyContext *Context);
+
+ typedef llvm::StringMap<CheckFactory> FactoryMap;
+ FactoryMap::const_iterator begin() const { return Factories.begin(); }
+ FactoryMap::const_iterator end() const { return Factories.end(); }
+ bool empty() const { return Factories.empty(); }
+
+private:
+ FactoryMap Factories;
+};
+
+/// A clang-tidy module groups a number of \c ClangTidyChecks and gives
+/// them a prefixed name.
+class ClangTidyModule {
+public:
+ virtual ~ClangTidyModule() {}
+
+ /// Implement this function in order to register all \c CheckFactories
+ /// belonging to this module.
+ virtual void addCheckFactories(ClangTidyCheckFactories &CheckFactories) = 0;
+
+ /// Gets default options for checks defined in this module.
+ virtual ClangTidyOptions getModuleOptions();
+};
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULE_H
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyModuleRegistry.h b/linux-x64/clang/include/clang-tidy/ClangTidyModuleRegistry.h
new file mode 100644
index 0000000..891671a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyModuleRegistry.h
@@ -0,0 +1,23 @@
+//===--- ClangTidyModuleRegistry.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
+
+#include "ClangTidyModule.h"
+#include "llvm/Support/Registry.h"
+
+namespace clang {
+namespace tidy {
+
+typedef llvm::Registry<ClangTidyModule> ClangTidyModuleRegistry;
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyOptions.h b/linux-x64/clang/include/clang-tidy/ClangTidyOptions.h
new file mode 100644
index 0000000..d8a4a14
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyOptions.h
@@ -0,0 +1,326 @@
+//===--- ClangTidyOptions.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYOPTIONS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYOPTIONS_H
+
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/MemoryBufferRef.h"
+#include "llvm/Support/VirtualFileSystem.h"
+#include <functional>
+#include <string>
+#include <system_error>
+#include <utility>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+
+/// Contains a list of line ranges in a single file.
+struct FileFilter {
+ /// File name.
+ std::string Name;
+
+ /// LineRange is a pair<start, end> (inclusive).
+ typedef std::pair<unsigned, unsigned> LineRange;
+
+ /// A list of line ranges in this file, for which we show warnings.
+ std::vector<LineRange> LineRanges;
+};
+
+/// Global options. These options are neither stored nor read from
+/// configuration files.
+struct ClangTidyGlobalOptions {
+ /// Output warnings from certain line ranges of certain files only.
+ /// If empty, no warnings will be filtered.
+ std::vector<FileFilter> LineFilter;
+};
+
+/// Contains options for clang-tidy. These options may be read from
+/// configuration files, and may be different for different translation units.
+struct ClangTidyOptions {
+ /// These options are used for all settings that haven't been
+ /// overridden by the \c OptionsProvider.
+ ///
+ /// Allow no checks and no headers by default. This method initializes
+ /// check-specific options by calling \c ClangTidyModule::getModuleOptions()
+ /// of each registered \c ClangTidyModule.
+ static ClangTidyOptions getDefaults();
+
+ /// Overwrites all fields in here by the fields of \p Other that have a value.
+ /// \p Order specifies precedence of \p Other option.
+ ClangTidyOptions &mergeWith(const ClangTidyOptions &Other, unsigned Order);
+
+ /// Creates a new \c ClangTidyOptions instance combined from all fields
+ /// of this instance overridden by the fields of \p Other that have a value.
+ /// \p Order specifies precedence of \p Other option.
+ LLVM_NODISCARD ClangTidyOptions merge(const ClangTidyOptions &Other,
+ unsigned Order) const;
+
+ /// Checks filter.
+ llvm::Optional<std::string> Checks;
+
+ /// WarningsAsErrors filter.
+ llvm::Optional<std::string> WarningsAsErrors;
+
+ /// Output warnings from headers matching this filter. Warnings from
+ /// main files will always be displayed.
+ llvm::Optional<std::string> HeaderFilterRegex;
+
+ /// Output warnings from system headers matching \c HeaderFilterRegex.
+ llvm::Optional<bool> SystemHeaders;
+
+ /// Format code around applied fixes with clang-format using this
+ /// style.
+ ///
+ /// Can be one of:
+ /// * 'none' - don't format code around applied fixes;
+ /// * 'llvm', 'google', 'mozilla' or other predefined clang-format style
+ /// names;
+ /// * 'file' - use the .clang-format file in the closest parent directory of
+ /// each source file;
+ /// * '{inline-formatting-style-in-yaml-format}'.
+ ///
+ /// See clang-format documentation for more about configuring format style.
+ llvm::Optional<std::string> FormatStyle;
+
+ /// Specifies the name or e-mail of the user running clang-tidy.
+ ///
+ /// This option is used, for example, to place the correct user name in TODO()
+ /// comments in the relevant check.
+ llvm::Optional<std::string> User;
+
+ /// Helper structure for storing option value with priority of the value.
+ struct ClangTidyValue {
+ ClangTidyValue() : Value(), Priority(0) {}
+ ClangTidyValue(const char *Value) : Value(Value), Priority(0) {}
+ ClangTidyValue(llvm::StringRef Value, unsigned Priority = 0)
+ : Value(Value), Priority(Priority) {}
+
+ std::string Value;
+ /// Priority stores relative precedence of the value loaded from config
+ /// files to disambigute local vs global value from different levels.
+ unsigned Priority;
+ };
+ typedef std::pair<std::string, std::string> StringPair;
+ typedef llvm::StringMap<ClangTidyValue> OptionMap;
+
+ /// Key-value mapping used to store check-specific options.
+ OptionMap CheckOptions;
+
+ typedef std::vector<std::string> ArgList;
+
+ /// Add extra compilation arguments to the end of the list.
+ llvm::Optional<ArgList> ExtraArgs;
+
+ /// Add extra compilation arguments to the start of the list.
+ llvm::Optional<ArgList> ExtraArgsBefore;
+
+ /// Only used in the FileOptionsProvider and ConfigOptionsProvider. If true
+ /// and using a FileOptionsProvider, it will take a configuration file in the
+ /// parent directory (if any exists) and apply this config file on top of the
+ /// parent one. IF true and using a ConfigOptionsProvider, it will apply this
+ /// config on top of any configuation file it finds in the directory using the
+ /// same logic as FileOptionsProvider. If false or missing, only this
+ /// configuration file will be used.
+ llvm::Optional<bool> InheritParentConfig;
+
+ /// Use colors in diagnostics. If missing, it will be auto detected.
+ llvm::Optional<bool> UseColor;
+};
+
+/// Abstract interface for retrieving various ClangTidy options.
+class ClangTidyOptionsProvider {
+public:
+ static const char OptionsSourceTypeDefaultBinary[];
+ static const char OptionsSourceTypeCheckCommandLineOption[];
+ static const char OptionsSourceTypeConfigCommandLineOption[];
+
+ virtual ~ClangTidyOptionsProvider() {}
+
+ /// Returns global options, which are independent of the file.
+ virtual const ClangTidyGlobalOptions &getGlobalOptions() = 0;
+
+ /// ClangTidyOptions and its source.
+ //
+ /// clang-tidy has 3 types of the sources in order of increasing priority:
+ /// * clang-tidy binary.
+ /// * '-config' commandline option or a specific configuration file. If the
+ /// commandline option is specified, clang-tidy will ignore the
+ /// configuration file.
+ /// * '-checks' commandline option.
+ typedef std::pair<ClangTidyOptions, std::string> OptionsSource;
+
+ /// Returns an ordered vector of OptionsSources, in order of increasing
+ /// priority.
+ virtual std::vector<OptionsSource>
+ getRawOptions(llvm::StringRef FileName) = 0;
+
+ /// Returns options applying to a specific translation unit with the
+ /// specified \p FileName.
+ ClangTidyOptions getOptions(llvm::StringRef FileName);
+};
+
+/// Implementation of the \c ClangTidyOptionsProvider interface, which
+/// returns the same options for all files.
+class DefaultOptionsProvider : public ClangTidyOptionsProvider {
+public:
+ DefaultOptionsProvider(ClangTidyGlobalOptions GlobalOptions,
+ ClangTidyOptions Options)
+ : GlobalOptions(std::move(GlobalOptions)),
+ DefaultOptions(std::move(Options)) {}
+ const ClangTidyGlobalOptions &getGlobalOptions() override {
+ return GlobalOptions;
+ }
+ std::vector<OptionsSource> getRawOptions(llvm::StringRef FileName) override;
+
+private:
+ ClangTidyGlobalOptions GlobalOptions;
+ ClangTidyOptions DefaultOptions;
+};
+
+class FileOptionsBaseProvider : public DefaultOptionsProvider {
+protected:
+ // A pair of configuration file base name and a function parsing
+ // configuration from text in the corresponding format.
+ typedef std::pair<std::string, std::function<llvm::ErrorOr<ClangTidyOptions>(
+ llvm::MemoryBufferRef)>>
+ ConfigFileHandler;
+
+ /// Configuration file handlers listed in the order of priority.
+ ///
+ /// Custom configuration file formats can be supported by constructing the
+ /// list of handlers and passing it to the appropriate \c FileOptionsProvider
+ /// constructor. E.g. initialization of a \c FileOptionsProvider with support
+ /// of a custom configuration file format for files named ".my-tidy-config"
+ /// could look similar to this:
+ /// \code
+ /// FileOptionsProvider::ConfigFileHandlers ConfigHandlers;
+ /// ConfigHandlers.emplace_back(".my-tidy-config", parseMyConfigFormat);
+ /// ConfigHandlers.emplace_back(".clang-tidy", parseConfiguration);
+ /// return std::make_unique<FileOptionsProvider>(
+ /// GlobalOptions, DefaultOptions, OverrideOptions, ConfigHandlers);
+ /// \endcode
+ ///
+ /// With the order of handlers shown above, the ".my-tidy-config" file would
+ /// take precedence over ".clang-tidy" if both reside in the same directory.
+ typedef std::vector<ConfigFileHandler> ConfigFileHandlers;
+
+ FileOptionsBaseProvider(ClangTidyGlobalOptions GlobalOptions,
+ ClangTidyOptions DefaultOptions,
+ ClangTidyOptions OverrideOptions,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS);
+
+ FileOptionsBaseProvider(ClangTidyGlobalOptions GlobalOptions,
+ ClangTidyOptions DefaultOptions,
+ ClangTidyOptions OverrideOptions,
+ ConfigFileHandlers ConfigHandlers);
+
+protected:
+ void addRawFileOptions(llvm::StringRef AbsolutePath,
+ std::vector<OptionsSource> &CurOptions);
+
+ /// Try to read configuration files from \p Directory using registered
+ /// \c ConfigHandlers.
+ llvm::Optional<OptionsSource> tryReadConfigFile(llvm::StringRef Directory);
+
+ llvm::StringMap<OptionsSource> CachedOptions;
+ ClangTidyOptions OverrideOptions;
+ ConfigFileHandlers ConfigHandlers;
+ llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS;
+};
+
+/// Implementation of ClangTidyOptions interface, which is used for
+/// '-config' command-line option.
+class ConfigOptionsProvider : public FileOptionsBaseProvider {
+public:
+ ConfigOptionsProvider(
+ ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
+ ClangTidyOptions ConfigOptions, ClangTidyOptions OverrideOptions,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = nullptr);
+ std::vector<OptionsSource> getRawOptions(llvm::StringRef FileName) override;
+
+private:
+ ClangTidyOptions ConfigOptions;
+};
+
+/// Implementation of the \c ClangTidyOptionsProvider interface, which
+/// tries to find a configuration file in the closest parent directory of each
+/// source file.
+///
+/// By default, files named ".clang-tidy" will be considered, and the
+/// \c clang::tidy::parseConfiguration function will be used for parsing, but a
+/// custom set of configuration file names and parsing functions can be
+/// specified using the appropriate constructor.
+class FileOptionsProvider : public FileOptionsBaseProvider {
+public:
+ /// Initializes the \c FileOptionsProvider instance.
+ ///
+ /// \param GlobalOptions are just stored and returned to the caller of
+ /// \c getGlobalOptions.
+ ///
+ /// \param DefaultOptions are used for all settings not specified in a
+ /// configuration file.
+ ///
+ /// If any of the \param OverrideOptions fields are set, they will override
+ /// whatever options are read from the configuration file.
+ FileOptionsProvider(
+ ClangTidyGlobalOptions GlobalOptions, ClangTidyOptions DefaultOptions,
+ ClangTidyOptions OverrideOptions,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS = nullptr);
+
+ /// Initializes the \c FileOptionsProvider instance with a custom set
+ /// of configuration file handlers.
+ ///
+ /// \param GlobalOptions are just stored and returned to the caller of
+ /// \c getGlobalOptions.
+ ///
+ /// \param DefaultOptions are used for all settings not specified in a
+ /// configuration file.
+ ///
+ /// If any of the \param OverrideOptions fields are set, they will override
+ /// whatever options are read from the configuration file.
+ ///
+ /// \param ConfigHandlers specifies a custom set of configuration file
+ /// handlers. Each handler is a pair of configuration file name and a function
+ /// that can parse configuration from this file type. The configuration files
+ /// in each directory are searched for in the order of appearance in
+ /// \p ConfigHandlers.
+ FileOptionsProvider(ClangTidyGlobalOptions GlobalOptions,
+ ClangTidyOptions DefaultOptions,
+ ClangTidyOptions OverrideOptions,
+ ConfigFileHandlers ConfigHandlers);
+
+ std::vector<OptionsSource> getRawOptions(llvm::StringRef FileName) override;
+};
+
+/// Parses LineFilter from JSON and stores it to the \p Options.
+std::error_code parseLineFilter(llvm::StringRef LineFilter,
+ ClangTidyGlobalOptions &Options);
+
+/// Parses configuration from JSON and returns \c ClangTidyOptions or an
+/// error.
+llvm::ErrorOr<ClangTidyOptions>
+parseConfiguration(llvm::MemoryBufferRef Config);
+
+using DiagCallback = llvm::function_ref<void(const llvm::SMDiagnostic &)>;
+
+llvm::ErrorOr<ClangTidyOptions>
+parseConfigurationWithDiags(llvm::MemoryBufferRef Config, DiagCallback Handler);
+
+/// Serializes configuration to a YAML-encoded string.
+std::string configurationAsText(const ClangTidyOptions &Options);
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYOPTIONS_H
diff --git a/linux-x64/clang/include/clang-tidy/ClangTidyProfiling.h b/linux-x64/clang/include/clang-tidy/ClangTidyProfiling.h
new file mode 100644
index 0000000..9487a34
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ClangTidyProfiling.h
@@ -0,0 +1,60 @@
+//===--- ClangTidyProfiling.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
+
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Chrono.h"
+#include "llvm/Support/Timer.h"
+#include <string>
+
+namespace llvm {
+class raw_ostream;
+} // namespace llvm
+
+namespace clang {
+namespace tidy {
+
+class ClangTidyProfiling {
+public:
+ struct StorageParams {
+ llvm::sys::TimePoint<> Timestamp;
+ std::string SourceFilename;
+ std::string StoreFilename;
+
+ StorageParams() = default;
+
+ StorageParams(llvm::StringRef ProfilePrefix, llvm::StringRef SourceFile);
+ };
+
+private:
+ llvm::Optional<llvm::TimerGroup> TG;
+
+ llvm::Optional<StorageParams> Storage;
+
+ void printUserFriendlyTable(llvm::raw_ostream &OS);
+ void printAsJSON(llvm::raw_ostream &OS);
+
+ void storeProfileData();
+
+public:
+ llvm::StringMap<llvm::TimeRecord> Records;
+
+ ClangTidyProfiling() = default;
+
+ ClangTidyProfiling(llvm::Optional<StorageParams> Storage);
+
+ ~ClangTidyProfiling();
+};
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYPROFILING_H
diff --git a/linux-x64/clang/include/clang-tidy/ExpandModularHeadersPPCallbacks.h b/linux-x64/clang/include/clang-tidy/ExpandModularHeadersPPCallbacks.h
new file mode 100644
index 0000000..fe1b00b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/ExpandModularHeadersPPCallbacks.h
@@ -0,0 +1,144 @@
+//===- ExpandModularHeadersPPCallbacks.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLING_EXPANDMODULARHEADERSPPCALLBACKS_H_
+#define LLVM_CLANG_TOOLING_EXPANDMODULARHEADERSPPCALLBACKS_H_
+
+#include "clang/Lex/PPCallbacks.h"
+#include "clang/Lex/Preprocessor.h"
+#include "llvm/ADT/DenseSet.h"
+
+namespace llvm {
+namespace vfs {
+class OverlayFileSystem;
+class InMemoryFileSystem;
+} // namespace vfs
+} // namespace llvm
+
+namespace clang {
+class CompilerInstance;
+
+namespace serialization {
+class ModuleFile;
+} // namespace serialization
+
+namespace tooling {
+
+/// Handles PPCallbacks and re-runs preprocessing of the whole
+/// translation unit with modules disabled.
+///
+/// This way it's possible to get PPCallbacks for the whole translation unit
+/// including the contents of the modular headers and all their transitive
+/// includes.
+///
+/// This allows existing tools based on PPCallbacks to retain their functionality
+/// when running with C++ modules enabled. This only works in the backwards
+/// compatible modules mode, i.e. when code can still be parsed in non-modular
+/// way.
+class ExpandModularHeadersPPCallbacks : public PPCallbacks {
+public:
+ ExpandModularHeadersPPCallbacks(
+ CompilerInstance *Compiler,
+ IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS);
+ ~ExpandModularHeadersPPCallbacks();
+
+ /// Returns the preprocessor that provides callbacks for the whole
+ /// translation unit, including the main file, textual headers, and modular
+ /// headers.
+ ///
+ /// This preprocessor is separate from the one used by the rest of the
+ /// compiler.
+ Preprocessor *getPreprocessor() const;
+
+private:
+ class FileRecorder;
+
+ void handleModuleFile(serialization::ModuleFile *MF);
+ void parseToLocation(SourceLocation Loc);
+
+ // Handle PPCallbacks.
+ void FileChanged(SourceLocation Loc, FileChangeReason Reason,
+ SrcMgr::CharacteristicKind FileType,
+ FileID PrevFID) override;
+
+ void InclusionDirective(SourceLocation DirectiveLoc,
+ const Token &IncludeToken, StringRef IncludedFilename,
+ bool IsAngled, CharSourceRange FilenameRange,
+ const FileEntry *IncludedFile, StringRef SearchPath,
+ StringRef RelativePath, const Module *Imported,
+ SrcMgr::CharacteristicKind FileType) override;
+
+ void EndOfMainFile() override;
+
+ // Handle all other callbacks.
+ // Just parse to the corresponding location to generate PPCallbacks for the
+ // corresponding range
+ void Ident(SourceLocation Loc, StringRef) override;
+ void PragmaDirective(SourceLocation Loc, PragmaIntroducerKind) override;
+ void PragmaComment(SourceLocation Loc, const IdentifierInfo *,
+ StringRef) override;
+ void PragmaDetectMismatch(SourceLocation Loc, StringRef, StringRef) override;
+ void PragmaDebug(SourceLocation Loc, StringRef) override;
+ void PragmaMessage(SourceLocation Loc, StringRef, PragmaMessageKind,
+ StringRef) override;
+ void PragmaDiagnosticPush(SourceLocation Loc, StringRef) override;
+ void PragmaDiagnosticPop(SourceLocation Loc, StringRef) override;
+ void PragmaDiagnostic(SourceLocation Loc, StringRef, diag::Severity,
+ StringRef) override;
+ void HasInclude(SourceLocation Loc, StringRef, bool, Optional<FileEntryRef> ,
+ SrcMgr::CharacteristicKind) override;
+ void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *,
+ SourceLocation StateLoc, unsigned) override;
+ void PragmaWarning(SourceLocation Loc, StringRef, ArrayRef<int>) override;
+ void PragmaWarningPush(SourceLocation Loc, int) override;
+ void PragmaWarningPop(SourceLocation Loc) override;
+ void PragmaAssumeNonNullBegin(SourceLocation Loc) override;
+ void PragmaAssumeNonNullEnd(SourceLocation Loc) override;
+ void MacroExpands(const Token &MacroNameTok, const MacroDefinition &,
+ SourceRange Range, const MacroArgs *) override;
+ void MacroDefined(const Token &MacroNameTok,
+ const MacroDirective *MD) override;
+ void MacroUndefined(const Token &, const MacroDefinition &,
+ const MacroDirective *Undef) override;
+ void Defined(const Token &MacroNameTok, const MacroDefinition &,
+ SourceRange Range) override;
+ void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override;
+ void If(SourceLocation Loc, SourceRange, ConditionValueKind) override;
+ void Elif(SourceLocation Loc, SourceRange, ConditionValueKind,
+ SourceLocation) override;
+ void Ifdef(SourceLocation Loc, const Token &,
+ const MacroDefinition &) override;
+ void Ifndef(SourceLocation Loc, const Token &,
+ const MacroDefinition &) override;
+ void Else(SourceLocation Loc, SourceLocation) override;
+ void Endif(SourceLocation Loc, SourceLocation) override;
+
+ std::unique_ptr<FileRecorder> Recorder;
+ // Set of all the modules visited. Avoids processing a module more than once.
+ llvm::DenseSet<serialization::ModuleFile *> VisitedModules;
+
+ CompilerInstance &Compiler;
+ // Additional filesystem for replay. Provides all input files from modules.
+ llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFs;
+
+ SourceManager &Sources;
+ DiagnosticsEngine Diags;
+ LangOptions LangOpts;
+ TrivialModuleLoader ModuleLoader;
+
+ std::unique_ptr<HeaderSearch> HeaderInfo;
+ std::unique_ptr<Preprocessor> PP;
+ bool EnteredMainFile = false;
+ bool StartedLexing = false;
+ Token CurrentToken;
+};
+
+} // namespace tooling
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLING_EXPANDMODULARHEADERSPPCALLBACKS_H_
diff --git a/linux-x64/clang/include/clang-tidy/GlobList.h b/linux-x64/clang/include/clang-tidy/GlobList.h
new file mode 100644
index 0000000..fe68a34
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/GlobList.h
@@ -0,0 +1,50 @@
+//===--- GlobList.h ---------------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GLOBLIST_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GLOBLIST_H
+
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Regex.h"
+
+namespace clang {
+namespace tidy {
+
+/// Read-only set of strings represented as a list of positive and negative
+/// globs.
+///
+/// Positive globs add all matched strings to the set, negative globs remove
+/// them in the order of appearance in the list.
+class GlobList {
+public:
+ /// \p Globs is a comma-separated list of globs (only the '*' metacharacter is
+ /// supported) with an optional '-' prefix to denote exclusion.
+ ///
+ /// An empty \p Globs string is interpreted as one glob that matches an empty
+ /// string.
+ GlobList(StringRef Globs);
+
+ /// Returns \c true if the pattern matches \p S. The result is the last
+ /// matching glob's Positive flag.
+ bool contains(StringRef S) const;
+
+private:
+
+ struct GlobListItem {
+ bool IsPositive;
+ llvm::Regex Regex;
+ };
+ SmallVector<GlobListItem, 0> Items;
+};
+
+} // end namespace tidy
+} // end namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GLOBLIST_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/AbseilMatcher.h b/linux-x64/clang/include/clang-tidy/abseil/AbseilMatcher.h
new file mode 100644
index 0000000..335c333
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/AbseilMatcher.h
@@ -0,0 +1,65 @@
+//===- AbseilMatcher.h - clang-tidy ---------------------------------------===//
+//
+// 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 "clang/AST/ASTContext.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include <algorithm>
+
+namespace clang {
+namespace ast_matchers {
+
+/// Matches AST nodes that were found within Abseil files.
+///
+/// Example matches Y but not X
+/// (matcher = cxxRecordDecl(isInAbseilFile())
+/// \code
+/// #include "absl/strings/internal-file.h"
+/// class X {};
+/// \endcode
+/// absl/strings/internal-file.h:
+/// \code
+/// class Y {};
+/// \endcode
+///
+/// Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>,
+/// Matcher<NestedNameSpecifierLoc>
+AST_POLYMORPHIC_MATCHER(
+ isInAbseilFile, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc,
+ NestedNameSpecifierLoc)) {
+ auto &SourceManager = Finder->getASTContext().getSourceManager();
+ SourceLocation Loc = SourceManager.getSpellingLoc(Node.getBeginLoc());
+ if (Loc.isInvalid())
+ return false;
+ const FileEntry *FileEntry =
+ SourceManager.getFileEntryForID(SourceManager.getFileID(Loc));
+ if (!FileEntry)
+ return false;
+ // Determine whether filepath contains "absl/[absl-library]" substring, where
+ // [absl-library] is AbseilLibraries list entry.
+ StringRef Path = FileEntry->getName();
+ static constexpr llvm::StringLiteral AbslPrefix("absl/");
+ size_t PrefixPosition = Path.find(AbslPrefix);
+ if (PrefixPosition == StringRef::npos)
+ return false;
+ Path = Path.drop_front(PrefixPosition + AbslPrefix.size());
+ static const char *AbseilLibraries[] = {"algorithm", "base",
+ "container", "debugging",
+ "flags", "hash",
+ "iterator", "memory",
+ "meta", "numeric",
+ "random", "status",
+ "strings", "synchronization",
+ "time", "types",
+ "utility"};
+ return llvm::any_of(AbseilLibraries, [&](const char *Library) {
+ return Path.startswith(Library);
+ });
+}
+
+} // namespace ast_matchers
+} // namespace clang
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationAdditionCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationAdditionCheck.h
new file mode 100644
index 0000000..4f93be6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationAdditionCheck.h
@@ -0,0 +1,35 @@
+//===--- DurationAdditionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMEADDITIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMEADDITIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Checks for cases where addition should be performed in the
+/// ``absl::Time`` domain.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-addition.html
+class DurationAdditionCheck : public ClangTidyCheck {
+public:
+ DurationAdditionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMEADDITIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationComparisonCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationComparisonCheck.h
new file mode 100644
index 0000000..b3d6add
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationComparisonCheck.h
@@ -0,0 +1,35 @@
+//===--- DurationComparisonCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCOMPARISONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCOMPARISONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Prefer comparison in the absl::Duration domain instead of the numeric
+/// domain.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-comparison.html
+class DurationComparisonCheck : public ClangTidyCheck {
+public:
+ DurationComparisonCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCOMPARISONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationConversionCastCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationConversionCastCheck.h
new file mode 100644
index 0000000..0aa95ff
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationConversionCastCheck.h
@@ -0,0 +1,35 @@
+//===--- DurationConversionCastCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCONVERSIONCASTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCONVERSIONCASTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Checks for casts of ``absl::Duration`` conversion functions, and recommends
+/// the right conversion function instead.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-conversion-cast.html
+class DurationConversionCastCheck : public ClangTidyCheck {
+public:
+ DurationConversionCastCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCONVERSIONCASTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationDivisionCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationDivisionCheck.h
new file mode 100644
index 0000000..a4e4dd5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationDivisionCheck.h
@@ -0,0 +1,37 @@
+//===--- DurationDivisionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONDIVISIONCHECK_H_
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONDIVISIONCHECK_H_
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+// Find potential incorrect uses of integer division of absl::Duration objects.
+//
+// For the user-facing documentation see:
+// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-division.html
+
+class DurationDivisionCheck : public ClangTidyCheck {
+public:
+ using ClangTidyCheck::ClangTidyCheck;
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONDIVISIONCHECK_H_
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationFactoryFloatCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationFactoryFloatCheck.h
new file mode 100644
index 0000000..f804ca2
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationFactoryFloatCheck.h
@@ -0,0 +1,37 @@
+//===--- DurationFactoryFloatCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONFACTORYFLOATCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONFACTORYFLOATCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// This check finds cases where `Duration` factories are being called with
+/// floating point arguments, but could be called using integer arguments.
+/// It handles explicit casts and floating point literals with no fractional
+/// component.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-factory-float.html
+class DurationFactoryFloatCheck : public ClangTidyCheck {
+public:
+ DurationFactoryFloatCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONFACTORYFLOATCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationFactoryScaleCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationFactoryScaleCheck.h
new file mode 100644
index 0000000..15a9f3f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationFactoryScaleCheck.h
@@ -0,0 +1,37 @@
+//===--- DurationFactoryScaleCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONFACTORYSCALECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONFACTORYSCALECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// This check finds cases where the incorrect `Duration` factory function is
+/// being used by looking for scaling constants inside the factory argument
+/// and suggesting a more appropriate factory. It also looks for the special
+/// case of zero and suggests `ZeroDuration()`.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-factory-scale.html
+class DurationFactoryScaleCheck : public ClangTidyCheck {
+public:
+ DurationFactoryScaleCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONFACTORYSCALECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationRewriter.h b/linux-x64/clang/include/clang-tidy/abseil/DurationRewriter.h
new file mode 100644
index 0000000..1ae312c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationRewriter.h
@@ -0,0 +1,141 @@
+//===--- DurationRewriter.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONREWRITER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONREWRITER_H
+
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
+#include <cinttypes>
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Duration factory and conversion scales
+enum class DurationScale : std::uint8_t {
+ Hours = 0,
+ Minutes,
+ Seconds,
+ Milliseconds,
+ Microseconds,
+ Nanoseconds,
+};
+
+/// Given a `Scale`, return the appropriate factory function call for
+/// constructing a `Duration` for that scale.
+llvm::StringRef getDurationFactoryForScale(DurationScale Scale);
+
+/// Given a 'Scale', return the appropriate factory function call for
+/// constructing a `Time` for that scale.
+llvm::StringRef getTimeFactoryForScale(DurationScale scale);
+
+// Determine if `Node` represents a literal floating point or integral zero.
+bool IsLiteralZero(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr &Node);
+
+/// Possibly strip a floating point cast expression.
+///
+/// If `Node` represents an explicit cast to a floating point type, return
+/// the textual context of the cast argument, otherwise `None`.
+llvm::Optional<std::string>
+stripFloatCast(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr &Node);
+
+/// Possibly remove the fractional part of a floating point literal.
+///
+/// If `Node` represents a floating point literal with a zero fractional part,
+/// return the textual context of the integral part, otherwise `None`.
+llvm::Optional<std::string>
+stripFloatLiteralFraction(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr &Node);
+
+/// Possibly further simplify a duration factory function's argument, without
+/// changing the scale of the factory function. Return that simplification or
+/// the text of the argument if no simplification is possible.
+std::string
+simplifyDurationFactoryArg(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr &Node);
+
+/// Given the name of an inverse Duration function (e.g., `ToDoubleSeconds`),
+/// return its `DurationScale`, or `None` if a match is not found.
+llvm::Optional<DurationScale> getScaleForDurationInverse(llvm::StringRef Name);
+
+/// Given the name of an inverse Time function (e.g., `ToUnixSeconds`),
+/// return its `DurationScale`, or `None` if a match is not found.
+llvm::Optional<DurationScale> getScaleForTimeInverse(llvm::StringRef Name);
+
+/// Given a `Scale` return the fully qualified inverse functions for it.
+/// The first returned value is the inverse for `double`, and the second
+/// returned value is the inverse for `int64`.
+const std::pair<llvm::StringRef, llvm::StringRef> &
+getDurationInverseForScale(DurationScale Scale);
+
+/// Returns the Time inverse function name for a given `Scale`.
+llvm::StringRef getTimeInverseForScale(DurationScale scale);
+
+/// Assuming `Node` has type `double` or `int` representing a time interval of
+/// `Scale`, return the expression to make it a suitable `Duration`.
+std::string rewriteExprFromNumberToDuration(
+ const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale,
+ const Expr *Node);
+
+/// Assuming `Node` has a type `int` representing a time instant of `Scale`
+/// since The Epoch, return the expression to make it a suitable `Time`.
+std::string rewriteExprFromNumberToTime(
+ const ast_matchers::MatchFinder::MatchResult &Result, DurationScale Scale,
+ const Expr *Node);
+
+/// Return `false` if `E` is a either: not a macro at all; or an argument to
+/// one. In the both cases, we often want to do the transformation.
+bool isInMacro(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr *E);
+
+AST_MATCHER_FUNCTION(ast_matchers::internal::Matcher<FunctionDecl>,
+ DurationConversionFunction) {
+ using namespace clang::ast_matchers;
+ return functionDecl(
+ hasAnyName("::absl::ToDoubleHours", "::absl::ToDoubleMinutes",
+ "::absl::ToDoubleSeconds", "::absl::ToDoubleMilliseconds",
+ "::absl::ToDoubleMicroseconds", "::absl::ToDoubleNanoseconds",
+ "::absl::ToInt64Hours", "::absl::ToInt64Minutes",
+ "::absl::ToInt64Seconds", "::absl::ToInt64Milliseconds",
+ "::absl::ToInt64Microseconds", "::absl::ToInt64Nanoseconds"));
+}
+
+AST_MATCHER_FUNCTION(ast_matchers::internal::Matcher<FunctionDecl>,
+ DurationFactoryFunction) {
+ using namespace clang::ast_matchers;
+ return functionDecl(hasAnyName("::absl::Nanoseconds", "::absl::Microseconds",
+ "::absl::Milliseconds", "::absl::Seconds",
+ "::absl::Minutes", "::absl::Hours"));
+}
+
+AST_MATCHER_FUNCTION(ast_matchers::internal::Matcher<FunctionDecl>,
+ TimeConversionFunction) {
+ using namespace clang::ast_matchers;
+ return functionDecl(hasAnyName(
+ "::absl::ToUnixHours", "::absl::ToUnixMinutes", "::absl::ToUnixSeconds",
+ "::absl::ToUnixMillis", "::absl::ToUnixMicros", "::absl::ToUnixNanos"));
+}
+
+AST_MATCHER_FUNCTION_P(ast_matchers::internal::Matcher<Stmt>,
+ comparisonOperatorWithCallee,
+ ast_matchers::internal::Matcher<Decl>, funcDecl) {
+ using namespace clang::ast_matchers;
+ return binaryOperator(
+ anyOf(hasOperatorName(">"), hasOperatorName(">="), hasOperatorName("=="),
+ hasOperatorName("<="), hasOperatorName("<")),
+ hasEitherOperand(ignoringImpCasts(callExpr(callee(funcDecl)))));
+}
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONCOMPARISONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationSubtractionCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationSubtractionCheck.h
new file mode 100644
index 0000000..19a684a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationSubtractionCheck.h
@@ -0,0 +1,35 @@
+//===--- DurationSubtractionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONSUBTRACTIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONSUBTRACTIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Checks for cases where subtraction should be performed in the
+/// `absl::Duration` domain.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-subtraction.html
+class DurationSubtractionCheck : public ClangTidyCheck {
+public:
+ DurationSubtractionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_DURATIONSUBTRACTIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/DurationUnnecessaryConversionCheck.h b/linux-x64/clang/include/clang-tidy/abseil/DurationUnnecessaryConversionCheck.h
new file mode 100644
index 0000000..b3eb567
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/DurationUnnecessaryConversionCheck.h
@@ -0,0 +1,35 @@
+//===--- DurationUnnecessaryConversionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMEDOUBLECONVERSIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMEDOUBLECONVERSIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Finds and fixes cases where ``absl::Duration`` values are being converted
+/// to numeric types and back again.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-unnecessary-conversion.html
+class DurationUnnecessaryConversionCheck : public ClangTidyCheck {
+public:
+ DurationUnnecessaryConversionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMEDOUBLECONVERSIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/FasterStrsplitDelimiterCheck.h b/linux-x64/clang/include/clang-tidy/abseil/FasterStrsplitDelimiterCheck.h
new file mode 100644
index 0000000..439e7db
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/FasterStrsplitDelimiterCheck.h
@@ -0,0 +1,38 @@
+//===--- FasterStrsplitDelimiterCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_FASTERSTRSPLITDELIMITERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_FASTERSTRSPLITDELIMITERCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Finds instances of absl::StrSplit() or absl::MaxSplits() where the delimiter
+/// is a single character string literal and replaces it with a character.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-faster-strsplit-delimiter.html
+class FasterStrsplitDelimiterCheck : public ClangTidyCheck {
+public:
+ FasterStrsplitDelimiterCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_FASTERSTRSPLITDELIMITERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/NoInternalDependenciesCheck.h b/linux-x64/clang/include/clang-tidy/abseil/NoInternalDependenciesCheck.h
new file mode 100644
index 0000000..9b0f232
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/NoInternalDependenciesCheck.h
@@ -0,0 +1,38 @@
+//===--- NoInternalDependenciesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_NOINTERNALDEPSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_NOINTERNALDEPSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Finds instances where the user depends on internal details and warns them
+/// against doing so.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-no-internal-dependencies.html
+class NoInternalDependenciesCheck : public ClangTidyCheck {
+public:
+ NoInternalDependenciesCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_NOINTERNALDEPSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/NoNamespaceCheck.h b/linux-x64/clang/include/clang-tidy/abseil/NoNamespaceCheck.h
new file mode 100644
index 0000000..9460a39
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/NoNamespaceCheck.h
@@ -0,0 +1,38 @@
+//===--- NoNamespaceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_NONAMESPACECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_NONAMESPACECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// This check ensures users don't open namespace absl, as that violates
+/// Abseil's compatibility guidelines.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-no-namespace.html
+class NoNamespaceCheck : public ClangTidyCheck {
+public:
+ NoNamespaceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_NONAMESPACECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/RedundantStrcatCallsCheck.h b/linux-x64/clang/include/clang-tidy/abseil/RedundantStrcatCallsCheck.h
new file mode 100644
index 0000000..7146497
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/RedundantStrcatCallsCheck.h
@@ -0,0 +1,41 @@
+//===--- RedundantStrcatCallsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_REDUNDANTSTRCATCALLSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_REDUNDANTSTRCATCALLSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Flags redundant calls to absl::StrCat when the result is being passed to
+/// another call of absl::StrCat/absl::StrAppend. Also suggests a fix to
+/// collapse the calls.
+/// Example:
+/// StrCat(1, StrCat(2, 3)) ==> StrCat(1, 2, 3)
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-redundant-strcat-calls.html
+class RedundantStrcatCallsCheck : public ClangTidyCheck {
+public:
+ RedundantStrcatCallsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_REDUNDANTSTRCATCALLSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/StrCatAppendCheck.h b/linux-x64/clang/include/clang-tidy/abseil/StrCatAppendCheck.h
new file mode 100644
index 0000000..3b41b2b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/StrCatAppendCheck.h
@@ -0,0 +1,38 @@
+//===--- StrCatAppendCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRCATAPPENDCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRCATAPPENDCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Flags uses of absl::StrCat to append to a string. Suggests absl::StrAppend
+/// should be used instead.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-str-cat-append.html
+class StrCatAppendCheck : public ClangTidyCheck {
+public:
+ StrCatAppendCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRCATAPPENDCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/StringFindStartswithCheck.h b/linux-x64/clang/include/clang-tidy/abseil/StringFindStartswithCheck.h
new file mode 100644
index 0000000..2bb20f7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/StringFindStartswithCheck.h
@@ -0,0 +1,47 @@
+//===--- StringFindStartswithCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTARTSWITHCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTARTSWITHCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+// Find string.find(...) == 0 comparisons and suggest replacing with StartsWith.
+// FIXME(niko): Add similar check for EndsWith
+// FIXME(niko): Add equivalent modernize checks for C++20's std::starts_With
+class StringFindStartswithCheck : public ClangTidyCheck {
+public:
+ using ClangTidyCheck::ClangTidyCheck;
+ StringFindStartswithCheck(StringRef Name, ClangTidyContext *Context);
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const std::vector<std::string> StringLikeClasses;
+ utils::IncludeInserter IncludeInserter;
+ const std::string AbseilStringsMatchHeader;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTARTSWITHCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/StringFindStrContainsCheck.h b/linux-x64/clang/include/clang-tidy/abseil/StringFindStrContainsCheck.h
new file mode 100644
index 0000000..a021dcd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/StringFindStrContainsCheck.h
@@ -0,0 +1,39 @@
+//===--- StringFindStrContainsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/TransformerClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Finds s.find(...) == string::npos comparisons (for various string-like
+/// types) and suggests replacing with absl::StrContains.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-string-find-str-contains.html
+class StringFindStrContainsCheck : public utils::TransformerClangTidyCheck {
+public:
+ StringFindStrContainsCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const std::vector<std::string> StringLikeClassesOption;
+ const std::string AbseilStringsMatchHeaderOption;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/TimeComparisonCheck.h b/linux-x64/clang/include/clang-tidy/abseil/TimeComparisonCheck.h
new file mode 100644
index 0000000..f855c31
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/TimeComparisonCheck.h
@@ -0,0 +1,35 @@
+//===--- TimeComparisonCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMECOMPARECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMECOMPARECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Prefer comparison in the `absl::Time` domain instead of the numeric
+/// domain.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-time-comparison.html
+class TimeComparisonCheck : public ClangTidyCheck {
+public:
+ TimeComparisonCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMECOMPARECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/TimeSubtractionCheck.h b/linux-x64/clang/include/clang-tidy/abseil/TimeSubtractionCheck.h
new file mode 100644
index 0000000..9fe58b7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/TimeSubtractionCheck.h
@@ -0,0 +1,38 @@
+//===--- TimeSubtractionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMESUBTRACTIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMESUBTRACTIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Finds and fixes `absl::Time` subtraction expressions to do subtraction
+/// in the time domain instead of the numeric domain.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-time-subtraction.html
+class TimeSubtractionCheck : public ClangTidyCheck {
+public:
+ TimeSubtractionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void emitDiagnostic(const Expr* Node, llvm::StringRef Replacement);
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_TIMESUBTRACTIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/abseil/UpgradeDurationConversionsCheck.h b/linux-x64/clang/include/clang-tidy/abseil/UpgradeDurationConversionsCheck.h
new file mode 100644
index 0000000..23af292
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/abseil/UpgradeDurationConversionsCheck.h
@@ -0,0 +1,43 @@
+//===--- UpgradeDurationConversionsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_UPGRADEDURATIONCONVERSIONSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_UPGRADEDURATIONCONVERSIONSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+#include "clang/Basic/SourceLocation.h"
+#include "llvm/ADT/DenseSet.h"
+
+namespace clang {
+namespace tidy {
+namespace abseil {
+
+/// Finds deprecated uses of `absl::Duration` arithmetic operators and factories.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-upgrade-duration-conversions.html
+class UpgradeDurationConversionsCheck : public ClangTidyCheck {
+public:
+ UpgradeDurationConversionsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ llvm::DenseSet<SourceLocation> MatchedTemplateLocations;
+};
+
+} // namespace abseil
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_UPGRADEDURATIONCONVERSIONSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/altera/KernelNameRestrictionCheck.h b/linux-x64/clang/include/clang-tidy/altera/KernelNameRestrictionCheck.h
new file mode 100644
index 0000000..cf91ca1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/altera/KernelNameRestrictionCheck.h
@@ -0,0 +1,35 @@
+//===--- KernelNameRestrictionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_KERNEL_NAME_RESTRICTION_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_KERNEL_NAME_RESTRICTION_CHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace altera {
+
+/// Finds kernel files and include directives whose filename is `kernel.cl`,
+/// `Verilog.cl`, or `VHDL.cl`.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/altera-kernel-name-restriction.html
+class KernelNameRestrictionCheck : public ClangTidyCheck {
+public:
+ KernelNameRestrictionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *) override;
+};
+
+} // namespace altera
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_KERNEL_NAME_RESTRICTION_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/altera/SingleWorkItemBarrierCheck.h b/linux-x64/clang/include/clang-tidy/altera/SingleWorkItemBarrierCheck.h
new file mode 100644
index 0000000..deb0574
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/altera/SingleWorkItemBarrierCheck.h
@@ -0,0 +1,40 @@
+//===--- SingleWorkItemBarrierCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_SINGLE_WORK_ITEM_BARRIER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_SINGLE_WORK_ITEM_BARRIER_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace altera {
+
+/// Detects OpenCL kernel functions that call a barrier but do not call an
+/// ID-function function. These functions will be treated as single work-item
+/// kernels, which may be inefficient or cause an error.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/opencl-single-work-item-barrier.html
+class SingleWorkItemBarrierCheck : public ClangTidyCheck {
+ const unsigned AOCVersion;
+
+public:
+ SingleWorkItemBarrierCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ AOCVersion(Options.get("AOCVersion", 1600U)) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+};
+
+} // namespace altera
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_SINGLE_WORK_ITEM_BARRIER_H
diff --git a/linux-x64/clang/include/clang-tidy/altera/StructPackAlignCheck.h b/linux-x64/clang/include/clang-tidy/altera/StructPackAlignCheck.h
new file mode 100644
index 0000000..510e030
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/altera/StructPackAlignCheck.h
@@ -0,0 +1,41 @@
+//===--- StructPackAlignCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_STRUCTPACKALIGNCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_STRUCTPACKALIGNCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace altera {
+
+/// Finds structs that are inefficiently packed or aligned, and recommends
+/// packing and/or aligning of said structs as needed.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/altera-struct-pack-align.html
+class StructPackAlignCheck : public ClangTidyCheck {
+public:
+ StructPackAlignCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ MaxConfiguredAlignment(Options.get("MaxConfiguredAlignment", 128)) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const unsigned MaxConfiguredAlignment;
+ CharUnits computeRecommendedAlignment(CharUnits MinByteSize);
+};
+
+} // namespace altera
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALTERA_STRUCTPACKALIGNCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecAccept4Check.h b/linux-x64/clang/include/clang-tidy/android/CloexecAccept4Check.h
new file mode 100644
index 0000000..21196de
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecAccept4Check.h
@@ -0,0 +1,34 @@
+//===--- CloexecAccept4Check.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT4_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT4_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that uses accept4() without using the SOCK_CLOEXEC flag.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-accept4.html
+class CloexecAccept4Check : public CloexecCheck {
+public:
+ CloexecAccept4Check(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT4_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecAcceptCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecAcceptCheck.h
new file mode 100644
index 0000000..304ac51
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecAcceptCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecAcceptCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// accept() is better to be replaced by accept4().
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-accept.html
+class CloexecAcceptCheck : public CloexecCheck {
+public:
+ CloexecAcceptCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_ACCEPT_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecCheck.h
new file mode 100644
index 0000000..336ed56
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecCheck.h
@@ -0,0 +1,104 @@
+//===--- CloexecCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains the declaration of the CloexecCheck class, which is the
+/// base class for all of the close-on-exec checks in Android module.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// The base class for all close-on-exec checks in Android module.
+/// To be specific, there are some functions that need the close-on-exec flag to
+/// prevent the file descriptor leakage on fork+exec and this class provides
+/// utilities to identify and fix these C functions.
+class CloexecCheck : public ClangTidyCheck {
+public:
+ CloexecCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+protected:
+ void
+ registerMatchersImpl(ast_matchers::MatchFinder *Finder,
+ ast_matchers::internal::Matcher<FunctionDecl> Function);
+
+ /// Currently, we have three types of fixes.
+ ///
+ /// Type1 is to insert the necessary macro flag in the flag argument. For
+ /// example, 'O_CLOEXEC' is required in function 'open()', so
+ /// \code
+ /// open(file, O_RDONLY);
+ /// \endcode
+ /// should be
+ /// \code
+ /// open(file, O_RDONLY | O_CLOEXE);
+ /// \endcode
+ ///
+ /// \param [out] Result MatchResult from AST matcher.
+ /// \param MacroFlag The macro name of the flag.
+ /// \param ArgPos The 0-based position of the flag argument.
+ void insertMacroFlag(const ast_matchers::MatchFinder::MatchResult &Result,
+ StringRef MacroFlag, int ArgPos);
+
+ /// Type2 is to replace the API to another function that has required the
+ /// ability. For example:
+ /// \code
+ /// creat(path, mode);
+ /// \endcode
+ /// should be
+ /// \code
+ /// open(path, O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, mode)
+ /// \endcode
+ ///
+ /// \param [out] Result MatchResult from AST matcher.
+ /// \param WarningMsg The warning message.
+ /// \param FixMsg The fix message.
+ void replaceFunc(const ast_matchers::MatchFinder::MatchResult &Result,
+ StringRef WarningMsg, StringRef FixMsg);
+
+ /// Type3 is also to add a flag to the corresponding argument, but this time,
+ /// the flag is some string and each char represents a mode rather than a
+ /// macro. For example, 'fopen' needs char 'e' in its mode argument string, so
+ /// \code
+ /// fopen(in_file, "r");
+ /// \endcode
+ /// should be
+ /// \code
+ /// fopen(in_file, "re");
+ /// \endcode
+ ///
+ /// \param [out] Result MatchResult from AST matcher.
+ /// \param Mode The required mode char.
+ /// \param ArgPos The 0-based position of the flag argument.
+ void insertStringFlag(const ast_matchers::MatchFinder::MatchResult &Result,
+ const char Mode, const int ArgPos);
+
+ /// Helper function to get the spelling of a particular argument.
+ StringRef getSpellingArg(const ast_matchers::MatchFinder::MatchResult &Result,
+ int N) const;
+
+ /// Binding name of the FuncDecl of a function call.
+ static const char *FuncDeclBindingStr;
+
+ /// Binding name of the function call expression.
+ static const char *FuncBindingStr;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecCreatCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecCreatCheck.h
new file mode 100644
index 0000000..cb60e25
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecCreatCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecCreatCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_CREAT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_CREAT_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// creat() is better to be replaced by open().
+/// Find the usage of creat() and redirect user to use open().
+
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-creat.html
+class CloexecCreatCheck : public CloexecCheck {
+public:
+ CloexecCreatCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_CREAT_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecDupCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecDupCheck.h
new file mode 100644
index 0000000..e87c0ab
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecDupCheck.h
@@ -0,0 +1,35 @@
+//===--- CloexecDupCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_DUP_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_DUP_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// dup() is better to be replaced by fcntl(), which has close-on-exec flag.
+/// Find the usage of dup() and redirect user to use fcntl().
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-dup.html
+class CloexecDupCheck : public CloexecCheck {
+public:
+ CloexecDupCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_DUP_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecEpollCreate1Check.h b/linux-x64/clang/include/clang-tidy/android/CloexecEpollCreate1Check.h
new file mode 100644
index 0000000..cac2581
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecEpollCreate1Check.h
@@ -0,0 +1,34 @@
+//===--- CloexecEpollCreate1Check.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_EPOLL_CREATE1_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_EPOLL_CREATE1_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that uses epoll_create1() without using the EPOLL_CLOEXEC flag.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-epoll-create1.html
+class CloexecEpollCreate1Check : public CloexecCheck {
+public:
+ CloexecEpollCreate1Check(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_EPOLL_CREATE1_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecEpollCreateCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecEpollCreateCheck.h
new file mode 100644
index 0000000..8db80c8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecEpollCreateCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecEpollCreateCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_EPOLL_CREATE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_EPOLL_CREATE_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// epoll_create() is better to be replaced by epoll_create1().
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-epoll-create.html
+class CloexecEpollCreateCheck : public CloexecCheck {
+public:
+ CloexecEpollCreateCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_EPOLL_CREATE_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecFopenCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecFopenCheck.h
new file mode 100644
index 0000000..0b617ff
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecFopenCheck.h
@@ -0,0 +1,37 @@
+//===--- CloexecFopenCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_FOPEN_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_FOPEN_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// fopen() is suggested to include "e" in their mode string; like "re" would be
+/// better than "r".
+///
+/// This check only works when corresponding argument is StringLiteral. No
+/// constant propagation.
+///
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-fopen.html
+class CloexecFopenCheck : public CloexecCheck {
+public:
+ CloexecFopenCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_FOPEN_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecInotifyInit1Check.h b/linux-x64/clang/include/clang-tidy/android/CloexecInotifyInit1Check.h
new file mode 100644
index 0000000..d4a392d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecInotifyInit1Check.h
@@ -0,0 +1,34 @@
+//===--- CloexecInotifyInit1Check.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_INOTIFY_INIT1_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_INOTIFY_INIT1_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that uses inotify_init1() without using the IN_CLOEXEC flag.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-inotify-init1.html
+class CloexecInotifyInit1Check : public CloexecCheck {
+public:
+ CloexecInotifyInit1Check(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_INOTIFY_INIT1_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecInotifyInitCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecInotifyInitCheck.h
new file mode 100644
index 0000000..3b6e057
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecInotifyInitCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecInotifyInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_INOTIFY_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_INOTIFY_INIT_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// inotify_init() is better to be replaced by inotify_init1().
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-inotify-init.html
+class CloexecInotifyInitCheck : public CloexecCheck {
+public:
+ CloexecInotifyInitCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_INOTIFY_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecMemfdCreateCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecMemfdCreateCheck.h
new file mode 100644
index 0000000..f429ee5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecMemfdCreateCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecMemfdCreateCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_MEMFD_CREATE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_MEMFD_CREATE_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that uses memfd_create() without using the MFD_CLOEXEC flag.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-memfd-create.html
+class CloexecMemfdCreateCheck : public CloexecCheck {
+public:
+ CloexecMemfdCreateCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_MEMFD_CREATE_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecOpenCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecOpenCheck.h
new file mode 100644
index 0000000..eb3319c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecOpenCheck.h
@@ -0,0 +1,39 @@
+//===--- CloexecOpenCheck.h - clang-tidy-----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_OPEN_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_OPEN_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that opens file without using the O_CLOEXEC flag.
+///
+/// open(), openat(), and open64() had better to include O_CLOEXEC in their
+/// flags argument. Only consider simple cases that the corresponding argument
+/// is constant or binary operation OR among constants like 'O_CLOEXEC' or
+/// 'O_CLOEXEC | O_RDONLY'. No constant propagation is performed.
+///
+/// Only the symbolic 'O_CLOEXEC' macro definition is checked, not the concrete
+/// value.
+class CloexecOpenCheck : public CloexecCheck {
+public:
+ CloexecOpenCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_OPEN_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecPipe2Check.h b/linux-x64/clang/include/clang-tidy/android/CloexecPipe2Check.h
new file mode 100644
index 0000000..b588466
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecPipe2Check.h
@@ -0,0 +1,34 @@
+//===--- CloexecPipe2Check.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_PIPE2_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_PIPE2_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that uses pipe2() without using the O_CLOEXEC flag.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-pipe2.html
+class CloexecPipe2Check : public CloexecCheck {
+public:
+ CloexecPipe2Check(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_PIPE2_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecPipeCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecPipeCheck.h
new file mode 100644
index 0000000..c89fe79
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecPipeCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecPipeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_PIPE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_PIPE_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Suggests to replace calls to pipe() with calls to pipe2().
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-pipe.html
+class CloexecPipeCheck : public CloexecCheck {
+public:
+ CloexecPipeCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_PIPE_H
diff --git a/linux-x64/clang/include/clang-tidy/android/CloexecSocketCheck.h b/linux-x64/clang/include/clang-tidy/android/CloexecSocketCheck.h
new file mode 100644
index 0000000..acbfcea
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/CloexecSocketCheck.h
@@ -0,0 +1,34 @@
+//===--- CloexecSocketCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_SOCKET_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_SOCKET_H
+
+#include "CloexecCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Finds code that uses socket() without using the SOCK_CLOEXEC flag.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-socket.html
+class CloexecSocketCheck : public CloexecCheck {
+public:
+ CloexecSocketCheck(StringRef Name, ClangTidyContext *Context)
+ : CloexecCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_SOCKET_H
diff --git a/linux-x64/clang/include/clang-tidy/android/ComparisonInTempFailureRetryCheck.h b/linux-x64/clang/include/clang-tidy/android/ComparisonInTempFailureRetryCheck.h
new file mode 100644
index 0000000..7b000ab
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/android/ComparisonInTempFailureRetryCheck.h
@@ -0,0 +1,42 @@
+//===--- ComparisonInTempFailureRetryCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_COMPARISONINTEMPFAILURERETRYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_COMPARISONINTEMPFAILURERETRYCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace android {
+
+/// Attempts to catch calls to TEMP_FAILURE_RETRY with a top-level comparison
+/// operation, like `TEMP_FAILURE_RETRY(read(...) != N)`. In these cases, the
+/// comparison should go outside of the TEMP_FAILURE_RETRY.
+///
+/// TEMP_FAILURE_RETRY is a macro provided by both glibc and Bionic.
+class ComparisonInTempFailureRetryCheck : public ClangTidyCheck {
+public:
+ ComparisonInTempFailureRetryCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string RawRetryList;
+ SmallVector<StringRef, 5> RetryMacros;
+};
+
+} // namespace android
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_COMPARISONINTEMPFAILURERETRYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/boost/UseToStringCheck.h b/linux-x64/clang/include/clang-tidy/boost/UseToStringCheck.h
new file mode 100644
index 0000000..013348c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/boost/UseToStringCheck.h
@@ -0,0 +1,39 @@
+//===--- UseToStringCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BOOST_USE_TO_STRING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BOOST_USE_TO_STRING_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace boost {
+
+/// Finds calls to ``boost::lexical_cast<std::string>`` and
+/// ``boost::lexical_cast<std::wstring>`` and replaces them with
+/// ``std::to_string`` and ``std::to_wstring`` calls.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/boost-use-to-string.html
+class UseToStringCheck : public ClangTidyCheck {
+public:
+ UseToStringCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace boost
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BOOST_USE_TO_STRING_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ArgumentCommentCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ArgumentCommentCheck.h
new file mode 100644
index 0000000..0c66ffb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ArgumentCommentCheck.h
@@ -0,0 +1,65 @@
+//===--- ArgumentCommentCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_ARGUMENTCOMMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_ARGUMENTCOMMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/Support/Regex.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks that argument comments match parameter names.
+///
+/// The check understands argument comments in the form `/*parameter_name=*/`
+/// that are placed right before the argument.
+///
+/// \code
+/// void f(bool foo);
+///
+/// ...
+/// f(/*bar=*/true);
+/// // warning: argument name 'bar' in comment does not match parameter name
+/// 'foo'
+/// \endcode
+///
+/// The check tries to detect typos and suggest automated fixes for them.
+class ArgumentCommentCheck : public ClangTidyCheck {
+public:
+ ArgumentCommentCheck(StringRef Name, ClangTidyContext *Context);
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const unsigned StrictMode : 1;
+ const unsigned IgnoreSingleArgument : 1;
+ const unsigned CommentBoolLiterals : 1;
+ const unsigned CommentIntegerLiterals : 1;
+ const unsigned CommentFloatLiterals : 1;
+ const unsigned CommentStringLiterals : 1;
+ const unsigned CommentUserDefinedLiterals : 1;
+ const unsigned CommentCharacterLiterals : 1;
+ const unsigned CommentNullPtrs : 1;
+ llvm::Regex IdentRE;
+
+ void checkCallArgs(ASTContext *Ctx, const FunctionDecl *Callee,
+ SourceLocation ArgBeginLoc,
+ llvm::ArrayRef<const Expr *> Args);
+
+ bool shouldAddComment(const Expr *Arg) const;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_ARGUMENTCOMMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/AssertSideEffectCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/AssertSideEffectCheck.h
new file mode 100644
index 0000000..15d1a69
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/AssertSideEffectCheck.h
@@ -0,0 +1,51 @@
+//===--- AssertSideEffectCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_ASSERTSIDEEFFECTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_ASSERTSIDEEFFECTCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds `assert()` with side effect.
+///
+/// The condition of `assert()` is evaluated only in debug builds so a
+/// condition with side effect can cause different behavior in debug / release
+/// builds.
+///
+/// There are two options:
+///
+/// - `AssertMacros`: A comma-separated list of the names of assert macros to
+/// be checked.
+/// - `CheckFunctionCalls`: Whether to treat non-const member and non-member
+/// functions as they produce side effects. Disabled by default because it
+/// can increase the number of false positive warnings.
+class AssertSideEffectCheck : public ClangTidyCheck {
+public:
+ AssertSideEffectCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool CheckFunctionCalls;
+ const std::string RawAssertList;
+ SmallVector<StringRef, 5> AssertMacros;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_ASSERTSIDEEFFECTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/BadSignalToKillThreadCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/BadSignalToKillThreadCheck.h
new file mode 100644
index 0000000..d39fdec
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/BadSignalToKillThreadCheck.h
@@ -0,0 +1,37 @@
+//===--- BadSignalToKillThreadCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BADSIGNALTOKILLTHREADCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BADSIGNALTOKILLTHREADCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds ``pthread_kill`` function calls when thread is terminated by
+/// ``SIGTERM`` signal.
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-bad-signal-to-kill-thread.html
+class BadSignalToKillThreadCheck : public ClangTidyCheck {
+public:
+ BadSignalToKillThreadCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ Optional<unsigned> SigtermValue;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BADSIGNALTOKILLTHREADCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.h
new file mode 100644
index 0000000..2eed471
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.h
@@ -0,0 +1,41 @@
+//===--- BoolPointerImplicitConversionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BOOLPOINTERIMPLICITCONVERSIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BOOLPOINTERIMPLICITCONVERSIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks for conditions based on implicit conversion from a bool pointer to
+/// bool.
+///
+/// Example:
+///
+/// \code
+/// bool *p;
+/// if (p) {
+/// // Never used in a pointer-specific way.
+/// }
+/// \endcode
+class BoolPointerImplicitConversionCheck : public ClangTidyCheck {
+public:
+ BoolPointerImplicitConversionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BOOLPOINTERIMPLICITCONVERSIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/BranchCloneCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/BranchCloneCheck.h
new file mode 100644
index 0000000..1f8ebbe
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/BranchCloneCheck.h
@@ -0,0 +1,39 @@
+//===--- BranchCloneCheck.h - clang-tidy ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BRANCHCLONECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BRANCHCLONECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// A check for detecting if/else if/else chains where two or more branches are
+/// Type I clones of each other (that is, they contain identical code), for
+/// detecting switch statements where two or more consecutive branches are
+/// Type I clones of each other, and for detecting conditional operators where
+/// the true and false expressions are Type I clones of each other.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-branch-clone.html
+class BranchCloneCheck : public ClangTidyCheck {
+public:
+ BranchCloneCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BRANCHCLONECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/CopyConstructorInitCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/CopyConstructorInitCheck.h
new file mode 100644
index 0000000..f5ee77c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/CopyConstructorInitCheck.h
@@ -0,0 +1,38 @@
+//===--- CopyConstructorInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_COPY_CONSTRUCTOR_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_COPY_CONSTRUCTOR_INIT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds copy constructors where the ctor don't call the copy constructor of
+/// the base class.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-copy-constructor-init.html
+class CopyConstructorInitCheck : public ClangTidyCheck {
+public:
+ CopyConstructorInitCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_COPY_CONSTRUCTOR_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/DanglingHandleCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/DanglingHandleCheck.h
new file mode 100644
index 0000000..650522d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/DanglingHandleCheck.h
@@ -0,0 +1,42 @@
+//===--- DanglingHandleCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DANGLING_HANDLE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DANGLING_HANDLE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Detect dangling references in value handlers like
+/// std::experimental::string_view.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-dangling-handle.html
+class DanglingHandleCheck : public ClangTidyCheck {
+public:
+ DanglingHandleCheck(StringRef Name, ClangTidyContext *Context);
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ void registerMatchersForVariables(ast_matchers::MatchFinder *Finder);
+ void registerMatchersForReturn(ast_matchers::MatchFinder *Finder);
+
+ const std::vector<std::string> HandleClasses;
+ const ast_matchers::internal::Matcher<RecordDecl> IsAHandle;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DANGLING_HANDLE_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/DynamicStaticInitializersCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
new file mode 100644
index 0000000..f06b2d0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
@@ -0,0 +1,47 @@
+//===--- DynamicStaticInitializersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DYNAMIC_STATIC_INITIALIZERS_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DYNAMIC_STATIC_INITIALIZERS_CHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/FileExtensionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds dynamically initialized static variables in header files.
+///
+/// The check supports these options:
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extensions should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+//
+/// For extension-less header files, using an empty string or leaving an
+/// empty string between ";" if there are other filename extensions.
+class DynamicStaticInitializersCheck : public ClangTidyCheck {
+public:
+ DynamicStaticInitializersCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus && !LangOpts.ThreadsafeStatics;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string RawStringHeaderFileExtensions;
+ utils::FileExtensionsSet HeaderFileExtensions;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DYNAMIC_STATIC_INITIALIZERS_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ExceptionEscapeCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ExceptionEscapeCheck.h
new file mode 100644
index 0000000..b3de78b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ExceptionEscapeCheck.h
@@ -0,0 +1,49 @@
+//===--- ExceptionEscapeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_EXCEPTION_ESCAPE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_EXCEPTION_ESCAPE_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/ExceptionAnalyzer.h"
+#include "llvm/ADT/StringSet.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds functions which should not throw exceptions: Destructors, move
+/// constructors, move assignment operators, the main() function,
+/// swap() functions, functions marked with throw() or noexcept and functions
+/// given as option to the checker.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-exception-escape.html
+class ExceptionEscapeCheck : public ClangTidyCheck {
+public:
+ ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus && LangOpts.CXXExceptions;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ std::string RawFunctionsThatShouldNotThrow;
+ std::string RawIgnoredExceptions;
+
+ llvm::StringSet<> FunctionsThatShouldNotThrow;
+ utils::ExceptionAnalyzer Tracer;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_EXCEPTION_ESCAPE_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/FoldInitTypeCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/FoldInitTypeCheck.h
new file mode 100644
index 0000000..926b9e8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/FoldInitTypeCheck.h
@@ -0,0 +1,43 @@
+//===--- FoldInitTypeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FOLD_INIT_TYPE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FOLD_INIT_TYPE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Find and flag invalid initializer values in folds, e.g. std::accumulate.
+/// Example:
+/// \code
+/// auto v = {65536L * 65536 * 65536};
+/// std::accumulate(begin(v), end(v), 0 /* int type is too small */);
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-fold-init-type.html
+class FoldInitTypeCheck : public ClangTidyCheck {
+public:
+ FoldInitTypeCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void doCheck(const BuiltinType &IterValueType, const BuiltinType &InitType,
+ const ASTContext &Context, const CallExpr &CallNode);
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FOLD_INIT_TYPE_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.h
new file mode 100644
index 0000000..cd07a94
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.h
@@ -0,0 +1,58 @@
+//===--- ForwardDeclarationNamespaceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FORWARDDECLARATIONNAMESPACECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FORWARDDECLARATIONNAMESPACECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include <set>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks if an unused forward declaration is in a wrong namespace.
+///
+/// The check inspects all unused forward declarations and checks if there is
+/// any declaration/definition with the same name, which could indicate
+/// that the forward declaration is potentially in a wrong namespace.
+///
+/// \code
+/// namespace na { struct A; }
+/// namespace nb { struct A {} };
+/// nb::A a;
+/// // warning : no definition found for 'A', but a definition with the same
+/// name 'A' found in another namespace 'nb::'
+/// \endcode
+///
+/// This check can only generate warnings, but it can't suggest fixes at this
+/// point.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forward-declaration-namespace.html
+class ForwardDeclarationNamespaceCheck : public ClangTidyCheck {
+public:
+ ForwardDeclarationNamespaceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+
+private:
+ llvm::StringMap<std::vector<const CXXRecordDecl *>> DeclNameToDefinitions;
+ llvm::StringMap<std::vector<const CXXRecordDecl *>> DeclNameToDeclarations;
+ llvm::SmallPtrSet<const Type *, 16> FriendTypes;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FORWARDDECLARATIONNAMESPACECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.h
new file mode 100644
index 0000000..6e00464
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.h
@@ -0,0 +1,44 @@
+//===--- ForwardingReferenceOverloadCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FORWARDINGREFERENCEOVERLOADCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FORWARDINGREFERENCEOVERLOADCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// The checker looks for constructors that can act as copy or move constructors
+/// through their forwarding reference parameters. If a non const lvalue
+/// reference is passed to the constructor, the forwarding reference parameter
+/// can be a perfect match while the const reference parameter of the copy
+/// constructor can't. The forwarding reference constructor will be called,
+/// which can lead to confusion.
+/// For detailed description of this problem see: Scott Meyers, Effective Modern
+/// C++ Design, item 26.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forwarding-reference-overload.html
+class ForwardingReferenceOverloadCheck : public ClangTidyCheck {
+public:
+ ForwardingReferenceOverloadCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_FORWARDINGREFERENCEOVERLOADCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/InaccurateEraseCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/InaccurateEraseCheck.h
new file mode 100644
index 0000000..ef6006d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/InaccurateEraseCheck.h
@@ -0,0 +1,40 @@
+//===--- InaccurateEraseCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INACCURATEERASECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INACCURATEERASECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks for inaccurate use of the `erase()` method.
+///
+/// Algorithms like `remove()` do not actually remove any element from the
+/// container but return an iterator to the first redundant element at the end
+/// of the container. These redundant elements must be removed using the
+/// `erase()` method. This check warns when not all of the elements will be
+/// removed due to using an inappropriate overload.
+class InaccurateEraseCheck : public ClangTidyCheck {
+public:
+ InaccurateEraseCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INACCURATEERASECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/IncorrectRoundingsCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/IncorrectRoundingsCheck.h
new file mode 100644
index 0000000..7b6f15b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/IncorrectRoundingsCheck.h
@@ -0,0 +1,38 @@
+//===--- IncorrectRoundingsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INCORRECTROUNDINGSCHECK_H_
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INCORRECTROUNDINGSCHECK_H_
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks the usage of patterns known to produce incorrect rounding.
+/// Programmers often use
+/// (int)(double_expression + 0.5)
+/// to round the double expression to an integer. The problem with this
+/// 1. It is unnecessarily slow.
+/// 2. It is incorrect. The number 0.499999975 (smallest representable float
+/// number below 0.5) rounds to 1.0. Even worse behavior for negative
+/// numbers where both -0.5f and -1.4f both round to 0.0.
+class IncorrectRoundingsCheck : public ClangTidyCheck {
+public:
+ IncorrectRoundingsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INCORRECTROUNDINGSCHECK_H_
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/InfiniteLoopCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/InfiniteLoopCheck.h
new file mode 100644
index 0000000..45620bf
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/InfiniteLoopCheck.h
@@ -0,0 +1,35 @@
+//===--- InfiniteLoopCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INFINITELOOPCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INFINITELOOPCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds obvious infinite loops (loops where the condition variable is
+/// not changed at all).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-infinite-loop.html
+class InfiniteLoopCheck : public ClangTidyCheck {
+public:
+ InfiniteLoopCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INFINITELOOPCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/IntegerDivisionCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/IntegerDivisionCheck.h
new file mode 100644
index 0000000..6d2fb79
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/IntegerDivisionCheck.h
@@ -0,0 +1,35 @@
+//===--- IntegerDivisionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INTEGER_DIVISION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INTEGER_DIVISION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds cases where integer division in a floating point context is likely to
+/// cause unintended loss of precision.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-integer-division.html
+class IntegerDivisionCheck : public ClangTidyCheck {
+public:
+ IntegerDivisionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INTEGER_DIVISION_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/LambdaFunctionNameCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/LambdaFunctionNameCheck.h
new file mode 100644
index 0000000..d36ed46
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/LambdaFunctionNameCheck.h
@@ -0,0 +1,51 @@
+//===--- LambdaFunctionNameCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_LAMBDAFUNCTIONNAMECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_LAMBDAFUNCTIONNAMECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Detect when __func__ or __FUNCTION__ is being used from within a lambda. In
+/// that context, those expressions expand to the name of the call operator
+/// (i.e., `operator()`).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-lambda-function-name.html
+class LambdaFunctionNameCheck : public ClangTidyCheck {
+public:
+ struct SourceRangeLessThan {
+ bool operator()(const SourceRange &L, const SourceRange &R) const {
+ if (L.getBegin() == R.getBegin()) {
+ return L.getEnd() < R.getEnd();
+ }
+ return L.getBegin() < R.getBegin();
+ }
+ };
+ using SourceRangeSet = std::set<SourceRange, SourceRangeLessThan>;
+
+ LambdaFunctionNameCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ SourceRangeSet SuppressMacroExpansions;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_LAMBDAFUNCTIONNAMECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MacroParenthesesCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MacroParenthesesCheck.h
new file mode 100644
index 0000000..8b6edaa
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MacroParenthesesCheck.h
@@ -0,0 +1,43 @@
+//===--- MacroParenthesesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROPARENTHESESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROPARENTHESESCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds macros that can have unexpected behaviour due to missing parentheses.
+///
+/// Macros are expanded by the preprocessor as-is. As a result, there can be
+/// unexpected behaviour; operators may be evaluated in unexpected order and
+/// unary operators may become binary operators, etc.
+///
+/// When the replacement list has an expression, it is recommended to surround
+/// it with parentheses. This ensures that the macro result is evaluated
+/// completely before it is used.
+///
+/// It is also recommended to surround macro arguments in the replacement list
+/// with parentheses. This ensures that the argument value is calculated
+/// properly.
+class MacroParenthesesCheck : public ClangTidyCheck {
+public:
+ MacroParenthesesCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROPARENTHESESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.h
new file mode 100644
index 0000000..0189c7a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.h
@@ -0,0 +1,31 @@
+//===--- MacroRepeatedSideEffectsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROREPEATEDSIDEEFFECTSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROREPEATEDSIDEEFFECTSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks for repeated argument with side effects in macros.
+class MacroRepeatedSideEffectsCheck : public ClangTidyCheck {
+public:
+ MacroRepeatedSideEffectsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MACROREPEATEDSIDEEFFECTSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
new file mode 100644
index 0000000..0eb1b43
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
@@ -0,0 +1,36 @@
+//===--- MisplacedOperatorInStrlenInAllocCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACED_OPERATOR_IN_STRLEN_IN_ALLOC_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACED_OPERATOR_IN_STRLEN_IN_ALLOC_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds cases where ``1`` is added to the string in the argument to a function
+/// in the ``strlen()`` family instead of the result and value is used as an
+/// argument to a memory allocation function.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.html
+class MisplacedOperatorInStrlenInAllocCheck : public ClangTidyCheck {
+public:
+ MisplacedOperatorInStrlenInAllocCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACED_OPERATOR_IN_STRLEN_IN_ALLOC_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.h
new file mode 100644
index 0000000..e1b767b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.h
@@ -0,0 +1,36 @@
+//===--- MisplacedPointerArithmeticInAllocCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACED_OPERATOR_IN_ALLOC_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACED_OPERATOR_IN_ALLOC_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds cases where an integer is added to or subracted from the result of a
+/// memory allocation function instead of its argument.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-operator-in-alloc.html
+class MisplacedPointerArithmeticInAllocCheck : public ClangTidyCheck {
+public:
+ MisplacedPointerArithmeticInAllocCheck(StringRef Name,
+ ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACED_OPERATOR_IN_ALLOC_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MisplacedWideningCastCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MisplacedWideningCastCheck.h
new file mode 100644
index 0000000..a1b3737
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MisplacedWideningCastCheck.h
@@ -0,0 +1,45 @@
+//===--- MisplacedWideningCastCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACEDWIDENINGCASTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MISPLACEDWIDENINGCASTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Find casts of calculation results to bigger type. Typically from int to
+/// long. If the intention of the cast is to avoid loss of precision then
+/// the cast is misplaced, and there can be loss of precision. Otherwise
+/// such cast is ineffective.
+///
+/// There is one option:
+///
+/// - `CheckImplicitCasts`: Whether to check implicit casts as well which may
+// be the most common case. Enabled by default.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-widening-cast.html
+class MisplacedWideningCastCheck : public ClangTidyCheck {
+public:
+ MisplacedWideningCastCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool CheckImplicitCasts;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MoveForwardingReferenceCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MoveForwardingReferenceCheck.h
new file mode 100644
index 0000000..76284a0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MoveForwardingReferenceCheck.h
@@ -0,0 +1,51 @@
+//===--- MoveForwardingReferenceCheck.h - clang-tidy ----------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MOVEFORWARDINGREFERENCECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MOVEFORWARDINGREFERENCECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// The check warns if std::move is applied to a forwarding reference (i.e. an
+/// rvalue reference of a function template argument type).
+///
+/// If a developer is unaware of the special rules for template argument
+/// deduction on forwarding references, it will seem reasonable to apply
+/// std::move to the forwarding reference, in the same way that this would be
+/// done for a "normal" rvalue reference.
+///
+/// This has a consequence that is usually unwanted and possibly surprising: if
+/// the function that takes the forwarding reference as its parameter is called
+/// with an lvalue, that lvalue will be moved from (and hence placed into an
+/// indeterminate state) even though no std::move was applied to the lvalue at
+/// the call site.
+//
+/// The check suggests replacing the std::move with a std::forward.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-move-forwarding-reference.html
+class MoveForwardingReferenceCheck : public ClangTidyCheck {
+public:
+ MoveForwardingReferenceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MOVEFORWARDINGREFERENCECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/MultipleStatementMacroCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/MultipleStatementMacroCheck.h
new file mode 100644
index 0000000..72823d3
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/MultipleStatementMacroCheck.h
@@ -0,0 +1,36 @@
+//===--- MultipleStatementMacroCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MULTIPLE_STATEMENT_MACRO_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MULTIPLE_STATEMENT_MACRO_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Detect multiple statement macros that are used in unbraced conditionals.
+/// Only the first statement of the macro will be inside the conditional and the
+/// other ones will be executed unconditionally.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-multiple-statement-macro.html
+class MultipleStatementMacroCheck : public ClangTidyCheck {
+public:
+ MultipleStatementMacroCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_MULTIPLE_STATEMENT_MACRO_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/NoEscapeCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/NoEscapeCheck.h
new file mode 100644
index 0000000..126c37c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/NoEscapeCheck.h
@@ -0,0 +1,39 @@
+//===--- NoEscapeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOESCAPECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOESCAPECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Block arguments in `dispatch_async()` and `dispatch_after()` are guaranteed
+/// to escape. If those blocks capture any pointers with the `noescape`
+/// attribute, then we warn the user of their error.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-no-escape.html
+class NoEscapeCheck : public ClangTidyCheck {
+public:
+ NoEscapeCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.Blocks;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOESCAPECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/NotNullTerminatedResultCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/NotNullTerminatedResultCheck.h
new file mode 100644
index 0000000..18bd233
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/NotNullTerminatedResultCheck.h
@@ -0,0 +1,67 @@
+//===--- NotNullTerminatedResultCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOT_NULL_TERMINATED_RESULT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOT_NULL_TERMINATED_RESULT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds function calls where it is possible to cause a not null-terminated
+/// result. Usually the proper length of a string is 'strlen(src) + 1' or
+/// equal length of this expression, because the null terminator needs an extra
+/// space. Without the null terminator it can result in undefined behaviour
+/// when the string is read.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-not-null-terminated-result.html
+class NotNullTerminatedResultCheck : public ClangTidyCheck {
+public:
+ NotNullTerminatedResultCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+
+private:
+ // If non-zero it is specifying if the target environment is considered to
+ // implement '_s' suffixed memory and string handler functions which are safer
+ // than older version (e.g. 'memcpy_s()'). The default value is '1'.
+ const bool WantToUseSafeFunctions;
+
+ bool UseSafeFunctions = false;
+
+ void memoryHandlerFunctionFix(
+ StringRef Name, const ast_matchers::MatchFinder::MatchResult &Result);
+ void memcpyFix(StringRef Name,
+ const ast_matchers::MatchFinder::MatchResult &Result,
+ DiagnosticBuilder &Diag);
+ void memcpy_sFix(StringRef Name,
+ const ast_matchers::MatchFinder::MatchResult &Result,
+ DiagnosticBuilder &Diag);
+ void memchrFix(StringRef Name,
+ const ast_matchers::MatchFinder::MatchResult &Result);
+ void memmoveFix(StringRef Name,
+ const ast_matchers::MatchFinder::MatchResult &Result,
+ DiagnosticBuilder &Diag);
+ void strerror_sFix(const ast_matchers::MatchFinder::MatchResult &Result);
+ void ncmpFix(StringRef Name,
+ const ast_matchers::MatchFinder::MatchResult &Result);
+ void xfrmFix(StringRef Name,
+ const ast_matchers::MatchFinder::MatchResult &Result);
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NOT_NULL_TERMINATED_RESULT_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ParentVirtualCallCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ParentVirtualCallCheck.h
new file mode 100644
index 0000000..ade8017
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ParentVirtualCallCheck.h
@@ -0,0 +1,34 @@
+//===--- ParentVirtualCallCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_PARENTVIRTUALCALLCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_PARENTVIRTUALCALLCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds calls to grand..-parent virtual methods instead of parent's.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-parent-virtual-call.html
+class ParentVirtualCallCheck : public ClangTidyCheck {
+public:
+ ParentVirtualCallCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_PARENTVIRTUALCALLCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/PosixReturnCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/PosixReturnCheck.h
new file mode 100644
index 0000000..fe5c94c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/PosixReturnCheck.h
@@ -0,0 +1,30 @@
+//===--- PosixReturnCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_POSIX_RETURN_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_POSIX_RETURN_CHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+class PosixReturnCheck: public ClangTidyCheck {
+public:
+ PosixReturnCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_POSIX_RETURN_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/RedundantBranchConditionCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/RedundantBranchConditionCheck.h
new file mode 100644
index 0000000..7b38d59
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/RedundantBranchConditionCheck.h
@@ -0,0 +1,35 @@
+//===--- RedundantBranchConditionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_REDUNDANTBRANCHCONDITIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_REDUNDANTBRANCHCONDITIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds condition variables in nested `if` statements that were also checked
+/// in the outer `if` statement and were not changed.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-redundant-branch-condition.html
+class RedundantBranchConditionCheck : public ClangTidyCheck {
+public:
+ RedundantBranchConditionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_REDUNDANTBRANCHCONDITIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ReservedIdentifierCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ReservedIdentifierCheck.h
new file mode 100644
index 0000000..fa57090
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ReservedIdentifierCheck.h
@@ -0,0 +1,57 @@
+//===--- ReservedIdentifierCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_RESERVEDIDENTIFIERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_RESERVEDIDENTIFIERCHECK_H
+
+#include "../utils/RenamerClangTidyCheck.h"
+#include "llvm/ADT/Optional.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks for usages of identifiers reserved for use by the implementation.
+///
+/// The C and C++ standards both reserve the following names for such use:
+/// * identifiers that begin with an underscore followed by an uppercase letter;
+/// * identifiers in the global namespace that begin with an underscore.
+///
+/// The C standard additionally reserves names beginning with a double
+/// underscore, while the C++ standard strengthens this to reserve names with a
+/// double underscore occurring anywhere.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-reserved-identifier.html
+class ReservedIdentifierCheck final : public RenamerClangTidyCheck {
+ const bool Invert;
+ const std::vector<std::string> AllowedIdentifiers;
+
+public:
+ ReservedIdentifierCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ llvm::Optional<FailureInfo>
+ GetDeclFailureInfo(const NamedDecl *Decl,
+ const SourceManager &SM) const override;
+ llvm::Optional<FailureInfo>
+ GetMacroFailureInfo(const Token &MacroNameTok,
+ const SourceManager &SM) const override;
+ DiagInfo GetDiagInfo(const NamingCheckId &ID,
+ const NamingCheckFailure &Failure) const override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_RESERVEDIDENTIFIERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SignalHandlerCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SignalHandlerCheck.h
new file mode 100644
index 0000000..59197d8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SignalHandlerCheck.h
@@ -0,0 +1,42 @@
+//===--- SignalHandlerCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIGNALHANDLERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIGNALHANDLERCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/StringSet.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checker for signal handler functions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-signal-handler-check.html
+class SignalHandlerCheck : public ClangTidyCheck {
+public:
+ SignalHandlerCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void reportBug(const FunctionDecl *CalledFunction, const Expr *CallOrRef,
+ const CallExpr *SignalCall, const FunctionDecl *HandlerDecl);
+ bool isSystemCallAllowed(const FunctionDecl *FD) const;
+
+ static llvm::StringSet<> StrictConformingFunctions;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIGNALHANDLERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SignedCharMisuseCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SignedCharMisuseCheck.h
new file mode 100644
index 0000000..84d3bbb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SignedCharMisuseCheck.h
@@ -0,0 +1,48 @@
+//===--- SignedCharMisuseCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIGNEDCHARMISUSECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIGNEDCHARMISUSECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds those ``signed char`` -> integer conversions which might indicate a
+/// programming error. The basic problem with the ``signed char``, that it might
+/// store the non-ASCII characters as negative values. This behavior can cause a
+/// misunderstanding of the written code both when an explicit and when an
+/// implicit conversion happens.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-signed-char-misuse.html
+class SignedCharMisuseCheck : public ClangTidyCheck {
+public:
+ SignedCharMisuseCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ ast_matchers::internal::BindableMatcher<clang::Stmt> charCastExpression(
+ bool IsSigned,
+ const ast_matchers::internal::Matcher<clang::QualType> &IntegerType,
+ const std::string &CastBindName) const;
+
+ const std::string CharTypdefsToIgnoreList;
+ const bool DiagnoseSignedUnsignedCharComparisons;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIGNEDCHARMISUSECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SizeofContainerCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SizeofContainerCheck.h
new file mode 100644
index 0000000..c74b755
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SizeofContainerCheck.h
@@ -0,0 +1,35 @@
+//===--- SizeofContainerCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIZEOFCONTAINERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIZEOFCONTAINERCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Find usages of sizeof on expressions of STL container types. Most likely the
+/// user wanted to use `.size()` instead.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-sizeof-container.html
+class SizeofContainerCheck : public ClangTidyCheck {
+public:
+ SizeofContainerCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIZEOFCONTAINERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SizeofExpressionCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SizeofExpressionCheck.h
new file mode 100644
index 0000000..90d8122
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SizeofExpressionCheck.h
@@ -0,0 +1,40 @@
+//===--- SizeofExpressionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIZEOFEXPRESSIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIZEOFEXPRESSIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Find suspicious usages of sizeof expression.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-sizeof-expression.html
+class SizeofExpressionCheck : public ClangTidyCheck {
+public:
+ SizeofExpressionCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool WarnOnSizeOfConstant;
+ const bool WarnOnSizeOfIntegerExpression;
+ const bool WarnOnSizeOfThis;
+ const bool WarnOnSizeOfCompareToConstant;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SIZEOFEXPRESSIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
new file mode 100644
index 0000000..d2d3745
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h
@@ -0,0 +1,37 @@
+//===--- SpuriouslyWakeUpFunctionsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds ``cnd_wait``, ``cnd_timedwait``, ``wait``, ``wait_for``, or
+/// ``wait_until`` function calls when the function is not invoked from a loop
+/// that checks whether a condition predicate holds or the function has a
+/// condition parameter.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-spuriously-wake-up-functions.html
+class SpuriouslyWakeUpFunctionsCheck : public ClangTidyCheck {
+public:
+ SpuriouslyWakeUpFunctionsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SPURIOUSLYWAKEUPFUNCTIONSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/StringConstructorCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/StringConstructorCheck.h
new file mode 100644
index 0000000..50338f8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/StringConstructorCheck.h
@@ -0,0 +1,42 @@
+//===--- StringConstructorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRING_CONSTRUCTOR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRING_CONSTRUCTOR_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds suspicious string constructor and check their parameters.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-constructor.html
+class StringConstructorCheck : public ClangTidyCheck {
+public:
+ StringConstructorCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool WarnOnLargeLength;
+ const unsigned int LargeLengthThreshold;
+ std::vector<std::string> StringNames;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRING_CONSTRUCTOR_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/StringIntegerAssignmentCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/StringIntegerAssignmentCheck.h
new file mode 100644
index 0000000..6e8526e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/StringIntegerAssignmentCheck.h
@@ -0,0 +1,37 @@
+//===--- StringIntegerAssignmentCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRINGINTEGERASSIGNMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRINGINTEGERASSIGNMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds instances where an integer is assigned to a string.
+///
+/// For more details see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-string-assignment.html
+class StringIntegerAssignmentCheck : public ClangTidyCheck {
+public:
+ StringIntegerAssignmentCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRINGINTEGERASSIGNMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.h
new file mode 100644
index 0000000..a163a9f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.h
@@ -0,0 +1,34 @@
+//===--- StringLiteralWithEmbeddedNulCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRINGLITERALWITHEMBEDDEDNULCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRINGLITERALWITHEMBEDDEDNULCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Find suspicious string literals with embedded NUL characters.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-literal-with-embedded-nul.html
+class StringLiteralWithEmbeddedNulCheck : public ClangTidyCheck {
+public:
+ StringLiteralWithEmbeddedNulCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_STRINGLITERALWITHEMBEDDEDNULCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousEnumUsageCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousEnumUsageCheck.h
new file mode 100644
index 0000000..f05f3e1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousEnumUsageCheck.h
@@ -0,0 +1,38 @@
+//===--- SuspiciousEnumUsageCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSENUMUSAGECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSENUMUSAGECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// The checker detects various cases when an enum is probably misused (as a
+/// bitmask).
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-enum-usage.html
+class SuspiciousEnumUsageCheck : public ClangTidyCheck {
+public:
+ SuspiciousEnumUsageCheck(StringRef Name, ClangTidyContext *Context);
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ void checkSuspiciousBitmaskUsage(const Expr*, const EnumDecl*);
+ const bool StrictMode;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSENUMUSAGECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousIncludeCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousIncludeCheck.h
new file mode 100644
index 0000000..674292d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousIncludeCheck.h
@@ -0,0 +1,57 @@
+//===--- SuspiciousIncludeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSINCLUDECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSINCLUDECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/FileExtensionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Warns on inclusion of files whose names suggest that they're implementation
+/// files, instead of headers. E.g:
+///
+/// #include "foo.cpp" // warning
+/// #include "bar.c" // warning
+/// #include "baz.h" // no diagnostic
+///
+/// The check supports these options:
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extensions should not contain
+/// "." prefix) ";h;hh;hpp;hxx" by default. For extension-less header
+/// files, using an empty string or leaving an empty string between ";" if
+/// there are other filename extensions.
+///
+/// - `ImplementationFileExtensions`: likewise, a semicolon-separated list of
+/// filename extensions of implementation files. "c;cc;cpp;cxx" by default.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-include.html
+class SuspiciousIncludeCheck : public ClangTidyCheck {
+public:
+ SuspiciousIncludeCheck(StringRef Name, ClangTidyContext *Context);
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ utils::FileExtensionsSet HeaderFileExtensions;
+ utils::FileExtensionsSet ImplementationFileExtensions;
+
+private:
+ const std::string RawStringHeaderFileExtensions;
+ const std::string RawStringImplementationFileExtensions;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSINCLUDECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.h
new file mode 100644
index 0000000..4074641
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.h
@@ -0,0 +1,34 @@
+//===--- SuspiciousMemsetUsageCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUS_MEMSET_USAGE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUS_MEMSET_USAGE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds memset calls with potential mistakes in their arguments.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-memset-usage.html
+class SuspiciousMemsetUsageCheck : public ClangTidyCheck {
+public:
+ SuspiciousMemsetUsageCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUS_MEMSET_USAGE_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousMissingCommaCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousMissingCommaCheck.h
new file mode 100644
index 0000000..bf90f0a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousMissingCommaCheck.h
@@ -0,0 +1,43 @@
+//===--- SuspiciousMissingCommaCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSMISSINGCOMMACHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSMISSINGCOMMACHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// This check finds string literals which are probably concatenated
+/// accidentally.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-missing-comma.html
+class SuspiciousMissingCommaCheck : public ClangTidyCheck {
+public:
+ SuspiciousMissingCommaCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ // Minimal size of a string literals array to be considered by the checker.
+ const unsigned SizeThreshold;
+ // Maximal threshold ratio of suspicious string literals to be considered.
+ const double RatioThreshold;
+ // Maximal number of concatenated tokens.
+ const unsigned MaxConcatenatedTokens;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSMISSINGCOMMACHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousSemicolonCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousSemicolonCheck.h
new file mode 100644
index 0000000..0228f38
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousSemicolonCheck.h
@@ -0,0 +1,35 @@
+//===--- SuspiciousSemicolonCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSSEMICOLONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSSEMICOLONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// This check finds semicolon that modifies the meaning of the program
+/// unintendedly.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-semicolon.html
+class SuspiciousSemicolonCheck : public ClangTidyCheck {
+public:
+ SuspiciousSemicolonCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSSEMICOLONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousStringCompareCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousStringCompareCheck.h
new file mode 100644
index 0000000..d0cda51
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SuspiciousStringCompareCheck.h
@@ -0,0 +1,39 @@
+//===--- SuspiciousStringCompareCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSSTRINGCOMPARECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSSTRINGCOMPARECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Find suspicious calls to string compare functions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-string-compare.html
+class SuspiciousStringCompareCheck : public ClangTidyCheck {
+public:
+ SuspiciousStringCompareCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool WarnOnImplicitComparison;
+ const bool WarnOnLogicalNotComparison;
+ const std::string StringCompareLikeFunctions;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SUSPICIOUSSTRINGCOMPARECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/SwappedArgumentsCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/SwappedArgumentsCheck.h
new file mode 100644
index 0000000..484972c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/SwappedArgumentsCheck.h
@@ -0,0 +1,31 @@
+//===--- SwappedArgumentsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SWAPPEDARGUMENTSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SWAPPEDARGUMENTSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds potentially swapped arguments by looking at implicit conversions.
+class SwappedArgumentsCheck : public ClangTidyCheck {
+public:
+ SwappedArgumentsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_SWAPPEDARGUMENTSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/TerminatingContinueCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/TerminatingContinueCheck.h
new file mode 100644
index 0000000..480db5d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/TerminatingContinueCheck.h
@@ -0,0 +1,35 @@
+//===--- TerminatingContinueCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TERMINATINGCONTINUECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TERMINATINGCONTINUECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks if a 'continue' statement terminates the loop (i.e. the loop has
+/// a condition which always evaluates to false).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-terminating-continue.html
+class TerminatingContinueCheck : public ClangTidyCheck {
+public:
+ TerminatingContinueCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TERMINATINGCONTINUECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/ThrowKeywordMissingCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/ThrowKeywordMissingCheck.h
new file mode 100644
index 0000000..0ea1faa
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/ThrowKeywordMissingCheck.h
@@ -0,0 +1,38 @@
+//===--- ThrowKeywordMissingCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_THROWKEYWORDMISSINGCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_THROWKEYWORDMISSINGCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Emits a warning about temporary objects whose type is (or is derived from) a
+/// class that has 'EXCEPTION', 'Exception' or 'exception' in its name.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-throw-keyword-missing.html
+class ThrowKeywordMissingCheck : public ClangTidyCheck {
+public:
+ ThrowKeywordMissingCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_THROWKEYWORDMISSINGCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/TooSmallLoopVariableCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/TooSmallLoopVariableCheck.h
new file mode 100644
index 0000000..c48b446
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/TooSmallLoopVariableCheck.h
@@ -0,0 +1,46 @@
+//===--- TooSmallLoopVariableCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TOOSMALLLOOPVARIABLECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TOOSMALLLOOPVARIABLECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// This check gives a warning if a loop variable has a too small type which
+/// might not be able to represent all values which are part of the whole range
+/// in which the loop iterates.
+/// If the loop variable's type is too small we might end up in an infinite
+/// loop. Example:
+/// \code
+/// long size = 294967296l;
+/// for (short i = 0; i < size; ++i) {} { ... }
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-too-small-loop-variable.html
+class TooSmallLoopVariableCheck : public ClangTidyCheck {
+public:
+ TooSmallLoopVariableCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const unsigned MagnitudeBitsUpperLimit;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TOOSMALLLOOPVARIABLECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.h
new file mode 100644
index 0000000..25af704
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.h
@@ -0,0 +1,36 @@
+//===--- UndefinedMemoryManipulationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNDEFINED_MEMORY_MANIPULATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNDEFINED_MEMORY_MANIPULATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds calls of memory manipulation functions ``memset()``, ``memcpy()`` and
+/// ``memmove()`` on not TriviallyCopyable objects resulting in undefined
+/// behavior.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-undefined-memory-manipulation.html
+class UndefinedMemoryManipulationCheck : public ClangTidyCheck {
+public:
+ UndefinedMemoryManipulationCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNDEFINED_MEMORY_MANIPULATION_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/UndelegatedConstructorCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/UndelegatedConstructorCheck.h
new file mode 100644
index 0000000..8b95f9c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/UndelegatedConstructorCheck.h
@@ -0,0 +1,38 @@
+//===--- UndelegatedConstructorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNDELEGATEDCONSTRUCTOR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNDELEGATEDCONSTRUCTOR_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds creation of temporary objects in constructors that look like a
+/// function call to another constructor of the same class.
+///
+/// The user most likely meant to use a delegating constructor or base class
+/// initializer.
+class UndelegatedConstructorCheck : public ClangTidyCheck {
+public:
+ UndelegatedConstructorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNDELEGATEDCONSTRUCTOR_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.h
new file mode 100644
index 0000000..7f75af4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.h
@@ -0,0 +1,43 @@
+//===--- UnhandledSelfAssignmentCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNHANDLEDSELFASSIGNMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNHANDLEDSELFASSIGNMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds user-defined copy assignment operators which do not protect the code
+/// against self-assignment either by checking self-assignment explicitly or
+/// using the copy-and-swap or the copy-and-move method.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unhandled-self-assignment.html
+class UnhandledSelfAssignmentCheck : public ClangTidyCheck {
+public:
+ UnhandledSelfAssignmentCheck(StringRef Name, ClangTidyContext *Context);
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool WarnOnlyIfThisHasSuspiciousField;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNHANDLEDSELFASSIGNMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/UnusedRaiiCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/UnusedRaiiCheck.h
new file mode 100644
index 0000000..3608365
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/UnusedRaiiCheck.h
@@ -0,0 +1,37 @@
+//===--- UnusedRaiiCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNUSEDRAIICHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNUSEDRAIICHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Finds temporaries that look like RAII objects.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-raii.html
+class UnusedRaiiCheck : public ClangTidyCheck {
+public:
+ UnusedRaiiCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNUSEDRAIICHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/UnusedReturnValueCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/UnusedReturnValueCheck.h
new file mode 100644
index 0000000..7e100cd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/UnusedReturnValueCheck.h
@@ -0,0 +1,38 @@
+//===--- UnusedReturnValueCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNUSEDRETURNVALUECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNUSEDRETURNVALUECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Detects function calls where the return value is unused.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-return-value.html
+class UnusedReturnValueCheck : public ClangTidyCheck {
+public:
+ UnusedReturnValueCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ std::string CheckedFunctions;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNUSEDRETURNVALUECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/UseAfterMoveCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/UseAfterMoveCheck.h
new file mode 100644
index 0000000..6e51641
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/UseAfterMoveCheck.h
@@ -0,0 +1,38 @@
+//===--- UseAfterMoveCheck.h - clang-tidy ---------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_USEAFTERMOVECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_USEAFTERMOVECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// The check warns if an object is used after it has been moved, without an
+/// intervening reinitialization.
+///
+/// For details, see the user-facing documentation:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-use-after-move.html
+class UseAfterMoveCheck : public ClangTidyCheck {
+public:
+ UseAfterMoveCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_USEAFTERMOVECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/bugprone/VirtualNearMissCheck.h b/linux-x64/clang/include/clang-tidy/bugprone/VirtualNearMissCheck.h
new file mode 100644
index 0000000..69ae278
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/bugprone/VirtualNearMissCheck.h
@@ -0,0 +1,67 @@
+//===--- VirtualNearMissCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_VIRTUAL_NEAR_MISS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_VIRTUAL_NEAR_MISS_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/DenseMap.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+/// Checks for near miss of virtual methods.
+///
+/// For a method in a derived class, this check looks for virtual method with a
+/// very similar name and an identical signature defined in a base class.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-virtual-near-miss.html
+class VirtualNearMissCheck : public ClangTidyCheck {
+public:
+ VirtualNearMissCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ /// Check if the given method is possible to be overridden by some other
+ /// method. Operators and destructors are excluded.
+ ///
+ /// Results are memoized in PossibleMap.
+ bool isPossibleToBeOverridden(const CXXMethodDecl *BaseMD);
+
+ /// Check if the given base method is overridden by some methods in the given
+ /// derived class.
+ ///
+ /// Results are memoized in OverriddenMap.
+ bool isOverriddenByDerivedClass(const CXXMethodDecl *BaseMD,
+ const CXXRecordDecl *DerivedRD);
+
+ /// Key: the unique ID of a method.
+ /// Value: whether the method is possible to be overridden.
+ llvm::DenseMap<const CXXMethodDecl *, bool> PossibleMap;
+
+ /// Key: <unique ID of base method, name of derived class>
+ /// Value: whether the base method is overridden by some method in the derived
+ /// class.
+ llvm::DenseMap<std::pair<const CXXMethodDecl *, const CXXRecordDecl *>, bool>
+ OverriddenMap;
+
+ const unsigned EditDistanceThreshold = 1;
+};
+
+} // namespace bugprone
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_VIRTUAL_NEAR_MISS_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/CommandProcessorCheck.h b/linux-x64/clang/include/clang-tidy/cert/CommandProcessorCheck.h
new file mode 100644
index 0000000..14ebd08
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/CommandProcessorCheck.h
@@ -0,0 +1,37 @@
+//===--- CommandInterpreterCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_COMMAND_PROCESSOR_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_COMMAND_PROCESSOR_CHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Execution of a command processor can lead to security vulnerabilities,
+/// and is generally not required. Instead, prefer to launch executables
+/// directly via mechanisms that give you more control over what executable is
+/// actually launched.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-env33-c.html
+class CommandProcessorCheck : public ClangTidyCheck {
+public:
+ CommandProcessorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_COMMAND_PROCESSOR_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h b/linux-x64/clang/include/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h
new file mode 100644
index 0000000..02412b4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.h
@@ -0,0 +1,38 @@
+//===--- DefaultOperatorNewCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_DEFAULTOPERATORNEWALIGNMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_DEFAULTOPERATORNEWALIGNMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Checks if an object of type with extended alignment is allocated by using
+/// the default operator new.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-mem57-cpp.html
+class DefaultOperatorNewAlignmentCheck : public ClangTidyCheck {
+public:
+ DefaultOperatorNewAlignmentCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return !LangOpts.CPlusPlus17;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_DEFAULTOPERATORNEWALIGNMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/DontModifyStdNamespaceCheck.h b/linux-x64/clang/include/clang-tidy/cert/DontModifyStdNamespaceCheck.h
new file mode 100644
index 0000000..3cc03e8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/DontModifyStdNamespaceCheck.h
@@ -0,0 +1,38 @@
+//===--- DontModifyStdNamespaceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_DONT_MODIFY_STD_NAMESPACE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_DONT_MODIFY_STD_NAMESPACE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Modification of the std or posix namespace can result in undefined behavior.
+/// This check warns for such modifications.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-msc53-cpp.html
+class DontModifyStdNamespaceCheck : public ClangTidyCheck {
+public:
+ DontModifyStdNamespaceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_DONT_MODIFY_STD_NAMESPACE_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/FloatLoopCounter.h b/linux-x64/clang/include/clang-tidy/cert/FloatLoopCounter.h
new file mode 100644
index 0000000..be993c4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/FloatLoopCounter.h
@@ -0,0 +1,36 @@
+//===--- FloatLoopCounter.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_FLOAT_LOOP_COUNTER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_FLOAT_LOOP_COUNTER_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// This check diagnoses when the loop induction expression of a for loop has
+/// floating-point type. The check corresponds to:
+/// https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-flp30-c.html
+class FloatLoopCounter : public ClangTidyCheck {
+public:
+ FloatLoopCounter(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_FLOAT_LOOP_COUNTER_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/LimitedRandomnessCheck.h b/linux-x64/clang/include/clang-tidy/cert/LimitedRandomnessCheck.h
new file mode 100644
index 0000000..7ef75e3
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/LimitedRandomnessCheck.h
@@ -0,0 +1,37 @@
+//===--- LimitedRandomnessCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_LIMITED_RANDOMNESS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_LIMITED_RANDOMNESS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Pseudorandom number generators are not genuinely random. The result of the
+/// std::rand() function makes no guarantees as to the quality of the random
+/// sequence produced.
+/// This check warns for the usage of std::rand() function.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-msc50-cpp.html
+class LimitedRandomnessCheck : public ClangTidyCheck {
+public:
+ LimitedRandomnessCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_LIMITED_RANDOMNESS_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/MutatingCopyCheck.h b/linux-x64/clang/include/clang-tidy/cert/MutatingCopyCheck.h
new file mode 100644
index 0000000..f54371e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/MutatingCopyCheck.h
@@ -0,0 +1,38 @@
+//===--- MutatingCopyCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_MUTATINGCOPYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_MUTATINGCOPYCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Finds assignments to the copied object and its direct or indirect members
+/// in copy constructors and copy assignment operators.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-oop58-cpp.html
+class MutatingCopyCheck : public ClangTidyCheck {
+public:
+ MutatingCopyCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_MUTATINGCOPYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.h b/linux-x64/clang/include/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.h
new file mode 100644
index 0000000..41737dd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.h
@@ -0,0 +1,44 @@
+//===--- NonTrivialTypesLibcMemoryCallsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_NONTRIVIALTYPESLIBCMEMORYCALLSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_NONTRIVIALTYPESLIBCMEMORYCALLSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Flags use of the `C` standard library functions 'memset', 'memcpy' and
+/// 'memcmp' and similar derivatives on non-trivial types.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-oop57-cpp.html
+class NonTrivialTypesLibcMemoryCallsCheck : public ClangTidyCheck {
+public:
+ NonTrivialTypesLibcMemoryCallsCheck(StringRef Name,
+ ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus && !LangOpts.ObjC;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string MemSetNames;
+ const std::string MemCpyNames;
+ const std::string MemCmpNames;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_NOTTRIVIALTYPESLIBCMEMORYCALLSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/PostfixOperatorCheck.h b/linux-x64/clang/include/clang-tidy/cert/PostfixOperatorCheck.h
new file mode 100644
index 0000000..08d892d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/PostfixOperatorCheck.h
@@ -0,0 +1,38 @@
+//===--- PostfixOperatorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_POSTFIX_OPERATOR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_POSTFIX_OPERATOR_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Checks if the overloaded postfix ++ and -- operator return a constant
+/// object.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-postfix-operator.html
+class PostfixOperatorCheck : public ClangTidyCheck {
+public:
+ PostfixOperatorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_POSTFIX_OPERATOR_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.h b/linux-x64/clang/include/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.h
new file mode 100644
index 0000000..04d1f7b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.h
@@ -0,0 +1,46 @@
+//===--- ProperlySeededRandomGeneratorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_PROPERLY_SEEDED_RANDOM_GENERATOR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_PROPERLY_SEEDED_RANDOM_GENERATOR_H
+
+#include "../ClangTidyCheck.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Random number generator must be seeded properly.
+///
+/// A random number generator initialized with default value or a
+/// constant expression is a security vulnerability.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-properly-seeded-random-generator.html
+class ProperlySeededRandomGeneratorCheck : public ClangTidyCheck {
+public:
+ ProperlySeededRandomGeneratorCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ template <class T>
+ void checkSeed(const ast_matchers::MatchFinder::MatchResult &Result,
+ const T *Func);
+
+ std::string RawDisallowedSeedTypes;
+ SmallVector<StringRef, 5> DisallowedSeedTypes;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_PROPERLY_SEEDED_RANDOM_GENERATOR_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/SetLongJmpCheck.h b/linux-x64/clang/include/clang-tidy/cert/SetLongJmpCheck.h
new file mode 100644
index 0000000..95b440d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/SetLongJmpCheck.h
@@ -0,0 +1,39 @@
+//===--- SetLongJmpCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SETLONGJMPCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SETLONGJMPCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Guards against use of setjmp/longjmp in C++ code
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err52-cpp.html
+class SetLongJmpCheck : public ClangTidyCheck {
+public:
+ SetLongJmpCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SETLONGJMPCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/StaticObjectExceptionCheck.h b/linux-x64/clang/include/clang-tidy/cert/StaticObjectExceptionCheck.h
new file mode 100644
index 0000000..768ae76
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/StaticObjectExceptionCheck.h
@@ -0,0 +1,38 @@
+//===--- StaticObjectExceptionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_ERR58_CPP_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_ERR58_CPP_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Checks whether the constructor for a static or thread_local object will
+/// throw.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err58-cpp.html
+class StaticObjectExceptionCheck : public ClangTidyCheck {
+public:
+ StaticObjectExceptionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return getLangOpts().CPlusPlus && getLangOpts().CXXExceptions;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_ERR58_CPP_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/StrToNumCheck.h b/linux-x64/clang/include/clang-tidy/cert/StrToNumCheck.h
new file mode 100644
index 0000000..3ac090b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/StrToNumCheck.h
@@ -0,0 +1,35 @@
+//===--- StrToNumCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_STRTONUMCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_STRTONUMCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Guards against use of string conversion functions that do not have
+/// reasonable error handling for conversion errors.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err34-c.html
+class StrToNumCheck : public ClangTidyCheck {
+public:
+ StrToNumCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_STRTONUMCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/ThrownExceptionTypeCheck.h b/linux-x64/clang/include/clang-tidy/cert/ThrownExceptionTypeCheck.h
new file mode 100644
index 0000000..80c51ed
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/ThrownExceptionTypeCheck.h
@@ -0,0 +1,37 @@
+//===--- ThrownExceptionTypeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_THROWNEXCEPTIONTYPECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_THROWNEXCEPTIONTYPECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Checks whether a thrown object is nothrow copy constructible.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err60-cpp.html
+class ThrownExceptionTypeCheck : public ClangTidyCheck {
+public:
+ ThrownExceptionTypeCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_THROWNEXCEPTIONTYPECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cert/VariadicFunctionDefCheck.h b/linux-x64/clang/include/clang-tidy/cert/VariadicFunctionDefCheck.h
new file mode 100644
index 0000000..43cbf2e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cert/VariadicFunctionDefCheck.h
@@ -0,0 +1,37 @@
+//===--- VariadicFunctionDefCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_VARIADICFUNCTIONDEF_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_VARIADICFUNCTIONDEF_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cert {
+
+/// Guards against any C-style variadic function definitions (not declarations).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cert-dcl50-cpp.html
+class VariadicFunctionDefCheck : public ClangTidyCheck {
+public:
+ VariadicFunctionDefCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cert
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_VARIADICFUNCTIONDEF_H
diff --git a/linux-x64/clang/include/clang-tidy/concurrency/MtUnsafeCheck.h b/linux-x64/clang/include/clang-tidy/concurrency/MtUnsafeCheck.h
new file mode 100644
index 0000000..9196194
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/concurrency/MtUnsafeCheck.h
@@ -0,0 +1,43 @@
+//===--- MtUnsafeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CONCURRENCY_MTUNSAFECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CONCURRENCY_MTUNSAFECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace concurrency {
+
+/// Checks that non-thread-safe functions are not used.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/threads-mt-unsafe.html
+class MtUnsafeCheck : public ClangTidyCheck {
+public:
+ MtUnsafeCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+ enum class FunctionSet {
+ Posix,
+ Glibc,
+ Any,
+ };
+
+private:
+ const FunctionSet FuncSet;
+};
+
+} // namespace concurrency
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CONCURRENCY_MTUNSAFECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/AvoidGotoCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/AvoidGotoCheck.h
new file mode 100644
index 0000000..9913d9c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/AvoidGotoCheck.h
@@ -0,0 +1,38 @@
+//===--- AvoidGotoCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_AVOIDGOTOCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_AVOIDGOTOCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// The usage of ``goto`` for control flow is error prone and should be replaced
+/// with looping constructs. Only forward jumps in nested loops are accepted.
+//
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-avoid-goto.html
+class AvoidGotoCheck : public ClangTidyCheck {
+public:
+ AvoidGotoCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_AVOIDGOTOCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.h
new file mode 100644
index 0000000..4f5a2a0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.h
@@ -0,0 +1,35 @@
+//===--- AvoidNonConstGlobalVariablesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_AVOIDNONCONSTGLOBALVARIABLESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_AVOIDNONCONSTGLOBALVARIABLESCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Non-const global variables hide dependencies and make the dependencies
+/// subject to unpredictable changes.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-avoid-non-const-global-variables.html
+class AvoidNonConstGlobalVariablesCheck : public ClangTidyCheck {
+public:
+ AvoidNonConstGlobalVariablesCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_AVOIDNONCONSTGLOBALVARIABLESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/InitVariablesCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/InitVariablesCheck.h
new file mode 100644
index 0000000..0f77810
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/InitVariablesCheck.h
@@ -0,0 +1,42 @@
+//===--- InitVariablesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_INITVARIABLESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_INITVARIABLESCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+#include "../utils/OptionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Find uninitialized local variables.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-init-variables.html
+class InitVariablesCheck : public ClangTidyCheck {
+public:
+ InitVariablesCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ utils::IncludeInserter IncludeInserter;
+ const std::string MathHeader;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_INITVARIABLESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.h
new file mode 100644
index 0000000..ddca98d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.h
@@ -0,0 +1,34 @@
+//===--- InterfacesGlobalInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_INTERFACES_GLOBAL_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_INTERFACES_GLOBAL_INIT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Flags possible initialization order issues of static variables.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.html
+class InterfacesGlobalInitCheck : public ClangTidyCheck {
+public:
+ InterfacesGlobalInitCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_INTERFACES_GLOBAL_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/MacroUsageCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/MacroUsageCheck.h
new file mode 100644
index 0000000..8145080
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/MacroUsageCheck.h
@@ -0,0 +1,55 @@
+//===--- MacroUsageCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "clang/Lex/MacroInfo.h"
+#include <string>
+
+namespace clang {
+class MacroDirective;
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Find macro usage that is considered problematic because better language
+/// constructs exist for the task.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-macro-usage.html
+class MacroUsageCheck : public ClangTidyCheck {
+public:
+ MacroUsageCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ AllowedRegexp(Options.get("AllowedRegexp", "^DEBUG_*")),
+ CheckCapsOnly(Options.get("CheckCapsOnly", false)),
+ IgnoreCommandLineMacros(Options.get("IgnoreCommandLineMacros", true)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void warnMacro(const MacroDirective *MD, StringRef MacroName);
+ void warnNaming(const MacroDirective *MD, StringRef MacroName);
+
+private:
+ /// A regular expression that defines how allowed macros must look like.
+ std::string AllowedRegexp;
+ /// Control if only the check shall only test on CAPS_ONLY macros.
+ bool CheckCapsOnly;
+ /// Should the macros without a valid location be diagnosed?
+ bool IgnoreCommandLineMacros;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_MACROUSAGECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h
new file mode 100644
index 0000000..177cdab
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h
@@ -0,0 +1,104 @@
+//===--- NarrowingConversionsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NARROWING_CONVERSIONS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NARROWING_CONVERSIONS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Checks for narrowing conversions, e.g:
+/// int i = 0;
+/// i += 0.1;
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.html
+class NarrowingConversionsCheck : public ClangTidyCheck {
+public:
+ NarrowingConversionsCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void diagNarrowType(SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void diagNarrowTypeToSignedInt(SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void diagNarrowIntegerConstant(SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs, const llvm::APSInt &Value);
+
+ void diagNarrowIntegerConstantToSignedInt(SourceLocation SourceLoc,
+ const Expr &Lhs, const Expr &Rhs,
+ const llvm::APSInt &Value,
+ const uint64_t HexBits);
+
+ void diagNarrowConstant(SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void diagConstantCast(SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void diagNarrowTypeOrConstant(const ASTContext &Context,
+ SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleIntegralCast(const ASTContext &Context, SourceLocation SourceLoc,
+ const Expr &Lhs, const Expr &Rhs);
+
+ void handleIntegralToBoolean(const ASTContext &Context,
+ SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleIntegralToFloating(const ASTContext &Context,
+ SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleFloatingToIntegral(const ASTContext &Context,
+ SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleFloatingToBoolean(const ASTContext &Context,
+ SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleBooleanToSignedIntegral(const ASTContext &Context,
+ SourceLocation SourceLoc, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleFloatingCast(const ASTContext &Context, SourceLocation SourceLoc,
+ const Expr &Lhs, const Expr &Rhs);
+
+ void handleBinaryOperator(const ASTContext &Context, SourceLocation SourceLoc,
+ const Expr &Lhs, const Expr &Rhs);
+
+ bool handleConditionalOperator(const ASTContext &Context, const Expr &Lhs,
+ const Expr &Rhs);
+
+ void handleImplicitCast(const ASTContext &Context,
+ const ImplicitCastExpr &Cast);
+
+ void handleBinaryOperator(const ASTContext &Context,
+ const BinaryOperator &Op);
+
+ const bool WarnOnFloatingPointNarrowingConversion;
+ const bool PedanticMode;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NARROWING_CONVERSIONS_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/NoMallocCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/NoMallocCheck.h
new file mode 100644
index 0000000..6be0192
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/NoMallocCheck.h
@@ -0,0 +1,63 @@
+//===--- NoMallocCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NO_MALLOC_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NO_MALLOC_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This checker is concerned with C-style memory management and suggest modern
+/// alternatives to it.
+/// The check is only enabled in C++. For analyzing malloc calls see Clang
+/// Static Analyzer - unix.Malloc.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-no-malloc.html
+class NoMallocCheck : public ClangTidyCheck {
+public:
+ /// Construct Checker and read in configuration for function names.
+ NoMallocCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ AllocList(Options.get("Allocations", "::malloc;::calloc")),
+ ReallocList(Options.get("Reallocations", "::realloc")),
+ DeallocList(Options.get("Deallocations", "::free")) {}
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+
+ /// Make configuration of checker discoverable.
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ /// Registering for malloc, calloc, realloc and free calls.
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+
+ /// Checks matched function calls and gives suggestion to modernize the code.
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ /// Semicolon-separated list of fully qualified names of memory allocation
+ /// functions the check warns about. Defaults to `::malloc;::calloc`.
+ const std::string AllocList;
+ /// Semicolon-separated list of fully qualified names of memory reallocation
+ /// functions the check warns about. Defaults to `::realloc`.
+ const std::string ReallocList;
+ /// Semicolon-separated list of fully qualified names of memory deallocation
+ /// functions the check warns about. Defaults to `::free`.
+ const std::string DeallocList;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NO_MALLOC_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/OwningMemoryCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/OwningMemoryCheck.h
new file mode 100644
index 0000000..bac16bb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/OwningMemoryCheck.h
@@ -0,0 +1,65 @@
+//===--- OwningMemoryCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Checks for common use cases for gsl::owner and enforces the unique owner
+/// nature of it whenever possible.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-owning-memory.html
+class OwningMemoryCheck : public ClangTidyCheck {
+public:
+ OwningMemoryCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ LegacyResourceProducers(Options.get(
+ "LegacyResourceProducers", "::malloc;::aligned_alloc;::realloc;"
+ "::calloc;::fopen;::freopen;::tmpfile")),
+ LegacyResourceConsumers(Options.get(
+ "LegacyResourceConsumers", "::free;::realloc;::freopen;::fclose")) {
+ }
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+
+ /// Make configuration of checker discoverable.
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ bool handleDeletion(const ast_matchers::BoundNodes &Nodes);
+ bool handleLegacyConsumers(const ast_matchers::BoundNodes &Nodes);
+ bool handleExpectedOwner(const ast_matchers::BoundNodes &Nodes);
+ bool handleAssignmentAndInit(const ast_matchers::BoundNodes &Nodes);
+ bool handleAssignmentFromNewOwner(const ast_matchers::BoundNodes &Nodes);
+ bool handleReturnValues(const ast_matchers::BoundNodes &Nodes);
+ bool handleOwnerMembers(const ast_matchers::BoundNodes &Nodes);
+
+ /// List of old C-style functions that create resources.
+ /// Defaults to
+ /// `::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile`.
+ const std::string LegacyResourceProducers;
+ /// List of old C-style functions that consume or release resources.
+ /// Defaults to `::free;::realloc;::freopen;::fclose`.
+ const std::string LegacyResourceConsumers;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_OWNING_MEMORY_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.h
new file mode 100644
index 0000000..dbef7c9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.h
@@ -0,0 +1,41 @@
+//===--- PreferMemberInitializerCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PREFERMEMBERINITIALIZERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PREFERMEMBERINITIALIZERCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Finds member initializations in the constructor body which can be placed
+/// into the initialization list instead.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-prefer-member-initializer.html
+class PreferMemberInitializerCheck : public ClangTidyCheck {
+public:
+ PreferMemberInitializerCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+ const bool IsUseDefaultMemberInitEnabled;
+ const bool UseAssignment;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PREFERMEMBERINITIALIZERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
new file mode 100644
index 0000000..b81a46f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h
@@ -0,0 +1,37 @@
+//===--- ProBoundsArrayToPointerDecayCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_ARRAY_TO_POINTER_DECAY_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_ARRAY_TO_POINTER_DECAY_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This check flags all array to pointer decays
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-bounds-array-to-pointer-decay.html
+class ProBoundsArrayToPointerDecayCheck : public ClangTidyCheck {
+public:
+ ProBoundsArrayToPointerDecayCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_ARRAY_TO_POINTER_DECAY_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h
new file mode 100644
index 0000000..04a51b9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h
@@ -0,0 +1,44 @@
+//===--- ProBoundsConstantArrayIndexCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_CONSTANT_ARRAY_INDEX_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_CONSTANT_ARRAY_INDEX_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This checks that all array subscriptions on static arrays and std::arrays
+/// have a constant index and are within bounds
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.html
+class ProBoundsConstantArrayIndexCheck : public ClangTidyCheck {
+ const std::string GslHeader;
+ utils::IncludeInserter Inserter;
+
+public:
+ ProBoundsConstantArrayIndexCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_CONSTANT_ARRAY_INDEX_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
new file mode 100644
index 0000000..a3aef8e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h
@@ -0,0 +1,36 @@
+//===--- ProBoundsPointerArithmeticCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_POINTER_ARITHMETIC_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_POINTER_ARITHMETIC_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Flags all kinds of pointer arithmetic that have result of pointer type, i.e.
+/// +, -, +=, -=, ++, --. In addition, the [] operator on pointers (not on
+/// arrays) is flagged.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.html
+class ProBoundsPointerArithmeticCheck : public ClangTidyCheck {
+public:
+ ProBoundsPointerArithmeticCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_POINTER_ARITHMETIC_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h
new file mode 100644
index 0000000..3689e2e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h
@@ -0,0 +1,37 @@
+//===--- ProTypeConstCastCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CONST_CAST_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CONST_CAST_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This check flags all instances of const_cast
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-const-cast.html
+class ProTypeConstCastCheck : public ClangTidyCheck {
+public:
+ ProTypeConstCastCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CONST_CAST_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h
new file mode 100644
index 0000000..76d2b67
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h
@@ -0,0 +1,38 @@
+//===--- ProTypeCstyleCastCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CSTYLE_CAST_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CSTYLE_CAST_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This check flags all use of C-style casts that perform a static_cast
+/// downcast, const_cast, or reinterpret_cast.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-cstyle-cast.html
+class ProTypeCstyleCastCheck : public ClangTidyCheck {
+public:
+ ProTypeCstyleCastCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_CSTYLE_CAST_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h
new file mode 100644
index 0000000..5b41443
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h
@@ -0,0 +1,81 @@
+//===--- ProTypeMemberInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_MEMBER_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_MEMBER_INIT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Implements C++ Core Guidelines Type.6.
+///
+/// Checks that every user-provided constructor value-initializes all class
+/// members and base classes that would have undefined behavior otherwise. Also
+/// check that any record types without user-provided default constructors are
+/// value-initialized where used.
+///
+/// Members initialized through function calls in the body of the constructor
+/// will result in false positives.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.html
+/// TODO: See if 'fixes' for false positives are optimized away by the compiler.
+/// TODO: For classes with multiple constructors, make sure that we don't offer
+/// multiple in-class initializer fixits for the same member.
+class ProTypeMemberInitCheck : public ClangTidyCheck {
+public:
+ ProTypeMemberInitCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ // Checks Type.6 part 1:
+ // Issue a diagnostic for any constructor of a non-trivially-constructible
+ // type that does not initialize all member variables.
+ //
+ // To fix: Write a data member initializer, or mention it in the member
+ // initializer list.
+ void checkMissingMemberInitializer(ASTContext &Context,
+ const CXXRecordDecl &ClassDecl,
+ const CXXConstructorDecl *Ctor);
+
+ // A subtle side effect of Type.6 part 2:
+ // Make sure to initialize trivially constructible base classes.
+ void checkMissingBaseClassInitializer(const ASTContext &Context,
+ const CXXRecordDecl &ClassDecl,
+ const CXXConstructorDecl *Ctor);
+
+ // Checks Type.6 part 2:
+ // Issue a diagnostic when constructing an object of a trivially constructible
+ // type without () or {} to initialize its members.
+ //
+ // To fix: Add () or {}.
+ void checkUninitializedTrivialType(const ASTContext &Context,
+ const VarDecl *Var);
+
+ // Whether arrays need to be initialized or not. Default is false.
+ bool IgnoreArrays;
+
+ // Whether fix-its for initialization of fundamental type use assignment
+ // instead of brace initialization. Only effective in C++11 mode. Default is
+ // false.
+ bool UseAssignment;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_MEMBER_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h
new file mode 100644
index 0000000..8be1800
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h
@@ -0,0 +1,37 @@
+//===--- ProTypeReinterpretCast.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_REINTERPRETCAST_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_REINTERPRETCAST_CHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Flags all occurrences of reinterpret_cast
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.html
+class ProTypeReinterpretCastCheck : public ClangTidyCheck {
+public:
+ ProTypeReinterpretCastCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_REINTERPRETCAST_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
new file mode 100644
index 0000000..e3d7685
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h
@@ -0,0 +1,38 @@
+//===--- ProTypeStaticCastDowncastCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_STATIC_CAST_DOWNCAST_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_STATIC_CAST_DOWNCAST_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Checks for usages of static_cast, where a base class is downcasted to a
+/// derived class.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-static-cast-downcast.html
+class ProTypeStaticCastDowncastCheck : public ClangTidyCheck {
+public:
+ ProTypeStaticCastDowncastCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_STATIC_CAST_DOWNCAST_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
new file mode 100644
index 0000000..de4f8bb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h
@@ -0,0 +1,38 @@
+//===--- ProTypeUnionAccessCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_UNION_ACCESS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_UNION_ACCESS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This check flags all access to members of unions.
+/// Access to a union as a whole (e.g. passing to a function) is not flagged.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-union-access.html
+class ProTypeUnionAccessCheck : public ClangTidyCheck {
+public:
+ ProTypeUnionAccessCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_UNION_ACCESS_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h
new file mode 100644
index 0000000..06de06e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h
@@ -0,0 +1,38 @@
+//===--- ProTypeVarargCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_VARARG_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_VARARG_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// This check flags all calls to c-style variadic functions and all use
+/// of va_arg.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-vararg.html
+class ProTypeVarargCheck : public ClangTidyCheck {
+public:
+ ProTypeVarargCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_TYPE_VARARG_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/SlicingCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/SlicingCheck.h
new file mode 100644
index 0000000..002c724
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/SlicingCheck.h
@@ -0,0 +1,44 @@
+//===--- SlicingCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_SLICING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_SLICING_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Flags slicing (incomplete copying of an object's state) of member variables
+/// or vtable. See:
+/// - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es63-dont-slice
+/// for the former, and
+/// - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c145-access-polymorphic-objects-through-pointers-and-references
+/// for the latter
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-slicing.html
+class SlicingCheck : public ClangTidyCheck {
+public:
+ SlicingCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void DiagnoseSlicedOverriddenMethods(const Expr &call,
+ const CXXRecordDecl &DerivedDecl,
+ const CXXRecordDecl &BaseDecl);
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_SLICING_H
diff --git a/linux-x64/clang/include/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
new file mode 100644
index 0000000..f232a0a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
@@ -0,0 +1,116 @@
+//===--- SpecialMemberFunctionsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_SPECIAL_MEMBER_FUNCTIONS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_SPECIAL_MEMBER_FUNCTIONS_H
+
+#include "../ClangTidyCheck.h"
+
+#include "llvm/ADT/DenseMapInfo.h"
+
+namespace clang {
+namespace tidy {
+namespace cppcoreguidelines {
+
+/// Checks for classes where some, but not all, of the special member functions
+/// are defined.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-special-member-functions.html
+class SpecialMemberFunctionsCheck : public ClangTidyCheck {
+public:
+ SpecialMemberFunctionsCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+
+ enum class SpecialMemberFunctionKind : uint8_t {
+ Destructor,
+ DefaultDestructor,
+ NonDefaultDestructor,
+ CopyConstructor,
+ CopyAssignment,
+ MoveConstructor,
+ MoveAssignment
+ };
+
+ struct SpecialMemberFunctionData {
+ SpecialMemberFunctionKind FunctionKind;
+ bool IsDeleted;
+
+ bool operator==(const SpecialMemberFunctionData &Other) {
+ return (Other.FunctionKind == FunctionKind) &&
+ (Other.IsDeleted == IsDeleted);
+ }
+ };
+
+ using ClassDefId = std::pair<SourceLocation, std::string>;
+
+ using ClassDefiningSpecialMembersMap =
+ llvm::DenseMap<ClassDefId,
+ llvm::SmallVector<SpecialMemberFunctionData, 5>>;
+
+private:
+ void checkForMissingMembers(
+ const ClassDefId &ID,
+ llvm::ArrayRef<SpecialMemberFunctionData> DefinedSpecialMembers);
+
+ const bool AllowMissingMoveFunctions;
+ const bool AllowSoleDefaultDtor;
+ const bool AllowMissingMoveFunctionsWhenCopyIsDeleted;
+ ClassDefiningSpecialMembersMap ClassWithSpecialMembers;
+};
+
+} // namespace cppcoreguidelines
+} // namespace tidy
+} // namespace clang
+
+namespace llvm {
+/// Specialisation of DenseMapInfo to allow ClassDefId objects in DenseMaps
+/// FIXME: Move this to the corresponding cpp file as is done for
+/// clang-tidy/readability/IdentifierNamingCheck.cpp.
+template <>
+struct DenseMapInfo<
+ clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::ClassDefId> {
+ using ClassDefId =
+ clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::ClassDefId;
+
+ static inline ClassDefId getEmptyKey() {
+ return ClassDefId(DenseMapInfo<clang::SourceLocation>::getEmptyKey(),
+ "EMPTY");
+ }
+
+ static inline ClassDefId getTombstoneKey() {
+ return ClassDefId(DenseMapInfo<clang::SourceLocation>::getTombstoneKey(),
+ "TOMBSTONE");
+ }
+
+ static unsigned getHashValue(ClassDefId Val) {
+ assert(Val != getEmptyKey() && "Cannot hash the empty key!");
+ assert(Val != getTombstoneKey() && "Cannot hash the tombstone key!");
+
+ std::hash<ClassDefId::second_type> SecondHash;
+ return Val.first.getHashValue() + SecondHash(Val.second);
+ }
+
+ static bool isEqual(const ClassDefId &LHS, const ClassDefId &RHS) {
+ if (RHS == getEmptyKey())
+ return LHS == getEmptyKey();
+ if (RHS == getTombstoneKey())
+ return LHS == getTombstoneKey();
+ return LHS == RHS;
+ }
+};
+
+} // namespace llvm
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_SPECIAL_MEMBER_FUNCTIONS_H
diff --git a/linux-x64/clang/include/clang-tidy/darwin/AvoidSpinlockCheck.h b/linux-x64/clang/include/clang-tidy/darwin/AvoidSpinlockCheck.h
new file mode 100644
index 0000000..6ea10c5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/darwin/AvoidSpinlockCheck.h
@@ -0,0 +1,35 @@
+//===--- AvoidSpinlockCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_AVOIDSPINLOCKCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_AVOIDSPINLOCKCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace darwin {
+
+/// Finds usages of OSSpinlock, which is deprecated due to potential livelock
+/// problems.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/darwin-avoid-spinlock.html
+class AvoidSpinlockCheck : public ClangTidyCheck {
+ public:
+ AvoidSpinlockCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace darwin
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_AVOIDSPINLOCKCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/darwin/DispatchOnceNonstaticCheck.h b/linux-x64/clang/include/clang-tidy/darwin/DispatchOnceNonstaticCheck.h
new file mode 100644
index 0000000..be0719a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/darwin/DispatchOnceNonstaticCheck.h
@@ -0,0 +1,35 @@
+//===--- DispatchOnceNonstaticCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_DISPATCHONCENONSTATICCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_DISPATCHONCENONSTATICCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace darwin {
+
+/// Finds variables of type dispatch_once_t that do not have static or global
+/// storage duration, as required by the libdispatch documentation.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/darwin-dispatch-once-nonstatic.html
+class DispatchOnceNonstaticCheck : public ClangTidyCheck {
+public:
+ DispatchOnceNonstaticCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace darwin
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_DISPATCHONCENONSTATICCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
new file mode 100644
index 0000000..18dfe0c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
@@ -0,0 +1,34 @@
+//===--- DefaultArgumentsCallsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_DEFAULT_ARGUMENTS_CALLS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_DEFAULT_ARGUMENTS_CALLS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Default arguments are not allowed in called functions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-default-arguments-calls.html
+class DefaultArgumentsCallsCheck : public ClangTidyCheck {
+public:
+ DefaultArgumentsCallsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_DEFAULT_ARGUMENTS_CALLS_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
new file mode 100644
index 0000000..19f16e6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
@@ -0,0 +1,34 @@
+//===--- DefaultArgumentsDeclarationsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_DEFAULT_ARGUMENTS_DECLARATIONS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_DEFAULT_ARGUMENTS_DECLARATIONS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Default parameters are not allowed in declared functions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-default-parameters.html
+class DefaultArgumentsDeclarationsCheck : public ClangTidyCheck {
+public:
+ DefaultArgumentsDeclarationsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_DEFAULT_ARGUMENTS_DECLARATIONS_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/MultipleInheritanceCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/MultipleInheritanceCheck.h
new file mode 100644
index 0000000..801124c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/MultipleInheritanceCheck.h
@@ -0,0 +1,50 @@
+//===--- MultipleInheritanceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_MULTIPLE_INHERITANCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_MULTIPLE_INHERITANCE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Multiple implementation inheritance is discouraged.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-multiple-inheritance.html
+class MultipleInheritanceCheck : public ClangTidyCheck {
+public:
+ MultipleInheritanceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+ void onEndOfTranslationUnit() override { InterfaceMap.clear(); }
+
+private:
+ void addNodeToInterfaceMap(const CXXRecordDecl *Node, bool isInterface);
+ bool getInterfaceStatus(const CXXRecordDecl *Node, bool &isInterface) const;
+ bool isCurrentClassInterface(const CXXRecordDecl *Node) const;
+ bool isInterface(const CXXRecordDecl *Node);
+
+ // Contains the identity of each named CXXRecord as an interface. This is
+ // used to memoize lookup speeds and improve performance from O(N^2) to O(N),
+ // where N is the number of classes.
+ llvm::StringMap<bool> InterfaceMap;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_MULTIPLE_INHERITANCE_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/OverloadedOperatorCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/OverloadedOperatorCheck.h
new file mode 100644
index 0000000..122d5dc
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/OverloadedOperatorCheck.h
@@ -0,0 +1,34 @@
+//===--- OverloadedOperatorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_OVERLOADED_OPERATOR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_OVERLOADED_OPERATOR_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Overloading operators is disallowed by the Fuchsia coding standard.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-overloaded-operator.html
+class OverloadedOperatorCheck : public ClangTidyCheck {
+public:
+ OverloadedOperatorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_OVERLOADED_OPERATOR_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h
new file mode 100644
index 0000000..96f1a87
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h
@@ -0,0 +1,39 @@
+//===--- StaticallyConstructedObjectsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_STATICALLY_CONSTRUCTED_OBJECTS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_STATICALLY_CONSTRUCTED_OBJECTS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Constructing global, non-trivial objects with static storage is
+/// disallowed, unless the object is statically initialized with a constexpr
+/// constructor or has no explicit constructor.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-statically-constructed-objects.html
+class StaticallyConstructedObjectsCheck : public ClangTidyCheck {
+public:
+ StaticallyConstructedObjectsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_STATICALLY_CONSTRUCTED_OBJECTS_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/TrailingReturnCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/TrailingReturnCheck.h
new file mode 100644
index 0000000..398cabd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/TrailingReturnCheck.h
@@ -0,0 +1,39 @@
+//===--- TrailingReturnCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TRAILING_RETURN_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TRAILING_RETURN_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Functions that have trailing returns are disallowed, except for those
+/// using decltype specifiers and lambda with otherwise unutterable
+/// return types.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-trailing-return.html
+class TrailingReturnCheck : public ClangTidyCheck {
+public:
+ TrailingReturnCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TRAILING_RETURN_H
diff --git a/linux-x64/clang/include/clang-tidy/fuchsia/VirtualInheritanceCheck.h b/linux-x64/clang/include/clang-tidy/fuchsia/VirtualInheritanceCheck.h
new file mode 100644
index 0000000..88ff0dc
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/fuchsia/VirtualInheritanceCheck.h
@@ -0,0 +1,34 @@
+//===--- VirtualInheritanceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_VIRTUAL_INHERITANCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_VIRTUAL_INHERITANCE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace fuchsia {
+
+/// Defining classes with virtual inheritance is disallowed.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia-virtual-inheritance.html
+class VirtualInheritanceCheck : public ClangTidyCheck {
+ public:
+ VirtualInheritanceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace fuchsia
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_VIRTUAL_INHERITANCE_H
diff --git a/linux-x64/clang/include/clang-tidy/google/AvoidCStyleCastsCheck.h b/linux-x64/clang/include/clang-tidy/google/AvoidCStyleCastsCheck.h
new file mode 100644
index 0000000..075b5f0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/AvoidCStyleCastsCheck.h
@@ -0,0 +1,44 @@
+//===--- AvoidCStyleCastsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace readability {
+
+/// Finds usages of C-style casts.
+///
+/// https://google.github.io/styleguide/cppguide.html#Casting
+///
+/// Corresponding cpplint.py check name: 'readability/casting'.
+///
+/// This check is similar to `-Wold-style-cast`, but it suggests automated fixes
+/// in some cases. The reported locations should not be different from the
+/// ones generated by `-Wold-style-cast`.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-readability-casting.html
+class AvoidCStyleCastsCheck : public ClangTidyCheck {
+public:
+ AvoidCStyleCastsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDCSTYLECASTSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/AvoidNSObjectNewCheck.h b/linux-x64/clang/include/clang-tidy/google/AvoidNSObjectNewCheck.h
new file mode 100644
index 0000000..dccbf83
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/AvoidNSObjectNewCheck.h
@@ -0,0 +1,41 @@
+//===--- AvoidNSObjectNewCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDNSOBJECTNEWCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDNSOBJECTNEWCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace objc {
+
+/// This check finds Objective-C code that uses +new to create object instances,
+/// or overrides +new in classes. Both are forbidden by Google's Objective-C
+/// style guide.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-avoid-nsobject-new.html
+class AvoidNSObjectNewCheck : public ClangTidyCheck {
+public:
+ AvoidNSObjectNewCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDNSOBJECTNEWCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h b/linux-x64/clang/include/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h
new file mode 100644
index 0000000..4f5ec40
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h
@@ -0,0 +1,41 @@
+//===--- AvoidThrowingObjCExceptionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_AVOID_THROWING_EXCEPTION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_AVOID_THROWING_EXCEPTION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace objc {
+
+/// The check is to find usage of @throw invocation in Objective-C code.
+/// We should avoid using @throw for Objective-C exceptions according to
+/// the Google Objective-C Style Guide.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-objc-avoid-throwing-exception.html
+class AvoidThrowingObjCExceptionCheck : public ClangTidyCheck {
+ public:
+ AvoidThrowingObjCExceptionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_AVOID_THROWING_EXCEPTION_H
diff --git a/linux-x64/clang/include/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.h b/linux-x64/clang/include/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.h
new file mode 100644
index 0000000..a9989ee
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.h
@@ -0,0 +1,37 @@
+//===--- AvoidUnderscoreInGoogletestNameCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDUNDERSCOREINGOOGLETESTNAMECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDUNDERSCOREINGOOGLETESTNAMECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace readability {
+
+// Check for underscores in the names of googletest tests, per
+// https://github.com/google/googletest/blob/master/googletest/docs/faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-readability-avoid-underscore-in-googletest-name.html
+class AvoidUnderscoreInGoogletestNameCheck : public ClangTidyCheck {
+public:
+ using ClangTidyCheck::ClangTidyCheck;
+
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace readability
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_AVOIDUNDERSCOREINGOOGLETESTNAMECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/DefaultArgumentsCheck.h b/linux-x64/clang/include/clang-tidy/google/DefaultArgumentsCheck.h
new file mode 100644
index 0000000..089d463
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/DefaultArgumentsCheck.h
@@ -0,0 +1,36 @@
+//===--- DefaultArgumentsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_DEFAULT_ARGUMENTS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_DEFAULT_ARGUMENTS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+
+/// Checks that default parameters are not given for virtual methods.
+///
+/// See https://google.github.io/styleguide/cppguide.html#Default_Arguments
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-default-arguments.html
+class DefaultArgumentsCheck : public ClangTidyCheck {
+public:
+ DefaultArgumentsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_DEFAULT_ARGUMENTS_H
diff --git a/linux-x64/clang/include/clang-tidy/google/ExplicitConstructorCheck.h b/linux-x64/clang/include/clang-tidy/google/ExplicitConstructorCheck.h
new file mode 100644
index 0000000..573b0e1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/ExplicitConstructorCheck.h
@@ -0,0 +1,39 @@
+//===--- ExplicitConstructorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITCONSTRUCTORCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITCONSTRUCTORCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+
+/// Checks that all single-argument constructors are explicit.
+///
+/// See https://google.github.io/styleguide/cppguide.html#Explicit_Constructors
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-explicit-constructor.html
+class ExplicitConstructorCheck : public ClangTidyCheck {
+public:
+ ExplicitConstructorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITCONSTRUCTORCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/ExplicitMakePairCheck.h b/linux-x64/clang/include/clang-tidy/google/ExplicitMakePairCheck.h
new file mode 100644
index 0000000..56ca5b2
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/ExplicitMakePairCheck.h
@@ -0,0 +1,44 @@
+//===--- ExplicitMakePairCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITMAKEPAIRCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITMAKEPAIRCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace build {
+
+/// Check that `make_pair`'s template arguments are deduced.
+///
+/// G++ 4.6 in C++11 mode fails badly if `make_pair`'s template arguments are
+/// specified explicitly, and such use isn't intended in any case.
+///
+/// Corresponding cpplint.py check name: 'build/explicit_make_pair'.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-build-explicit-make-pair.html
+class ExplicitMakePairCheck : public ClangTidyCheck {
+public:
+ ExplicitMakePairCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace build
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITMAKEPAIRCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/FunctionNamingCheck.h b/linux-x64/clang/include/clang-tidy/google/FunctionNamingCheck.h
new file mode 100644
index 0000000..e646ec9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/FunctionNamingCheck.h
@@ -0,0 +1,45 @@
+//===--- FunctionNamingCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/StringRef.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace objc {
+
+/// Finds function names that do not conform to the recommendations of the
+/// Google Objective-C Style Guide. Function names should be in upper camel case
+/// including capitalized acronyms and initialisms. Functions that are not of
+/// static storage class must also have an appropriate prefix. The function
+/// `main` is an exception. Note that this check does not apply to Objective-C
+/// method or property declarations.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-objc-function-naming.html
+class FunctionNamingCheck : public ClangTidyCheck {
+public:
+ FunctionNamingCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_FUNCTION_NAMING_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/GlobalNamesInHeadersCheck.h b/linux-x64/clang/include/clang-tidy/google/GlobalNamesInHeadersCheck.h
new file mode 100644
index 0000000..801d362
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/GlobalNamesInHeadersCheck.h
@@ -0,0 +1,50 @@
+//===--- GlobalNamesInHeadersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_GLOBALNAMESINHEADERSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_GLOBALNAMESINHEADERSCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/FileExtensionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace readability {
+
+/// Flag global namespace pollution in header files.
+/// Right now it only triggers on using declarations and directives.
+///
+/// The check supports these options:
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (the filename extensions should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+///
+/// For extension-less header files, using an empty string or leaving an
+/// empty string between ";" if there are other filename extensions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-global-names-in-headers.html
+class GlobalNamesInHeadersCheck : public ClangTidyCheck {
+public:
+ GlobalNamesInHeadersCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string RawStringHeaderFileExtensions;
+ utils::FileExtensionsSet HeaderFileExtensions;
+};
+
+} // namespace readability
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_GLOBALNAMESINHEADERSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/GlobalVariableDeclarationCheck.h b/linux-x64/clang/include/clang-tidy/google/GlobalVariableDeclarationCheck.h
new file mode 100644
index 0000000..1c70783
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/GlobalVariableDeclarationCheck.h
@@ -0,0 +1,41 @@
+//===--- GlobalVariableDeclarationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_GLOBAL_VARIABLE_DECLARATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_GLOBAL_VARIABLE_DECLARATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace objc {
+
+/// The check for Objective-C global variables and constants naming convention.
+/// The declaration should follow the patterns of 'k[A-Z].*' (constants) or
+/// 'g[A-Z].*' (variables).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-objc-global-variable-declaration.html
+class GlobalVariableDeclarationCheck : public ClangTidyCheck {
+ public:
+ GlobalVariableDeclarationCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_GLOBAL_VARIABLE_DECLARATION_H
diff --git a/linux-x64/clang/include/clang-tidy/google/IntegerTypesCheck.h b/linux-x64/clang/include/clang-tidy/google/IntegerTypesCheck.h
new file mode 100644
index 0000000..5b2d2f5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/IntegerTypesCheck.h
@@ -0,0 +1,54 @@
+//===--- IntegerTypesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+#include <memory>
+
+namespace clang {
+
+class IdentifierTable;
+
+namespace tidy {
+namespace google {
+namespace runtime {
+
+/// Finds uses of `short`, `long` and `long long` and suggest replacing them
+/// with `u?intXX(_t)?`.
+///
+/// Corresponding cpplint.py check: 'runtime/int'.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-runtime-int.html
+class IntegerTypesCheck : public ClangTidyCheck {
+public:
+ IntegerTypesCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus && !LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Options) override;
+
+private:
+ const std::string UnsignedTypePrefix;
+ const std::string SignedTypePrefix;
+ const std::string TypeSuffix;
+
+ std::unique_ptr<IdentifierTable> IdentTable;
+};
+
+} // namespace runtime
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_INTEGERTYPESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/OverloadedUnaryAndCheck.h b/linux-x64/clang/include/clang-tidy/google/OverloadedUnaryAndCheck.h
new file mode 100644
index 0000000..7f51338
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/OverloadedUnaryAndCheck.h
@@ -0,0 +1,43 @@
+//===--- OverloadedUnaryAndCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OVERLOADEDUNARYANDCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OVERLOADEDUNARYANDCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace runtime {
+
+/// Finds overloads of unary `operator &`.
+///
+/// https://google.github.io/styleguide/cppguide.html#Operator_Overloading
+///
+/// Corresponding cpplint.py check name: 'runtime/operator'.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-runtime-operator.html
+class OverloadedUnaryAndCheck : public ClangTidyCheck {
+public:
+ OverloadedUnaryAndCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace runtime
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OVERLOADEDUNARYANDCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/TodoCommentCheck.h b/linux-x64/clang/include/clang-tidy/google/TodoCommentCheck.h
new file mode 100644
index 0000000..ee14997
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/TodoCommentCheck.h
@@ -0,0 +1,43 @@
+//===--- TodoCommentCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_TODOCOMMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_TODOCOMMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace readability {
+
+/// Finds TODO comments without a username or bug number.
+///
+/// Corresponding cpplint.py check: 'readability/todo'
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-readability-todo.html
+class TodoCommentCheck : public ClangTidyCheck {
+public:
+ TodoCommentCheck(StringRef Name, ClangTidyContext *Context);
+ ~TodoCommentCheck();
+
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+
+private:
+ class TodoCommentHandler;
+ std::unique_ptr<TodoCommentHandler> Handler;
+};
+
+} // namespace readability
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_TODOCOMMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h b/linux-x64/clang/include/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
new file mode 100644
index 0000000..2211021
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
@@ -0,0 +1,56 @@
+//===--- UnnamedNamespaceInHeaderCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UNNAMEDNAMESPACEINHEADERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UNNAMEDNAMESPACEINHEADERCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/FileExtensionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace build {
+
+/// Finds anonymous namespaces in headers.
+///
+/// The check supports these options:
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extensions should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+///
+/// For extension-less header files, using an empty string or leaving an
+/// empty string between ";" if there are other filename extensions.
+///
+/// https://google.github.io/styleguide/cppguide.html#Namespaces
+///
+/// Corresponding cpplint.py check name: 'build/namespaces'.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/google-build-namespaces.html
+class UnnamedNamespaceInHeaderCheck : public ClangTidyCheck {
+public:
+ UnnamedNamespaceInHeaderCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string RawStringHeaderFileExtensions;
+ utils::FileExtensionsSet HeaderFileExtensions;
+};
+
+} // namespace build
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UNNAMEDNAMESPACEINHEADERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/UpgradeGoogletestCaseCheck.h b/linux-x64/clang/include/clang-tidy/google/UpgradeGoogletestCaseCheck.h
new file mode 100644
index 0000000..a05bedf
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/UpgradeGoogletestCaseCheck.h
@@ -0,0 +1,43 @@
+//===--- UpgradeGoogletestCaseCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UPGRADEGOOGLETESTCASECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UPGRADEGOOGLETESTCASECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+
+/// Finds uses of deprecated Googletest APIs with names containing "case" and
+/// replaces them with equivalent names containing "suite".
+///
+/// For the user-facing documentation see:
+/// https://clang.llvm.org/extra/clang-tidy/checks/google-upgrade-googletest-case.html
+class UpgradeGoogletestCaseCheck : public ClangTidyCheck {
+public:
+ UpgradeGoogletestCaseCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ llvm::DenseSet<SourceLocation> MatchedTemplateLocations;
+};
+
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_UPGRADEGOOGLETESTCASECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/google/UsingNamespaceDirectiveCheck.h b/linux-x64/clang/include/clang-tidy/google/UsingNamespaceDirectiveCheck.h
new file mode 100644
index 0000000..c1b86c9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/google/UsingNamespaceDirectiveCheck.h
@@ -0,0 +1,56 @@
+//===--- UsingNamespaceDirectiveCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_USINGNAMESPACEDIRECTIVECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_USINGNAMESPACEDIRECTIVECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace google {
+namespace build {
+
+/// Finds using namespace directives.
+///
+/// https://google.github.io/styleguide/cppguide.html#Namespaces
+///
+/// The check implements the following rule of the Google C++ Style Guide:
+///
+/// You may not use a using-directive to make all names from a namespace
+/// available.
+///
+/// \code
+/// // Forbidden -- This pollutes the namespace.
+/// using namespace foo;
+/// \endcode
+///
+/// Corresponding cpplint.py check name: `build/namespaces`.
+///
+/// For the user-facing documentation see:
+/// https://clang.llvm.org/extra/clang-tidy/checks/google-build-using-namespace.html
+class UsingNamespaceDirectiveCheck : public ClangTidyCheck {
+public:
+ UsingNamespaceDirectiveCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ static bool isStdLiteralsNamespace(const NamespaceDecl *NS);
+};
+
+} // namespace build
+} // namespace google
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_USINGNAMESPACEDIRECTIVECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/hicpp/ExceptionBaseclassCheck.h b/linux-x64/clang/include/clang-tidy/hicpp/ExceptionBaseclassCheck.h
new file mode 100644
index 0000000..ab5e955
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/hicpp/ExceptionBaseclassCheck.h
@@ -0,0 +1,37 @@
+//===--- ExceptionBaseclassCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_EXCEPTION_BASECLASS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_EXCEPTION_BASECLASS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace hicpp {
+
+/// Check for thrown exceptions and enforce they are all derived from std::exception.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/hicpp-exception-baseclass.html
+class ExceptionBaseclassCheck : public ClangTidyCheck {
+public:
+ ExceptionBaseclassCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace hicpp
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_EXCEPTION_BASECLASS_H
diff --git a/linux-x64/clang/include/clang-tidy/hicpp/MultiwayPathsCoveredCheck.h b/linux-x64/clang/include/clang-tidy/hicpp/MultiwayPathsCoveredCheck.h
new file mode 100644
index 0000000..c9f9b9f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/hicpp/MultiwayPathsCoveredCheck.h
@@ -0,0 +1,48 @@
+//===--- MultiwayPathsCoveredCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_MULTIWAY_PATHS_COVERED_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_MULTIWAY_PATHS_COVERED_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace hicpp {
+
+/// Find occasions where not all codepaths are explicitly covered in code.
+/// This includes 'switch' without a 'default'-branch and 'if'-'else if'-chains
+/// without a final 'else'-branch.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/hicpp-multiway-paths-covered.html
+class MultiwayPathsCoveredCheck : public ClangTidyCheck {
+public:
+ MultiwayPathsCoveredCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ WarnOnMissingElse(Options.get("WarnOnMissingElse", false)) {}
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void handleSwitchWithDefault(const SwitchStmt *Switch, std::size_t CaseCount);
+ void handleSwitchWithoutDefault(
+ const SwitchStmt *Switch, std::size_t CaseCount,
+ const ast_matchers::MatchFinder::MatchResult &Result);
+ /// This option can be configured to warn on missing 'else' branches in an
+ /// 'if-else if' chain. The default is false because this option might be
+ /// noisy on some code bases.
+ const bool WarnOnMissingElse;
+};
+
+} // namespace hicpp
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_MULTIWAY_PATHS_COVERED_H
diff --git a/linux-x64/clang/include/clang-tidy/hicpp/NoAssemblerCheck.h b/linux-x64/clang/include/clang-tidy/hicpp/NoAssemblerCheck.h
new file mode 100644
index 0000000..a613bc4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/hicpp/NoAssemblerCheck.h
@@ -0,0 +1,34 @@
+//===--- NoAssemblerCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NO_ASSEMBLER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NO_ASSEMBLER_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace hicpp {
+
+/// Find assembler statements. No fix is offered.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/hicpp-no-assembler.html
+class NoAssemblerCheck : public ClangTidyCheck {
+public:
+ NoAssemblerCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace hicpp
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NO_ASSEMBLER_H
diff --git a/linux-x64/clang/include/clang-tidy/hicpp/SignedBitwiseCheck.h b/linux-x64/clang/include/clang-tidy/hicpp/SignedBitwiseCheck.h
new file mode 100644
index 0000000..3510fbd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/hicpp/SignedBitwiseCheck.h
@@ -0,0 +1,38 @@
+//===--- SignedBitwiseCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_SIGNED_BITWISE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_SIGNED_BITWISE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace hicpp {
+
+/// This check implements the rule 5.6.1 of the HICPP Standard, which disallows
+/// bitwise operations on signed integer types.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/hicpp-signed-bitwise.html
+class SignedBitwiseCheck : public ClangTidyCheck {
+public:
+ SignedBitwiseCheck(StringRef Name, ClangTidyContext *Context);
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Options) override;
+
+private:
+ bool IgnorePositiveIntegerLiterals;
+};
+
+} // namespace hicpp
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_SIGNED_BITWISE_H
diff --git a/linux-x64/clang/include/clang-tidy/linuxkernel/MustCheckErrsCheck.h b/linux-x64/clang/include/clang-tidy/linuxkernel/MustCheckErrsCheck.h
new file mode 100644
index 0000000..17e8d1b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/linuxkernel/MustCheckErrsCheck.h
@@ -0,0 +1,43 @@
+//===--- MustCheckErrsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LINUXKERNEL_MUSTCHECKERRSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LINUXKERNEL_MUSTCHECKERRSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace linuxkernel {
+
+/// Checks Linux kernel code to see if it uses the results from the functions in
+/// linux/err.h. Also checks to see if code uses the results from functions that
+/// directly return a value from one of these error functions.
+///
+/// This is important in the Linux kernel because ERR_PTR, PTR_ERR, IS_ERR,
+/// IS_ERR_OR_NULL, ERR_CAST, and PTR_ERR_OR_ZERO return values must be checked,
+/// since positive pointers and negative error codes are being used in the same
+/// context. These functions are marked with
+/// __attribute__((warn_unused_result)), but some kernel versions do not have
+/// this warning enabled for clang.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/linuxkernel-must-use-errs.html
+class MustCheckErrsCheck : public ClangTidyCheck {
+public:
+ MustCheckErrsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace linuxkernel
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LINUXKERNEL_MUSTCHECKERRSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvm/HeaderGuardCheck.h b/linux-x64/clang/include/clang-tidy/llvm/HeaderGuardCheck.h
new file mode 100644
index 0000000..23f12fd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvm/HeaderGuardCheck.h
@@ -0,0 +1,40 @@
+//===--- HeaderGuardCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
+
+#include "../utils/HeaderGuard.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_check {
+
+/// Finds and fixes header guards that do not adhere to LLVM style.
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-header-guard.html
+/// The check supports these options:
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extension should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+///
+/// For extension-less header files, using an empty string or leaving an
+/// empty string between ";" if there are other filename extensions.
+class LLVMHeaderGuardCheck : public utils::HeaderGuardCheck {
+public:
+ LLVMHeaderGuardCheck(StringRef Name, ClangTidyContext *Context);
+
+ bool shouldSuggestEndifComment(StringRef Filename) override { return false; }
+ std::string getHeaderGuard(StringRef Filename, StringRef OldGuard) override;
+};
+
+} // namespace llvm_check
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvm/IncludeOrderCheck.h b/linux-x64/clang/include/clang-tidy/llvm/IncludeOrderCheck.h
new file mode 100644
index 0000000..930fa90
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvm/IncludeOrderCheck.h
@@ -0,0 +1,33 @@
+//===--- IncludeOrderCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_INCLUDEORDERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_INCLUDEORDERCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_check {
+
+/// Checks the correct order of `#includes`.
+///
+/// See http://llvm.org/docs/CodingStandards.html#include-style
+class IncludeOrderCheck : public ClangTidyCheck {
+public:
+ IncludeOrderCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace llvm_check
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_INCLUDEORDERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.h b/linux-x64/clang/include/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.h
new file mode 100644
index 0000000..723475b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.h
@@ -0,0 +1,67 @@
+//===--- PreferIsaOrDynCastInConditionalsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PREFERISAORDYNCASTINCONDITIONALSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PREFERISAORDYNCASTINCONDITIONALSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_check {
+
+/// Looks at conditionals and finds and replaces cases of ``cast<>``, which will
+/// assert rather than return a null pointer, and ``dyn_cast<>`` where
+/// the return value is not captured. Additionally, finds and replaces cases that match the
+/// pattern ``var && isa<X>(var)``, where ``var`` is evaluated twice.
+///
+/// Finds cases like these:
+/// \code
+/// if (auto x = cast<X>(y)) {}
+/// // is replaced by:
+/// if (auto x = dyn_cast<X>(y)) {}
+///
+/// if (cast<X>(y)) {}
+/// // is replaced by:
+/// if (isa<X>(y)) {}
+///
+/// if (dyn_cast<X>(y)) {}
+/// // is replaced by:
+/// if (isa<X>(y)) {}
+///
+/// if (var && isa<T>(var)) {}
+/// // is replaced by:
+/// if (isa_and_nonnull<T>(var.foo())) {}
+/// \endcode
+///
+/// // Other cases are ignored, e.g.:
+/// \code
+/// if (auto f = cast<Z>(y)->foo()) {}
+/// if (cast<Z>(y)->foo()) {}
+/// if (X.cast(y)) {}
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-prefer-isa-or-dyn-cast-in-conditionals.html
+class PreferIsaOrDynCastInConditionalsCheck : public ClangTidyCheck {
+public:
+ PreferIsaOrDynCastInConditionalsCheck(StringRef Name,
+ ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace llvm_check
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PREFERISAORDYNCASTINCONDITIONALSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.h b/linux-x64/clang/include/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.h
new file mode 100644
index 0000000..80eaca1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.h
@@ -0,0 +1,36 @@
+//===--- PreferRegisterOverUnsignedCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PREFERREGISTEROVERUNSIGNEDCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PREFERREGISTEROVERUNSIGNEDCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_check {
+
+/// Historically, LLVM has used `unsigned` to represent registers. Since then
+/// a `Register` object has been introduced for improved type-safety and make
+/// the code more explicit.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-prefer-register-over-unsigned.html
+class PreferRegisterOverUnsignedCheck : public ClangTidyCheck {
+public:
+ PreferRegisterOverUnsignedCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace llvm_check
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PREFERREGISTEROVERUNSIGNEDCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvm/TwineLocalCheck.h b/linux-x64/clang/include/clang-tidy/llvm/TwineLocalCheck.h
new file mode 100644
index 0000000..e635626
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvm/TwineLocalCheck.h
@@ -0,0 +1,32 @@
+//===--- TwineLocalCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TWINELOCALCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TWINELOCALCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_check {
+
+/// Looks for local `Twine` variables which are prone to use after frees and
+/// should be generally avoided.
+class TwineLocalCheck : public ClangTidyCheck {
+public:
+ TwineLocalCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace llvm_check
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TWINELOCALCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvmlibc/CalleeNamespaceCheck.h b/linux-x64/clang/include/clang-tidy/llvmlibc/CalleeNamespaceCheck.h
new file mode 100644
index 0000000..b35c601
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvmlibc/CalleeNamespaceCheck.h
@@ -0,0 +1,38 @@
+//===-- CalleeNamespaceCheck.h ----------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_CALLEENAMESPACECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_CALLEENAMESPACECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_libc {
+
+/// Checks all calls resolve to functions within __llvm_libc namespace.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/llvmlibc-callee-namespace.html
+class CalleeNamespaceCheck : public ClangTidyCheck {
+public:
+ CalleeNamespaceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace llvm_libc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_CALLEENAMESPACECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.h b/linux-x64/clang/include/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.h
new file mode 100644
index 0000000..dcd29b3
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.h
@@ -0,0 +1,38 @@
+//===--- ImplementationInNamespaceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_IMPLEMENTATIONINNAMESPACECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_IMPLEMENTATIONINNAMESPACECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_libc {
+
+/// Checks all llvm-libc implementation is within the correct namespace.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/llvmlibc-implementation-in-namespace.html
+class ImplementationInNamespaceCheck : public ClangTidyCheck {
+public:
+ ImplementationInNamespaceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace llvm_libc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_IMPLEMENTATIONINNAMESPACECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.h b/linux-x64/clang/include/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.h
new file mode 100644
index 0000000..9eead7a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.h
@@ -0,0 +1,37 @@
+//===--- RestrictSystemLibcHeadersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_RESTRICTSYSTEMLIBCHEADERSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_RESTRICTSYSTEMLIBCHEADERSCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../portability/RestrictSystemIncludesCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace llvm_libc {
+
+/// Warns of accidental inclusions of system libc headers that aren't
+/// compiler provided.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/llvmlibc-restrict-system-libc-headers.html
+class RestrictSystemLibcHeadersCheck
+ : public portability::RestrictSystemIncludesCheck {
+public:
+ RestrictSystemLibcHeadersCheck(StringRef Name, ClangTidyContext *Context)
+ : portability::RestrictSystemIncludesCheck(Name, Context, "-*") {}
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace llvm_libc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVMLIBC_RESTRICTSYSTEMLIBCHEADERSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/DefinitionsInHeadersCheck.h b/linux-x64/clang/include/clang-tidy/misc/DefinitionsInHeadersCheck.h
new file mode 100644
index 0000000..239b7d1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/DefinitionsInHeadersCheck.h
@@ -0,0 +1,54 @@
+//===--- DefinitionsInHeadersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_DEFINITIONS_IN_HEADERS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_DEFINITIONS_IN_HEADERS_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/FileExtensionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Finds non-extern non-inline function and variable definitions in header
+/// files, which can lead to potential ODR violations.
+///
+/// The check supports these options:
+/// - `UseHeaderFileExtension`: Whether to use file extension to distinguish
+/// header files. True by default.
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extension should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+///
+/// For extension-less header files, using an empty string or leaving an
+/// empty string between ";" if there are other filename extensions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-definitions-in-headers.html
+class DefinitionsInHeadersCheck : public ClangTidyCheck {
+public:
+ DefinitionsInHeadersCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool UseHeaderFileExtension;
+ const std::string RawStringHeaderFileExtensions;
+ utils::FileExtensionsSet HeaderFileExtensions;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_DEFINITIONS_IN_HEADERS_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/MisplacedConstCheck.h b/linux-x64/clang/include/clang-tidy/misc/MisplacedConstCheck.h
new file mode 100644
index 0000000..55803b4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/MisplacedConstCheck.h
@@ -0,0 +1,35 @@
+//===--- MisplacedConstCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISPLACED_CONST_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISPLACED_CONST_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// This check diagnoses when a const qualifier is applied to a typedef to a
+/// pointer type rather than to the pointee.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-misplaced-const.html
+class MisplacedConstCheck : public ClangTidyCheck {
+public:
+ MisplacedConstCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MISPLACED_CONST_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/NewDeleteOverloadsCheck.h b/linux-x64/clang/include/clang-tidy/misc/NewDeleteOverloadsCheck.h
new file mode 100644
index 0000000..a636d1f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/NewDeleteOverloadsCheck.h
@@ -0,0 +1,40 @@
+//===--- NewDeleteOverloadsCheck.h - clang-tidy----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NEWDELETEOVERLOADS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NEWDELETEOVERLOADS_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/SmallVector.h"
+#include <map>
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+class NewDeleteOverloadsCheck : public ClangTidyCheck {
+ std::map<const clang::CXXRecordDecl *,
+ llvm::SmallVector<const clang::FunctionDecl *, 4>>
+ Overloads;
+
+public:
+ NewDeleteOverloadsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NEWDELETEOVERLOADS_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/NoRecursionCheck.h b/linux-x64/clang/include/clang-tidy/misc/NoRecursionCheck.h
new file mode 100644
index 0000000..c3a0d3e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/NoRecursionCheck.h
@@ -0,0 +1,42 @@
+//===--- NoRecursionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NORECURSIONCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NORECURSIONCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+
+class CallGraphNode;
+
+namespace tidy {
+namespace misc {
+
+/// Finds strongly connected functions (by analyzing call graph for SCC's
+/// that are loops), diagnoses each function in the cycle,
+/// and displays one example of possible call graph loop (recursion).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-no-recursion.html
+class NoRecursionCheck : public ClangTidyCheck {
+public:
+ NoRecursionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void handleSCC(ArrayRef<CallGraphNode *> SCC);
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NORECURSIONCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/NonCopyableObjects.h b/linux-x64/clang/include/clang-tidy/misc/NonCopyableObjects.h
new file mode 100644
index 0000000..6529fdd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/NonCopyableObjects.h
@@ -0,0 +1,32 @@
+//===--- NonCopyableObjects.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// The check flags dereferences and non-pointer declarations of objects that
+/// are not meant to be passed by value, such as C FILE objects.
+class NonCopyableObjectsCheck : public ClangTidyCheck {
+public:
+ NonCopyableObjectsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h b/linux-x64/clang/include/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h
new file mode 100644
index 0000000..b50872c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.h
@@ -0,0 +1,49 @@
+//===--- NonPrivateMemberVariablesInClassesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONPRIVATEMEMBERVARIABLESINCLASSESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONPRIVATEMEMBERVARIABLESINCLASSESCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// This checker finds classes that not only contain the data
+/// (non-static member variables), but also have logic (non-static member
+/// functions), and diagnoses all member variables that have any other scope
+/// other than `private`. They should be made `private`, and manipulated
+/// exclusively via the member functions.
+///
+/// Optionally, classes with all member variables being `public` could be
+/// ignored and optionally all `public` member variables could be ignored.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-non-private-member-variables-in-classes.html
+class NonPrivateMemberVariablesInClassesCheck : public ClangTidyCheck {
+public:
+ NonPrivateMemberVariablesInClassesCheck(StringRef Name,
+ ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool IgnoreClassesWithAllMemberVariablesBeingPublic;
+ const bool IgnorePublicMemberVariables;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONPRIVATEMEMBERVARIABLESINCLASSESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/RedundantExpressionCheck.h b/linux-x64/clang/include/clang-tidy/misc/RedundantExpressionCheck.h
new file mode 100644
index 0000000..d07e2b7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/RedundantExpressionCheck.h
@@ -0,0 +1,40 @@
+//===--- RedundantExpressionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_REDUNDANT_EXPRESSION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_REDUNDANT_EXPRESSION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// The checker detects expressions that are redundant, because they contain
+/// ineffective, useless parts.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-redundant-expression.html
+class RedundantExpressionCheck : public ClangTidyCheck {
+public:
+ RedundantExpressionCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void checkArithmeticExpr(const ast_matchers::MatchFinder::MatchResult &R);
+ void checkBitwiseExpr(const ast_matchers::MatchFinder::MatchResult &R);
+ void checkRelationalExpr(const ast_matchers::MatchFinder::MatchResult &R);
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_REDUNDANT_EXPRESSION_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/StaticAssertCheck.h b/linux-x64/clang/include/clang-tidy/misc/StaticAssertCheck.h
new file mode 100644
index 0000000..0168d1f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/StaticAssertCheck.h
@@ -0,0 +1,43 @@
+//===--- StaticAssertCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STATICASSERTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STATICASSERTCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Replaces `assert()` with `static_assert()` if the condition is evaluatable
+/// at compile time.
+///
+/// The condition of `static_assert()` is evaluated at compile time which is
+/// safer and more efficient.
+class StaticAssertCheck : public ClangTidyCheck {
+public:
+ StaticAssertCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11 || LangOpts.C11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ SourceLocation getLastParenLoc(const ASTContext *ASTCtx,
+ SourceLocation AssertLoc);
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_STATICASSERTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h b/linux-x64/clang/include/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
new file mode 100644
index 0000000..3018fda
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h
@@ -0,0 +1,56 @@
+//===--- ThrowByValueCatchByReferenceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_THROW_BY_VALUE_CATCH_BY_REFERENCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_THROW_BY_VALUE_CATCH_BY_REFERENCE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+///checks for locations that do not throw by value
+// or catch by reference.
+// The check is C++ only. It checks that all throw locations
+// throw by value and not by pointer. Additionally it
+// contains an option ("CheckThrowTemporaries", default value "true") that
+// checks that thrown objects are anonymous temporaries. It is also
+// acceptable for this check to throw string literals.
+// This test checks that exceptions are caught by reference
+// and not by value or pointer. It will not warn when catching
+// pointer to char, wchar_t, char16_t or char32_t. This is
+// due to not warning on throwing string literals.
+class ThrowByValueCatchByReferenceCheck : public ClangTidyCheck {
+public:
+ ThrowByValueCatchByReferenceCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void diagnoseThrowLocations(const CXXThrowExpr *throwExpr);
+ void diagnoseCatchLocations(const CXXCatchStmt *catchStmt,
+ ASTContext &context);
+ bool isFunctionParameter(const DeclRefExpr *declRefExpr);
+ bool isCatchVariable(const DeclRefExpr *declRefExpr);
+ bool isFunctionOrCatchVar(const DeclRefExpr *declRefExpr);
+ const bool CheckAnonymousTemporaries;
+ const bool WarnOnLargeObject;
+ const uint64_t MaxSizeOptions; // The raw value read from the options.
+ uint64_t MaxSize; // No `const` because we have to set it in two steps.
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_THROW_BY_VALUE_CATCH_BY_REFERENCE_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/UnconventionalAssignOperatorCheck.h b/linux-x64/clang/include/clang-tidy/misc/UnconventionalAssignOperatorCheck.h
new file mode 100644
index 0000000..829c91d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/UnconventionalAssignOperatorCheck.h
@@ -0,0 +1,44 @@
+//===--- UnconventionalAssignOperatorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_ASSIGNOPERATORSIGNATURECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_ASSIGNOPERATORSIGNATURECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Finds declarations of assignment operators with the wrong return and/or
+/// argument types and definitions with good return type but wrong return
+/// statements.
+///
+/// * The return type must be `Class&`.
+/// * Works with move-assign and assign by value.
+/// * Private and deleted operators are ignored.
+/// * The operator must always return ``*this``.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-unconventional-assign-operator.html
+class UnconventionalAssignOperatorCheck : public ClangTidyCheck {
+public:
+ UnconventionalAssignOperatorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_ASSIGNOPERATORSIGNATURECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/UniqueptrResetReleaseCheck.h b/linux-x64/clang/include/clang-tidy/misc/UniqueptrResetReleaseCheck.h
new file mode 100644
index 0000000..8a08532
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/UniqueptrResetReleaseCheck.h
@@ -0,0 +1,48 @@
+//===--- UniqueptrResetReleaseCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNIQUEPTRRESETRELEASECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNIQUEPTRRESETRELEASECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Find and replace `unique_ptr::reset(release())` with `std::move()`.
+///
+/// Example:
+///
+/// \code
+/// std::unique_ptr<Foo> x, y;
+/// x.reset(y.release()); -> x = std::move(y);
+/// \endcode
+///
+/// If `y` is already rvalue, `std::move()` is not added. `x` and `y` can also
+/// be `std::unique_ptr<Foo>*`.
+class UniqueptrResetReleaseCheck : public ClangTidyCheck {
+public:
+ UniqueptrResetReleaseCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ // Only register the matchers for C++11; the functionality currently does
+ // not
+ // provide any benefit to other languages, despite being benign.
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNIQUEPTRRESETRELEASECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/UnusedAliasDeclsCheck.h b/linux-x64/clang/include/clang-tidy/misc/UnusedAliasDeclsCheck.h
new file mode 100644
index 0000000..32e5e15
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/UnusedAliasDeclsCheck.h
@@ -0,0 +1,39 @@
+//===--- UnusedAliasDeclsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_ALIAS_DECLS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_ALIAS_DECLS_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/DenseMap.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Finds unused namespace alias declarations.
+class UnusedAliasDeclsCheck : public ClangTidyCheck {
+public:
+ UnusedAliasDeclsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+
+private:
+ llvm::DenseMap<const NamedDecl *, CharSourceRange> FoundDecls;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_ALIAS_DECLS_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/UnusedParametersCheck.h b/linux-x64/clang/include/clang-tidy/misc/UnusedParametersCheck.h
new file mode 100644
index 0000000..7e9b8c9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/UnusedParametersCheck.h
@@ -0,0 +1,42 @@
+//===--- UnusedParametersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_PARAMETERS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_PARAMETERS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Finds unused parameters and fixes them, so that `-Wunused-parameter` can be
+/// turned on.
+class UnusedParametersCheck : public ClangTidyCheck {
+public:
+ UnusedParametersCheck(StringRef Name, ClangTidyContext *Context);
+ ~UnusedParametersCheck();
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const bool StrictMode;
+ class IndexerVisitor;
+ std::unique_ptr<IndexerVisitor> Indexer;
+
+ void
+ warnOnUnusedParameter(const ast_matchers::MatchFinder::MatchResult &Result,
+ const FunctionDecl *Function, unsigned ParamIndex);
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_PARAMETERS_H
diff --git a/linux-x64/clang/include/clang-tidy/misc/UnusedUsingDeclsCheck.h b/linux-x64/clang/include/clang-tidy/misc/UnusedUsingDeclsCheck.h
new file mode 100644
index 0000000..2e46f3c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/misc/UnusedUsingDeclsCheck.h
@@ -0,0 +1,57 @@
+//===--- UnusedUsingDeclsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_USING_DECLS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_USING_DECLS_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace misc {
+
+/// Finds unused using declarations.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/misc-unused-using-decls.html
+class UnusedUsingDeclsCheck : public ClangTidyCheck {
+public:
+ UnusedUsingDeclsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+
+private:
+ void removeFromFoundDecls(const Decl *D);
+
+ struct UsingDeclContext {
+ explicit UsingDeclContext(const UsingDecl *FoundUsingDecl)
+ : FoundUsingDecl(FoundUsingDecl), IsUsed(false) {}
+ // A set saves all UsingShadowDecls introduced by a UsingDecl. A UsingDecl
+ // can introduce multiple UsingShadowDecls in some cases (such as
+ // overloaded functions).
+ llvm::SmallPtrSet<const Decl *, 4> UsingTargetDecls;
+ // The original UsingDecl.
+ const UsingDecl *FoundUsingDecl;
+ // The source range of the UsingDecl.
+ CharSourceRange UsingDeclRange;
+ // Whether the UsingDecl is used.
+ bool IsUsed;
+ };
+
+ std::vector<UsingDeclContext> Contexts;
+};
+
+} // namespace misc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_UNUSED_USING_DECLS_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/AvoidBindCheck.h b/linux-x64/clang/include/clang-tidy/modernize/AvoidBindCheck.h
new file mode 100644
index 0000000..d52c33a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/AvoidBindCheck.h
@@ -0,0 +1,41 @@
+//===--- AvoidBindCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOID_BIND_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOID_BIND_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replace simple uses of std::bind with a lambda.
+///
+/// FIXME: Add support for function references and member function references.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-std-bind.html
+class AvoidBindCheck : public ClangTidyCheck {
+public:
+ AvoidBindCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus14;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ bool PermissiveParameterList = false;
+};
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOID_BIND_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/AvoidCArraysCheck.h b/linux-x64/clang/include/clang-tidy/modernize/AvoidCArraysCheck.h
new file mode 100644
index 0000000..2b2a645
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/AvoidCArraysCheck.h
@@ -0,0 +1,37 @@
+//===--- AvoidCArraysCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDCARRAYSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDCARRAYSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Find C-style array types and recommend to use std::array<> / std::vector<>.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-c-arrays.html
+class AvoidCArraysCheck : public ClangTidyCheck {
+public:
+ AvoidCArraysCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDCARRAYSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/ConcatNestedNamespacesCheck.h b/linux-x64/clang/include/clang-tidy/modernize/ConcatNestedNamespacesCheck.h
new file mode 100644
index 0000000..9dfaee2
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/ConcatNestedNamespacesCheck.h
@@ -0,0 +1,43 @@
+//===--- ConcatNestedNamespacesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_CONCATNESTEDNAMESPACESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_CONCATNESTEDNAMESPACESCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+class ConcatNestedNamespacesCheck : public ClangTidyCheck {
+public:
+ ConcatNestedNamespacesCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus17;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ using NamespaceContextVec = llvm::SmallVector<const NamespaceDecl *, 6>;
+ using NamespaceString = llvm::SmallString<40>;
+
+ void reportDiagnostic(const SourceRange &FrontReplacement,
+ const SourceRange &BackReplacement);
+ NamespaceString concatNamespaces();
+ NamespaceContextVec Namespaces;
+};
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_CONCATNESTEDNAMESPACESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/DeprecatedHeadersCheck.h b/linux-x64/clang/include/clang-tidy/modernize/DeprecatedHeadersCheck.h
new file mode 100644
index 0000000..113b0ca
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/DeprecatedHeadersCheck.h
@@ -0,0 +1,50 @@
+//===--- DeprecatedHeadersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// This check replaces deprecated C library headers with their C++ STL
+/// alternatives.
+///
+/// Before:
+/// ~~~{.cpp}
+/// #include <header.h>
+/// ~~~
+///
+/// After:
+/// ~~~{.cpp}
+/// #include <cheader>
+/// ~~~
+///
+/// Example: ``<stdio.h> => <cstdio>``
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-headers.html
+class DeprecatedHeadersCheck : public ClangTidyCheck {
+public:
+ DeprecatedHeadersCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h b/linux-x64/clang/include/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h
new file mode 100644
index 0000000..df7d3f0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h
@@ -0,0 +1,38 @@
+//===--- DeprecatedIosBaseAliasesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_DEPRECATEDIOSBASEALIASESCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_DEPRECATEDIOSBASEALIASESCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// This check warns the uses of the deprecated member types of ``std::ios_base``
+/// and replaces those that have a non-deprecated equivalent.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-ios-base-aliases.html
+class DeprecatedIosBaseAliasesCheck : public ClangTidyCheck {
+public:
+ DeprecatedIosBaseAliasesCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_DEPRECATEDIOSBASEALIASESCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/LoopConvertCheck.h b/linux-x64/clang/include/clang-tidy/modernize/LoopConvertCheck.h
new file mode 100644
index 0000000..b1eda48
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/LoopConvertCheck.h
@@ -0,0 +1,92 @@
+//===--- LoopConvertCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+#include "LoopConvertUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+class LoopConvertCheck : public ClangTidyCheck {
+public:
+ LoopConvertCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ struct RangeDescriptor {
+ RangeDescriptor();
+ bool ContainerNeedsDereference;
+ bool DerefByConstRef;
+ bool DerefByValue;
+ std::string ContainerString;
+ QualType ElemType;
+ bool NeedsReverseCall;
+ };
+
+ void getAliasRange(SourceManager &SM, SourceRange &DeclRange);
+
+ void doConversion(ASTContext *Context, const VarDecl *IndexVar,
+ const ValueDecl *MaybeContainer, const UsageResult &Usages,
+ const DeclStmt *AliasDecl, bool AliasUseRequired,
+ bool AliasFromForInit, const ForStmt *Loop,
+ RangeDescriptor Descriptor);
+
+ StringRef getContainerString(ASTContext *Context, const ForStmt *Loop,
+ const Expr *ContainerExpr);
+
+ void getArrayLoopQualifiers(ASTContext *Context,
+ const ast_matchers::BoundNodes &Nodes,
+ const Expr *ContainerExpr,
+ const UsageResult &Usages,
+ RangeDescriptor &Descriptor);
+
+ void getIteratorLoopQualifiers(ASTContext *Context,
+ const ast_matchers::BoundNodes &Nodes,
+ RangeDescriptor &Descriptor);
+
+ void determineRangeDescriptor(ASTContext *Context,
+ const ast_matchers::BoundNodes &Nodes,
+ const ForStmt *Loop, LoopFixerKind FixerKind,
+ const Expr *ContainerExpr,
+ const UsageResult &Usages,
+ RangeDescriptor &Descriptor);
+
+ bool isConvertible(ASTContext *Context, const ast_matchers::BoundNodes &Nodes,
+ const ForStmt *Loop, LoopFixerKind FixerKind);
+
+ StringRef getReverseFunction() const;
+ StringRef getReverseHeader() const;
+
+ std::unique_ptr<TUTrackingInfo> TUInfo;
+ const unsigned long long MaxCopySize;
+ const Confidence::Level MinConfidence;
+ const VariableNamer::NamingStyle NamingStyle;
+ utils::IncludeInserter Inserter;
+ bool UseReverseRanges;
+ const bool UseCxx20IfAvailable;
+ std::string ReverseFunction;
+ std::string ReverseHeader;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/LoopConvertUtils.h b/linux-x64/clang/include/clang-tidy/modernize/LoopConvertUtils.h
new file mode 100644
index 0000000..7dd2c8e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/LoopConvertUtils.h
@@ -0,0 +1,471 @@
+//===--- LoopConvertUtils.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_UTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_UTILS_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Basic/SourceLocation.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include <algorithm>
+#include <memory>
+#include <string>
+#include <utility>
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+enum LoopFixerKind {
+ LFK_Array,
+ LFK_Iterator,
+ LFK_ReverseIterator,
+ LFK_PseudoArray
+};
+
+/// A map used to walk the AST in reverse: maps child Stmt to parent Stmt.
+typedef llvm::DenseMap<const clang::Stmt *, const clang::Stmt *> StmtParentMap;
+
+/// A map used to walk the AST in reverse:
+/// maps VarDecl to the to parent DeclStmt.
+typedef llvm::DenseMap<const clang::VarDecl *, const clang::DeclStmt *>
+ DeclParentMap;
+
+/// A map used to track which variables have been removed by a refactoring pass.
+/// It maps the parent ForStmt to the removed index variable's VarDecl.
+typedef llvm::DenseMap<const clang::ForStmt *, const clang::VarDecl *>
+ ReplacedVarsMap;
+
+/// A map used to remember the variable names generated in a Stmt
+typedef llvm::DenseMap<const clang::Stmt *, std::string>
+ StmtGeneratedVarNameMap;
+
+/// A vector used to store the AST subtrees of an Expr.
+typedef llvm::SmallVector<const clang::Expr *, 16> ComponentVector;
+
+/// Class used build the reverse AST properties needed to detect
+/// name conflicts and free variables.
+class StmtAncestorASTVisitor
+ : public clang::RecursiveASTVisitor<StmtAncestorASTVisitor> {
+public:
+ StmtAncestorASTVisitor() { StmtStack.push_back(nullptr); }
+
+ /// Run the analysis on the AST.
+ ///
+ /// In case we're running this analysis multiple times, don't repeat the work.
+ void gatherAncestors(ASTContext &Ctx) {
+ if (StmtAncestors.empty())
+ TraverseAST(Ctx);
+ }
+
+ /// Accessor for StmtAncestors.
+ const StmtParentMap &getStmtToParentStmtMap() { return StmtAncestors; }
+
+ /// Accessor for DeclParents.
+ const DeclParentMap &getDeclToParentStmtMap() { return DeclParents; }
+
+ friend class clang::RecursiveASTVisitor<StmtAncestorASTVisitor>;
+
+private:
+ StmtParentMap StmtAncestors;
+ DeclParentMap DeclParents;
+ llvm::SmallVector<const clang::Stmt *, 16> StmtStack;
+
+ bool TraverseStmt(clang::Stmt *Statement);
+ bool VisitDeclStmt(clang::DeclStmt *Statement);
+};
+
+/// Class used to find the variables and member expressions on which an
+/// arbitrary expression depends.
+class ComponentFinderASTVisitor
+ : public clang::RecursiveASTVisitor<ComponentFinderASTVisitor> {
+public:
+ ComponentFinderASTVisitor() = default;
+
+ /// Find the components of an expression and place them in a ComponentVector.
+ void findExprComponents(const clang::Expr *SourceExpr) {
+ TraverseStmt(const_cast<clang::Expr *>(SourceExpr));
+ }
+
+ /// Accessor for Components.
+ const ComponentVector &getComponents() { return Components; }
+
+ friend class clang::RecursiveASTVisitor<ComponentFinderASTVisitor>;
+
+private:
+ ComponentVector Components;
+
+ bool VisitDeclRefExpr(clang::DeclRefExpr *E);
+ bool VisitMemberExpr(clang::MemberExpr *Member);
+};
+
+/// Class used to determine if an expression is dependent on a variable declared
+/// inside of the loop where it would be used.
+class DependencyFinderASTVisitor
+ : public clang::RecursiveASTVisitor<DependencyFinderASTVisitor> {
+public:
+ DependencyFinderASTVisitor(const StmtParentMap *StmtParents,
+ const DeclParentMap *DeclParents,
+ const ReplacedVarsMap *ReplacedVars,
+ const clang::Stmt *ContainingStmt)
+ : StmtParents(StmtParents), DeclParents(DeclParents),
+ ContainingStmt(ContainingStmt), ReplacedVars(ReplacedVars) {}
+
+ /// Run the analysis on Body, and return true iff the expression
+ /// depends on some variable declared within ContainingStmt.
+ ///
+ /// This is intended to protect against hoisting the container expression
+ /// outside of an inner context if part of that expression is declared in that
+ /// inner context.
+ ///
+ /// For example,
+ /// \code
+ /// const int N = 10, M = 20;
+ /// int arr[N][M];
+ /// int getRow();
+ ///
+ /// for (int i = 0; i < M; ++i) {
+ /// int k = getRow();
+ /// printf("%d:", arr[k][i]);
+ /// }
+ /// \endcode
+ /// At first glance, this loop looks like it could be changed to
+ /// \code
+ /// for (int elem : arr[k]) {
+ /// int k = getIndex();
+ /// printf("%d:", elem);
+ /// }
+ /// \endcode
+ /// But this is malformed, since `k` is used before it is defined!
+ ///
+ /// In order to avoid this, this class looks at the container expression
+ /// `arr[k]` and decides whether or not it contains a sub-expression declared
+ /// within the loop body.
+ bool dependsOnInsideVariable(const clang::Stmt *Body) {
+ DependsOnInsideVariable = false;
+ TraverseStmt(const_cast<clang::Stmt *>(Body));
+ return DependsOnInsideVariable;
+ }
+
+ friend class clang::RecursiveASTVisitor<DependencyFinderASTVisitor>;
+
+private:
+ const StmtParentMap *StmtParents;
+ const DeclParentMap *DeclParents;
+ const clang::Stmt *ContainingStmt;
+ const ReplacedVarsMap *ReplacedVars;
+ bool DependsOnInsideVariable;
+
+ bool VisitVarDecl(clang::VarDecl *V);
+ bool VisitDeclRefExpr(clang::DeclRefExpr *D);
+};
+
+/// Class used to determine if any declarations used in a Stmt would conflict
+/// with a particular identifier. This search includes the names that don't
+/// actually appear in the AST (i.e. created by a refactoring tool) by including
+/// a map from Stmts to generated names associated with those stmts.
+class DeclFinderASTVisitor
+ : public clang::RecursiveASTVisitor<DeclFinderASTVisitor> {
+public:
+ DeclFinderASTVisitor(const std::string &Name,
+ const StmtGeneratedVarNameMap *GeneratedDecls)
+ : Name(Name), GeneratedDecls(GeneratedDecls), Found(false) {}
+
+ /// Attempts to find any usages of variables name Name in Body, returning
+ /// true when it is used in Body. This includes the generated loop variables
+ /// of ForStmts which have already been transformed.
+ bool findUsages(const clang::Stmt *Body) {
+ Found = false;
+ TraverseStmt(const_cast<clang::Stmt *>(Body));
+ return Found;
+ }
+
+ friend class clang::RecursiveASTVisitor<DeclFinderASTVisitor>;
+
+private:
+ std::string Name;
+ /// GeneratedDecls keeps track of ForStmts which have been transformed,
+ /// mapping each modified ForStmt to the variable generated in the loop.
+ const StmtGeneratedVarNameMap *GeneratedDecls;
+ bool Found;
+
+ bool VisitForStmt(clang::ForStmt *F);
+ bool VisitNamedDecl(clang::NamedDecl *D);
+ bool VisitDeclRefExpr(clang::DeclRefExpr *D);
+ bool VisitTypeLoc(clang::TypeLoc TL);
+};
+
+/// The information needed to describe a valid convertible usage
+/// of an array index or iterator.
+struct Usage {
+ enum UsageKind {
+ // Regular usages of the loop index (the ones not specified below). Some
+ // examples:
+ // \code
+ // int X = 8 * Arr[i];
+ // ^~~~~~
+ // f(param1, param2, *It);
+ // ^~~
+ // if (Vec[i].SomeBool) {}
+ // ^~~~~~
+ // \endcode
+ UK_Default,
+ // Indicates whether this is an access to a member through the arrow
+ // operator on pointers or iterators.
+ UK_MemberThroughArrow,
+ // If the variable is being captured by a lambda, indicates whether the
+ // capture was done by value or by reference.
+ UK_CaptureByCopy,
+ UK_CaptureByRef
+ };
+ // The expression that is going to be converted. Null in case of lambda
+ // captures.
+ const Expr *Expression;
+
+ UsageKind Kind;
+
+ // Range that covers this usage.
+ SourceRange Range;
+
+ explicit Usage(const Expr *E)
+ : Expression(E), Kind(UK_Default), Range(Expression->getSourceRange()) {}
+ Usage(const Expr *E, UsageKind Kind, SourceRange Range)
+ : Expression(E), Kind(Kind), Range(std::move(Range)) {}
+};
+
+/// A class to encapsulate lowering of the tool's confidence level.
+class Confidence {
+public:
+ enum Level {
+ // Transformations that are likely to change semantics.
+ CL_Risky,
+
+ // Transformations that might change semantics.
+ CL_Reasonable,
+
+ // Transformations that will not change semantics.
+ CL_Safe
+ };
+ /// Initialize confidence level.
+ explicit Confidence(Confidence::Level Level) : CurrentLevel(Level) {}
+
+ /// Lower the internal confidence level to Level, but do not raise it.
+ void lowerTo(Confidence::Level Level) {
+ CurrentLevel = std::min(Level, CurrentLevel);
+ }
+
+ /// Return the internal confidence level.
+ Level getLevel() const { return CurrentLevel; }
+
+private:
+ Level CurrentLevel;
+};
+
+// The main computational result of ForLoopIndexVisitor.
+typedef llvm::SmallVector<Usage, 8> UsageResult;
+
+// General functions used by ForLoopIndexUseVisitor and LoopConvertCheck.
+const Expr *digThroughConstructors(const Expr *E);
+bool areSameExpr(ASTContext *Context, const Expr *First, const Expr *Second);
+const DeclRefExpr *getDeclRef(const Expr *E);
+bool areSameVariable(const ValueDecl *First, const ValueDecl *Second);
+
+/// Discover usages of expressions consisting of index or iterator
+/// access.
+///
+/// Given an index variable, recursively crawls a for loop to discover if the
+/// index variable is used in a way consistent with range-based for loop access.
+class ForLoopIndexUseVisitor
+ : public RecursiveASTVisitor<ForLoopIndexUseVisitor> {
+public:
+ ForLoopIndexUseVisitor(ASTContext *Context, const VarDecl *IndexVar,
+ const VarDecl *EndVar, const Expr *ContainerExpr,
+ const Expr *ArrayBoundExpr,
+ bool ContainerNeedsDereference);
+
+ /// Finds all uses of IndexVar in Body, placing all usages in Usages,
+ /// and returns true if IndexVar was only used in a way consistent with a
+ /// range-based for loop.
+ ///
+ /// The general strategy is to reject any DeclRefExprs referencing IndexVar,
+ /// with the exception of certain acceptable patterns.
+ /// For arrays, the DeclRefExpr for IndexVar must appear as the index of an
+ /// ArraySubscriptExpression. Iterator-based loops may dereference
+ /// IndexVar or call methods through operator-> (builtin or overloaded).
+ /// Array-like containers may use IndexVar as a parameter to the at() member
+ /// function and in overloaded operator[].
+ bool findAndVerifyUsages(const Stmt *Body);
+
+ /// Add a set of components that we should consider relevant to the
+ /// container.
+ void addComponents(const ComponentVector &Components);
+
+ /// Accessor for Usages.
+ const UsageResult &getUsages() const { return Usages; }
+
+ /// Adds the Usage if it was not added before.
+ void addUsage(const Usage &U);
+
+ /// Get the container indexed by IndexVar, if any.
+ const Expr *getContainerIndexed() const { return ContainerExpr; }
+
+ /// Returns the statement declaring the variable created as an alias
+ /// for the loop element, if any.
+ const DeclStmt *getAliasDecl() const { return AliasDecl; }
+
+ /// Accessor for ConfidenceLevel.
+ Confidence::Level getConfidenceLevel() const {
+ return ConfidenceLevel.getLevel();
+ }
+
+ /// Indicates if the alias declaration was in a place where it cannot
+ /// simply be removed but rather replaced with a use of the alias variable.
+ /// For example, variables declared in the condition of an if, switch, or for
+ /// stmt.
+ bool aliasUseRequired() const { return ReplaceWithAliasUse; }
+
+ /// Indicates if the alias declaration came from the init clause of a
+ /// nested for loop. SourceRanges provided by Clang for DeclStmts in this
+ /// case need to be adjusted.
+ bool aliasFromForInit() const { return AliasFromForInit; }
+
+private:
+ /// Typedef used in CRTP functions.
+ typedef RecursiveASTVisitor<ForLoopIndexUseVisitor> VisitorBase;
+ friend class RecursiveASTVisitor<ForLoopIndexUseVisitor>;
+
+ /// Overriden methods for RecursiveASTVisitor's traversal.
+ bool TraverseArraySubscriptExpr(ArraySubscriptExpr *E);
+ bool TraverseCXXMemberCallExpr(CXXMemberCallExpr *MemberCall);
+ bool TraverseCXXOperatorCallExpr(CXXOperatorCallExpr *OpCall);
+ bool TraverseLambdaCapture(LambdaExpr *LE, const LambdaCapture *C,
+ Expr *Init);
+ bool TraverseMemberExpr(MemberExpr *Member);
+ bool TraverseUnaryOperator(UnaryOperator *Uop);
+ bool VisitDeclRefExpr(DeclRefExpr *E);
+ bool VisitDeclStmt(DeclStmt *S);
+ bool TraverseStmt(Stmt *S);
+
+ /// Add an expression to the list of expressions on which the container
+ /// expression depends.
+ void addComponent(const Expr *E);
+
+ // Input member variables:
+ ASTContext *Context;
+ /// The index variable's VarDecl.
+ const VarDecl *IndexVar;
+ /// The loop's 'end' variable, which cannot be mentioned at all.
+ const VarDecl *EndVar;
+ /// The Expr which refers to the container.
+ const Expr *ContainerExpr;
+ /// The Expr which refers to the terminating condition for array-based loops.
+ const Expr *ArrayBoundExpr;
+ bool ContainerNeedsDereference;
+
+ // Output member variables:
+ /// A container which holds all usages of IndexVar as the index of
+ /// ArraySubscriptExpressions.
+ UsageResult Usages;
+ llvm::SmallSet<SourceLocation, 8> UsageLocations;
+ bool OnlyUsedAsIndex;
+ /// The DeclStmt for an alias to the container element.
+ const DeclStmt *AliasDecl;
+ Confidence ConfidenceLevel;
+ /// A list of expressions on which ContainerExpr depends.
+ ///
+ /// If any of these expressions are encountered outside of an acceptable usage
+ /// of the loop element, lower our confidence level.
+ llvm::SmallVector<std::pair<const Expr *, llvm::FoldingSetNodeID>, 16>
+ DependentExprs;
+
+ /// The parent-in-waiting. Will become the real parent once we traverse down
+ /// one level in the AST.
+ const Stmt *NextStmtParent;
+ /// The actual parent of a node when Visit*() calls are made. Only the
+ /// parentage of DeclStmt's to possible iteration/selection statements is of
+ /// importance.
+ const Stmt *CurrStmtParent;
+
+ /// \see aliasUseRequired().
+ bool ReplaceWithAliasUse;
+ /// \see aliasFromForInit().
+ bool AliasFromForInit;
+};
+
+struct TUTrackingInfo {
+ /// Reset and initialize per-TU tracking information.
+ ///
+ /// Must be called before using container accessors.
+ TUTrackingInfo() : ParentFinder(new StmtAncestorASTVisitor) {}
+
+ StmtAncestorASTVisitor &getParentFinder() { return *ParentFinder; }
+ StmtGeneratedVarNameMap &getGeneratedDecls() { return GeneratedDecls; }
+ ReplacedVarsMap &getReplacedVars() { return ReplacedVars; }
+
+private:
+ std::unique_ptr<StmtAncestorASTVisitor> ParentFinder;
+ StmtGeneratedVarNameMap GeneratedDecls;
+ ReplacedVarsMap ReplacedVars;
+};
+
+/// Create names for generated variables within a particular statement.
+///
+/// VariableNamer uses a DeclContext as a reference point, checking for any
+/// conflicting declarations higher up in the context or within SourceStmt.
+/// It creates a variable name using hints from a source container and the old
+/// index, if they exist.
+class VariableNamer {
+public:
+ // Supported naming styles.
+ enum NamingStyle {
+ NS_CamelBack,
+ NS_CamelCase,
+ NS_LowerCase,
+ NS_UpperCase,
+ };
+
+ VariableNamer(StmtGeneratedVarNameMap *GeneratedDecls,
+ const StmtParentMap *ReverseAST, const clang::Stmt *SourceStmt,
+ const clang::VarDecl *OldIndex,
+ const clang::ValueDecl *TheContainer,
+ const clang::ASTContext *Context, NamingStyle Style)
+ : GeneratedDecls(GeneratedDecls), ReverseAST(ReverseAST),
+ SourceStmt(SourceStmt), OldIndex(OldIndex), TheContainer(TheContainer),
+ Context(Context), Style(Style) {}
+
+ /// Generate a new index name.
+ ///
+ /// Generates the name to be used for an inserted iterator. It relies on
+ /// declarationExists() to determine that there are no naming conflicts, and
+ /// tries to use some hints from the container name and the old index name.
+ std::string createIndexName();
+
+private:
+ StmtGeneratedVarNameMap *GeneratedDecls;
+ const StmtParentMap *ReverseAST;
+ const clang::Stmt *SourceStmt;
+ const clang::VarDecl *OldIndex;
+ const clang::ValueDecl *TheContainer;
+ const clang::ASTContext *Context;
+ const NamingStyle Style;
+
+ // Determine whether or not a declaration that would conflict with Symbol
+ // exists in an outer context or in any statement contained in SourceStmt.
+ bool declarationExists(llvm::StringRef Symbol);
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_UTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/MakeSharedCheck.h b/linux-x64/clang/include/clang-tidy/modernize/MakeSharedCheck.h
new file mode 100644
index 0000000..95bf6b7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/MakeSharedCheck.h
@@ -0,0 +1,42 @@
+//===--- MakeSharedCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SHARED_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SHARED_H
+
+#include "MakeSmartPtrCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replace the pattern:
+/// \code
+/// std::shared_ptr<type>(new type(args...))
+/// \endcode
+///
+/// With the safer version:
+/// \code
+/// std::make_shared<type>(args...)
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-make-shared.html
+class MakeSharedCheck : public MakeSmartPtrCheck {
+public:
+ MakeSharedCheck(StringRef Name, ClangTidyContext *Context);
+
+protected:
+ SmartPtrTypeMatcher getSmartPointerTypeMatcher() const override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SHARED_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/MakeSmartPtrCheck.h b/linux-x64/clang/include/clang-tidy/modernize/MakeSmartPtrCheck.h
new file mode 100644
index 0000000..ca12d77
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/MakeSmartPtrCheck.h
@@ -0,0 +1,71 @@
+//===--- MakeSmartPtrCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/ASTMatchers/ASTMatchersInternal.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Base class for MakeSharedCheck and MakeUniqueCheck.
+class MakeSmartPtrCheck : public ClangTidyCheck {
+public:
+ MakeSmartPtrCheck(StringRef Name, ClangTidyContext *Context,
+ StringRef MakeSmartPtrFunctionName);
+ void registerMatchers(ast_matchers::MatchFinder *Finder) final;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) final;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+protected:
+ using SmartPtrTypeMatcher = ast_matchers::internal::BindableMatcher<QualType>;
+
+ /// Returns matcher that match with different smart pointer types.
+ ///
+ /// Requires to bind pointer type (qualType) with PointerType string declared
+ /// in this class.
+ virtual SmartPtrTypeMatcher getSmartPointerTypeMatcher() const = 0;
+
+ /// Returns whether the C++ version is compatible with current check.
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
+
+ static const char PointerType[];
+
+private:
+ utils::IncludeInserter Inserter;
+ const std::string MakeSmartPtrFunctionHeader;
+ const std::string MakeSmartPtrFunctionName;
+ const bool IgnoreMacros;
+ const bool IgnoreDefaultInitialization;
+
+ void checkConstruct(SourceManager &SM, ASTContext *Ctx,
+ const CXXConstructExpr *Construct, const QualType *Type,
+ const CXXNewExpr *New);
+ void checkReset(SourceManager &SM, ASTContext *Ctx,
+ const CXXMemberCallExpr *Member, const CXXNewExpr *New);
+
+ /// Returns true when the fixes for replacing CXXNewExpr are generated.
+ bool replaceNew(DiagnosticBuilder &Diag, const CXXNewExpr *New,
+ SourceManager &SM, ASTContext *Ctx);
+ void insertHeader(DiagnosticBuilder &Diag, FileID FD);
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/MakeUniqueCheck.h b/linux-x64/clang/include/clang-tidy/modernize/MakeUniqueCheck.h
new file mode 100644
index 0000000..113c329
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/MakeUniqueCheck.h
@@ -0,0 +1,44 @@
+//===--- MakeUniqueCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H
+
+#include "MakeSmartPtrCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replace the pattern:
+/// \code
+/// std::unique_ptr<type>(new type(args...))
+/// \endcode
+///
+/// With the C++14 version:
+/// \code
+/// std::make_unique<type>(args...)
+/// \endcode
+class MakeUniqueCheck : public MakeSmartPtrCheck {
+public:
+ MakeUniqueCheck(StringRef Name, ClangTidyContext *Context);
+
+protected:
+ SmartPtrTypeMatcher getSmartPointerTypeMatcher() const override;
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
+
+private:
+ const bool RequireCPlusPlus14;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/PassByValueCheck.h b/linux-x64/clang/include/clang-tidy/modernize/PassByValueCheck.h
new file mode 100644
index 0000000..82cd9d4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/PassByValueCheck.h
@@ -0,0 +1,42 @@
+//===--- PassByValueCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_PASS_BY_VALUE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_PASS_BY_VALUE_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+#include <memory>
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+class PassByValueCheck : public ClangTidyCheck {
+public:
+ PassByValueCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ utils::IncludeInserter Inserter;
+ const bool ValuesOnly;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_PASS_BY_VALUE_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/RawStringLiteralCheck.h b/linux-x64/clang/include/clang-tidy/modernize/RawStringLiteralCheck.h
new file mode 100644
index 0000000..1733f7e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/RawStringLiteralCheck.h
@@ -0,0 +1,51 @@
+//===--- RawStringLiteralCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RAW_STRING_LITERAL_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RAW_STRING_LITERAL_H
+
+#include "../ClangTidyCheck.h"
+#include <bitset>
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+using CharsBitSet = std::bitset<1 << CHAR_BIT>;
+
+/// This check replaces string literals with escaped characters to
+/// raw string literals.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html
+class RawStringLiteralCheck : public ClangTidyCheck {
+public:
+ RawStringLiteralCheck(StringRef Name, ClangTidyContext *Context);
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Options) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void replaceWithRawStringLiteral(
+ const ast_matchers::MatchFinder::MatchResult &Result,
+ const StringLiteral *Literal, StringRef Replacement);
+
+ std::string DelimiterStem;
+ CharsBitSet DisallowedChars;
+ const bool ReplaceShorterLiterals;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RAW_STRING_LITERAL_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/RedundantVoidArgCheck.h b/linux-x64/clang/include/clang-tidy/modernize/RedundantVoidArgCheck.h
new file mode 100644
index 0000000..ceb1230
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/RedundantVoidArgCheck.h
@@ -0,0 +1,80 @@
+//===--- RedundantVoidArgCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REDUNDANT_VOID_ARG_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REDUNDANT_VOID_ARG_CHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "clang/Lex/Token.h"
+
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Find and remove redundant void argument lists.
+///
+/// Examples:
+/// `int f(void);` becomes `int f();`
+/// `int (*f(void))(void);` becomes `int (*f())();`
+/// `typedef int (*f_t(void))(void);` becomes `typedef int (*f_t())();`
+/// `void (C::*p)(void);` becomes `void (C::*p)();`
+/// `C::C(void) {}` becomes `C::C() {}`
+/// `C::~C(void) {}` becomes `C::~C() {}`
+///
+class RedundantVoidArgCheck : public ClangTidyCheck {
+public:
+ RedundantVoidArgCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void processFunctionDecl(const ast_matchers::MatchFinder::MatchResult &Result,
+ const FunctionDecl *Function);
+
+ void
+ processTypedefNameDecl(const ast_matchers::MatchFinder::MatchResult &Result,
+ const TypedefNameDecl *Typedef);
+
+ void processFieldDecl(const ast_matchers::MatchFinder::MatchResult &Result,
+ const FieldDecl *Member);
+
+ void processVarDecl(const ast_matchers::MatchFinder::MatchResult &Result,
+ const VarDecl *Var);
+
+ void
+ processNamedCastExpr(const ast_matchers::MatchFinder::MatchResult &Result,
+ const CXXNamedCastExpr *NamedCast);
+
+ void
+ processExplicitCastExpr(const ast_matchers::MatchFinder::MatchResult &Result,
+ const ExplicitCastExpr *ExplicitCast);
+
+ void processLambdaExpr(const ast_matchers::MatchFinder::MatchResult &Result,
+ const LambdaExpr *Lambda);
+
+ void
+ removeVoidArgumentTokens(const ast_matchers::MatchFinder::MatchResult &Result,
+ SourceRange Range, StringRef GrammarLocation);
+
+ void removeVoidToken(Token VoidToken, StringRef Diagnostic);
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REDUNDANT_VOID_ARG_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/ReplaceAutoPtrCheck.h b/linux-x64/clang/include/clang-tidy/modernize/ReplaceAutoPtrCheck.h
new file mode 100644
index 0000000..8288c7e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/ReplaceAutoPtrCheck.h
@@ -0,0 +1,63 @@
+//===--- ReplaceAutoPtrCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_AUTO_PTR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_AUTO_PTR_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Transforms the deprecated `std::auto_ptr` into the C++11 `std::unique_ptr`.
+///
+/// Note that both the `std::auto_ptr` type and the transfer of ownership are
+/// transformed. `std::auto_ptr` provides two ways to transfer the ownership,
+/// the copy-constructor and the assignment operator. Unlike most classes these
+/// operations do not 'copy' the resource but they 'steal' it.
+/// `std::unique_ptr` uses move semantics instead, which makes the intent of
+/// transferring the resource explicit. This difference between the two smart
+/// pointers requeres to wrap the copy-ctor and assign-operator with
+/// `std::move()`.
+///
+/// For example, given:
+///
+/// \code
+/// std::auto_ptr<int> i, j;
+/// i = j;
+/// \endcode
+///
+/// This code is transformed to:
+///
+/// \code
+/// std::unique_ptr<in> i, j;
+/// i = std::move(j);
+/// \endcode
+class ReplaceAutoPtrCheck : public ClangTidyCheck {
+public:
+ ReplaceAutoPtrCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ utils::IncludeInserter Inserter;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_AUTO_PTR_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h b/linux-x64/clang/include/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h
new file mode 100644
index 0000000..818b6aa
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h
@@ -0,0 +1,62 @@
+//===--- ReplaceDisallowCopyAndAssignMacroCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACEDISALLOWCOPYANDASSIGNMACROCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACEDISALLOWCOPYANDASSIGNMACROCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// This check finds macro expansions of ``DISALLOW_COPY_AND_ASSIGN(Type)`` and
+/// replaces them with a deleted copy constructor and a deleted assignment
+/// operator.
+///
+/// Before:
+/// ~~~{.cpp}
+/// class Foo {
+/// private:
+/// DISALLOW_COPY_AND_ASSIGN(Foo);
+/// };
+/// ~~~
+///
+/// After:
+/// ~~~{.cpp}
+/// class Foo {
+/// private:
+/// Foo(const Foo &) = delete;
+/// const Foo &operator=(const Foo &) = delete;
+/// };
+/// ~~~
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.html
+class ReplaceDisallowCopyAndAssignMacroCheck : public ClangTidyCheck {
+public:
+ ReplaceDisallowCopyAndAssignMacroCheck(StringRef Name,
+ ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ const std::string &getMacroName() const { return MacroName; }
+
+private:
+ const std::string MacroName;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACEDISALLOWCOPYANDASSIGNMACROCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/ReplaceRandomShuffleCheck.h b/linux-x64/clang/include/clang-tidy/modernize/ReplaceRandomShuffleCheck.h
new file mode 100644
index 0000000..990dcff
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/ReplaceRandomShuffleCheck.h
@@ -0,0 +1,44 @@
+//===--- ReplaceRandomShuffleCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_RANDOM_SHUFFLE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_RANDOM_SHUFFLE_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// std::random_shuffle will be removed as of C++17. This check will find and
+/// replace all occurrences of std::random_shuffle with std::shuffle.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-replace-random-shuffle.html
+class ReplaceRandomShuffleCheck : public ClangTidyCheck {
+public:
+ ReplaceRandomShuffleCheck(StringRef Name, ClangTidyContext *Context);
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ utils::IncludeInserter IncludeInserter;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_RANDOM_SHUFFLE_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/ReturnBracedInitListCheck.h b/linux-x64/clang/include/clang-tidy/modernize/ReturnBracedInitListCheck.h
new file mode 100644
index 0000000..12bd694
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/ReturnBracedInitListCheck.h
@@ -0,0 +1,38 @@
+//===--- ReturnBracedInitListCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RETURN_BRACED_INIT_LIST_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RETURN_BRACED_INIT_LIST_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Use a braced init list for return statements rather than unnecessary
+/// repeating the return type name.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-return-braced-init-list.html
+class ReturnBracedInitListCheck : public ClangTidyCheck {
+public:
+ ReturnBracedInitListCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RETURN_BRACED_INIT_LIST_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/ShrinkToFitCheck.h b/linux-x64/clang/include/clang-tidy/modernize/ShrinkToFitCheck.h
new file mode 100644
index 0000000..3364855
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/ShrinkToFitCheck.h
@@ -0,0 +1,39 @@
+//===--- ShrinkToFitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_SHRINKTOFITCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_SHRINKTOFITCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replace copy and swap tricks on shrinkable containers with the
+/// `shrink_to_fit()` method call.
+///
+/// The `shrink_to_fit()` method is more readable and more effective than
+/// the copy and swap trick to reduce the capacity of a shrinkable container.
+/// Note that, the `shrink_to_fit()` method is only available in C++11 and up.
+class ShrinkToFitCheck : public ClangTidyCheck {
+public:
+ ShrinkToFitCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_SHRINKTOFITCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UnaryStaticAssertCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UnaryStaticAssertCheck.h
new file mode 100644
index 0000000..afde7da
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UnaryStaticAssertCheck.h
@@ -0,0 +1,38 @@
+//===--- UnaryStaticAssertCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replaces a static_assert declaration with an empty message
+/// with the unary version.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-unary-static-assert.html
+class UnaryStaticAssertCheck : public ClangTidyCheck {
+public:
+ UnaryStaticAssertCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus17;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseAutoCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseAutoCheck.h
new file mode 100644
index 0000000..4ded732
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseAutoCheck.h
@@ -0,0 +1,42 @@
+//===--- UseAutoCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+class UseAutoCheck : public ClangTidyCheck {
+public:
+ UseAutoCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void replaceIterators(const DeclStmt *D, ASTContext *Context);
+ void replaceExpr(const DeclStmt *D, ASTContext *Context,
+ llvm::function_ref<QualType(const Expr *)> GetType,
+ StringRef Message);
+
+ const unsigned int MinTypeNameLength;
+ const bool RemoveStars;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseBoolLiteralsCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseBoolLiteralsCheck.h
new file mode 100644
index 0000000..486635b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseBoolLiteralsCheck.h
@@ -0,0 +1,40 @@
+//===--- UseBoolLiteralsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_BOOL_LITERALS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_BOOL_LITERALS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Finds integer literals which are cast to bool.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
+class UseBoolLiteralsCheck : public ClangTidyCheck {
+public:
+ UseBoolLiteralsCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool IgnoreMacros;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_BOOL_LITERALS_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseDefaultMemberInitCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseDefaultMemberInitCheck.h
new file mode 100644
index 0000000..fc26eb5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseDefaultMemberInitCheck.h
@@ -0,0 +1,48 @@
+//===--- UseDefaultMemberInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_DEFAULT_MEMBER_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_DEFAULT_MEMBER_INIT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Convert a default constructor's member initializers into default member
+/// initializers. Remove member initializers that are the same as a default
+/// member initializer.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-default-member-init.html
+class UseDefaultMemberInitCheck : public ClangTidyCheck {
+public:
+ UseDefaultMemberInitCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void checkDefaultInit(const ast_matchers::MatchFinder::MatchResult &Result,
+ const CXXCtorInitializer *Init);
+ void checkExistingInit(const ast_matchers::MatchFinder::MatchResult &Result,
+ const CXXCtorInitializer *Init);
+
+ const bool UseAssignment;
+ const bool IgnoreMacros;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_DEFAULT_MEMBER_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseEmplaceCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseEmplaceCheck.h
new file mode 100644
index 0000000..6f34bc5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseEmplaceCheck.h
@@ -0,0 +1,49 @@
+//===--- UseEmplaceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EMPLACE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EMPLACE_H
+
+#include "../ClangTidyCheck.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// This check looks for cases when inserting new element into std::vector but
+/// the element is constructed temporarily.
+/// It replaces those calls for emplace_back of arguments passed to
+/// constructor of temporary object.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html
+class UseEmplaceCheck : public ClangTidyCheck {
+public:
+ UseEmplaceCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const bool IgnoreImplicitConstructors;
+ const std::vector<std::string> ContainersWithPushBack;
+ const std::vector<std::string> SmartPointers;
+ const std::vector<std::string> TupleTypes;
+ const std::vector<std::string> TupleMakeFunctions;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EMPLACE_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseEqualsDefaultCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseEqualsDefaultCheck.h
new file mode 100644
index 0000000..6bc3fe0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseEqualsDefaultCheck.h
@@ -0,0 +1,55 @@
+//===--- UseEqualsDefaultCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replace default bodies of special member functions with '= default;'.
+/// \code
+/// struct A {
+/// A() {}
+/// ~A();
+/// };
+/// A::~A() {}
+/// \endcode
+/// Is converted to:
+/// \code
+/// struct A {
+/// A() = default;
+/// ~A();
+/// };
+/// A::~A() = default;
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html
+class UseEqualsDefaultCheck : public ClangTidyCheck {
+public:
+ UseEqualsDefaultCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool IgnoreMacros;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseEqualsDeleteCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseEqualsDeleteCheck.h
new file mode 100644
index 0000000..c77339b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseEqualsDeleteCheck.h
@@ -0,0 +1,57 @@
+//===--- UseEqualsDeleteCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DELETE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DELETE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Mark unimplemented private special member functions with '= delete'.
+/// \code
+/// struct A {
+/// private:
+/// A(const A&);
+/// A& operator=(const A&);
+/// };
+/// \endcode
+/// Is converted to:
+/// \code
+/// struct A {
+/// private:
+/// A(const A&) = delete;
+/// A& operator=(const A&) = delete;
+/// };
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-delete.html
+class UseEqualsDeleteCheck : public ClangTidyCheck {
+public:
+ UseEqualsDeleteCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ IgnoreMacros(Options.getLocalOrGlobal("IgnoreMacros", true)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool IgnoreMacros;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DELETE_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseNodiscardCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseNodiscardCheck.h
new file mode 100644
index 0000000..8c2872e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseNodiscardCheck.h
@@ -0,0 +1,50 @@
+//===--- UseNodiscardCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USENODISCARDCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USENODISCARDCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Add ``[[nodiscard]]`` to non-void const-member functions with no
+/// arguments or pass-by-value or pass by const-reference arguments.
+/// \code
+/// bool empty() const;
+/// bool empty(const Bar &) const;
+/// bool empty(int bar) const;
+/// \endcode
+/// Is converted to:
+/// \code
+/// [[nodiscard]] bool empty() const;
+/// [[nodiscard]] bool empty(const Bar &) const;
+/// [[nodiscard]] bool empty(int bar) const;
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nodiscard.html
+class UseNodiscardCheck : public ClangTidyCheck {
+public:
+ UseNodiscardCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string NoDiscardMacro;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USENODISCARDCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseNoexceptCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseNoexceptCheck.h
new file mode 100644
index 0000000..b87d3e6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseNoexceptCheck.h
@@ -0,0 +1,51 @@
+//===--- UseNoexceptCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NOEXCEPT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NOEXCEPT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Replace dynamic exception specifications, with
+/// `noexcept` (or user-defined macro) or `noexcept(false)`.
+/// \code
+/// void foo() throw();
+/// void bar() throw(int);
+/// \endcode
+/// Is converted to:
+/// \code
+/// void foo() ;
+/// void bar() noexcept(false);
+/// \endcode
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-noexcept.html
+class UseNoexceptCheck : public ClangTidyCheck {
+public:
+ UseNoexceptCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string NoexceptMacro;
+ const bool UseNoexceptFalse;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NOEXCEPT_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseNullptrCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseNullptrCheck.h
new file mode 100644
index 0000000..143cba4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseNullptrCheck.h
@@ -0,0 +1,39 @@
+//===--- UseNullptrCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+class UseNullptrCheck : public ClangTidyCheck {
+public:
+ UseNullptrCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ // FIXME this should be CPlusCplus11 but that causes test cases to
+ // erroneously fail.
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const std::string NullMacrosStr;
+ SmallVector<StringRef, 1> NullMacros;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseOverrideCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseOverrideCheck.h
new file mode 100644
index 0000000..abb4815
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseOverrideCheck.h
@@ -0,0 +1,41 @@
+//===--- UseOverrideCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USEOVERRIDECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USEOVERRIDECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Use C++11's `override` and remove `virtual` where applicable.
+class UseOverrideCheck : public ClangTidyCheck {
+public:
+ UseOverrideCheck(StringRef Name, ClangTidyContext *Context);
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const bool IgnoreDestructors;
+ const bool AllowOverrideAndFinal;
+ const std::string OverrideSpelling;
+ const std::string FinalSpelling;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USEOVERRIDECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseTrailingReturnTypeCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseTrailingReturnTypeCheck.h
new file mode 100644
index 0000000..72643ee
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseTrailingReturnTypeCheck.h
@@ -0,0 +1,67 @@
+//===--- UseTrailingReturnTypeCheck.h - clang-tidy---------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USETRAILINGRETURNTYPECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USETRAILINGRETURNTYPECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "clang/Lex/Token.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+struct ClassifiedToken {
+ Token T;
+ bool isQualifier;
+ bool isSpecifier;
+};
+
+/// Rewrites function signatures to use a trailing return type.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-trailing-type-return.html
+class UseTrailingReturnTypeCheck : public ClangTidyCheck {
+public:
+ UseTrailingReturnTypeCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ Preprocessor *PP = nullptr;
+
+ SourceLocation findTrailingReturnTypeSourceLocation(
+ const FunctionDecl &F, const FunctionTypeLoc &FTL, const ASTContext &Ctx,
+ const SourceManager &SM, const LangOptions &LangOpts);
+ llvm::Optional<SmallVector<ClassifiedToken, 8>>
+ classifyTokensBeforeFunctionName(const FunctionDecl &F, const ASTContext &Ctx,
+ const SourceManager &SM,
+ const LangOptions &LangOpts);
+ SourceRange findReturnTypeAndCVSourceRange(const FunctionDecl &F,
+ const TypeLoc &ReturnLoc,
+ const ASTContext &Ctx,
+ const SourceManager &SM,
+ const LangOptions &LangOpts);
+ void keepSpecifiers(std::string &ReturnType, std::string &Auto,
+ SourceRange ReturnTypeCVRange, const FunctionDecl &F,
+ const FriendDecl *Fr, const ASTContext &Ctx,
+ const SourceManager &SM, const LangOptions &LangOpts);
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USETRAILINGRETURNTYPECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseTransparentFunctorsCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseTransparentFunctorsCheck.h
new file mode 100644
index 0000000..8da0ca5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseTransparentFunctorsCheck.h
@@ -0,0 +1,39 @@
+//===--- UseTransparentFunctorsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_TRANSPARENT_FUNCTORS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_TRANSPARENT_FUNCTORS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Prefer using transparent functors to non-transparent ones.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-transparent-functors.html
+class UseTransparentFunctorsCheck : public ClangTidyCheck {
+public:
+ UseTransparentFunctorsCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus14;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+private:
+ const bool SafeMode;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_TRANSPARENT_FUNCTORS_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseUncaughtExceptionsCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseUncaughtExceptionsCheck.h
new file mode 100644
index 0000000..71ad394
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseUncaughtExceptionsCheck.h
@@ -0,0 +1,39 @@
+//===--- UseUncaughtExceptionsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_UNCAUGHT_EXCEPTIONS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_UNCAUGHT_EXCEPTIONS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// This check will warn on calls to std::uncaught_exception and replace them with calls to
+/// std::uncaught_exceptions, since std::uncaught_exception was deprecated in C++17. In case of
+/// macro ID there will be only a warning without fixits.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-uncaught-exceptions.html
+class UseUncaughtExceptionsCheck : public ClangTidyCheck {
+public:
+ UseUncaughtExceptionsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus17;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_UNCAUGHT_EXCEPTIONS_H
diff --git a/linux-x64/clang/include/clang-tidy/modernize/UseUsingCheck.h b/linux-x64/clang/include/clang-tidy/modernize/UseUsingCheck.h
new file mode 100644
index 0000000..f116ff2
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/modernize/UseUsingCheck.h
@@ -0,0 +1,44 @@
+//===--- UseUsingCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_USING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_USING_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+/// Check finds typedefs and replaces it with usings.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html
+class UseUsingCheck : public ClangTidyCheck {
+
+ const bool IgnoreMacros;
+ SourceLocation LastReplacementEnd;
+ SourceRange LastTagDeclRange;
+ std::string FirstTypedefType;
+ std::string FirstTypedefName;
+
+public:
+ UseUsingCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace modernize
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_USING_H
diff --git a/linux-x64/clang/include/clang-tidy/mpi/BufferDerefCheck.h b/linux-x64/clang/include/clang-tidy/mpi/BufferDerefCheck.h
new file mode 100644
index 0000000..040e3f7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/mpi/BufferDerefCheck.h
@@ -0,0 +1,50 @@
+//===--- BufferDerefCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_BUFFER_DEREF_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_BUFFER_DEREF_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace mpi {
+
+/// This check verifies if a buffer passed to an MPI (Message Passing Interface)
+/// function is sufficiently dereferenced. Buffers should be passed as a single
+/// pointer or array. As MPI function signatures specify void * for their buffer
+/// types, insufficiently dereferenced buffers can be passed, like for example
+/// as double pointers or multidimensional arrays, without a compiler warning
+/// emitted.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/mpi-buffer-deref.html
+class BufferDerefCheck : public ClangTidyCheck {
+public:
+ BufferDerefCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ /// Checks for all buffers in an MPI call if they are sufficiently
+ /// dereferenced.
+ ///
+ /// \param BufferTypes buffer types
+ /// \param BufferExprs buffer arguments as expressions
+ void checkBuffers(ArrayRef<const Type *> BufferTypes,
+ ArrayRef<const Expr *> BufferExprs);
+
+ enum class IndirectionType : unsigned char { Pointer, Array };
+};
+
+} // namespace mpi
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_BUFFER_DEREF_H
diff --git a/linux-x64/clang/include/clang-tidy/mpi/TypeMismatchCheck.h b/linux-x64/clang/include/clang-tidy/mpi/TypeMismatchCheck.h
new file mode 100644
index 0000000..a563e29
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/mpi/TypeMismatchCheck.h
@@ -0,0 +1,50 @@
+//===--- TypeMismatchCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
+
+#include "../ClangTidyCheck.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+
+namespace clang {
+namespace tidy {
+namespace mpi {
+
+/// This check verifies if buffer type and MPI (Message Passing Interface)
+/// datatype pairs match. All MPI datatypes defined by the MPI standard (3.1)
+/// are verified by this check. User defined typedefs, custom MPI datatypes and
+/// null pointer constants are skipped, in the course of verification.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/mpi-type-mismatch.html
+class TypeMismatchCheck : public ClangTidyCheck {
+public:
+ TypeMismatchCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ /// Check if the buffer type MPI datatype pairs match.
+ ///
+ /// \param BufferTypes buffer types
+ /// \param BufferExprs buffer arguments as expressions
+ /// \param MPIDatatypes MPI datatype
+ /// \param LO language options
+ void checkArguments(ArrayRef<const Type *> BufferTypes,
+ ArrayRef<const Expr *> BufferExprs,
+ ArrayRef<StringRef> MPIDatatypes, const LangOptions &LO);
+};
+
+} // namespace mpi
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/AvoidNSErrorInitCheck.h b/linux-x64/clang/include/clang-tidy/objc/AvoidNSErrorInitCheck.h
new file mode 100644
index 0000000..ea12516
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/AvoidNSErrorInitCheck.h
@@ -0,0 +1,38 @@
+//===--- AvoidNSErrorInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_AVOIDNSERRORINITCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_AVOIDNSERRORINITCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds usages of -[NSError init]. It is not the proper way of creating
+/// NSError. errorWithDomain:code:userInfo: should be used instead.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-avoid-nserror-init.html
+class AvoidNSErrorInitCheck : public ClangTidyCheck {
+ public:
+ AvoidNSErrorInitCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_AVOIDNSERRORINITCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/DeallocInCategoryCheck.h b/linux-x64/clang/include/clang-tidy/objc/DeallocInCategoryCheck.h
new file mode 100644
index 0000000..a655eae
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/DeallocInCategoryCheck.h
@@ -0,0 +1,39 @@
+//===--- DeallocInCategoryCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_DEALLOCINCATEGORYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_DEALLOCINCATEGORYCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds implementations of -dealloc in Objective-C categories. The category
+/// implementation will override any dealloc in the class implementation,
+/// potentially causing issues.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-dealloc-in-category.html
+class DeallocInCategoryCheck final : public ClangTidyCheck {
+public:
+ DeallocInCategoryCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_DEALLOCINCATEGORYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/ForbiddenSubclassingCheck.h b/linux-x64/clang/include/clang-tidy/objc/ForbiddenSubclassingCheck.h
new file mode 100644
index 0000000..27be9c9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/ForbiddenSubclassingCheck.h
@@ -0,0 +1,44 @@
+//===--- ForbiddenSubclassingCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_FORBIDDEN_SUBCLASSING_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_FORBIDDEN_SUBCLASSING_CHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds Objective-C classes which have a superclass which is
+/// documented to not support subclassing.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-forbidden-subclassing.html
+class ForbiddenSubclassingCheck : public ClangTidyCheck {
+public:
+ ForbiddenSubclassingCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Options) override;
+
+private:
+ const std::vector<std::string> ForbiddenSuperClassNames;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_FORBIDDEN_SUBCLASSING_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/MissingHashCheck.h b/linux-x64/clang/include/clang-tidy/objc/MissingHashCheck.h
new file mode 100644
index 0000000..5e4b96a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/MissingHashCheck.h
@@ -0,0 +1,38 @@
+//===--- MissingHashCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_MISSINGHASHCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_MISSINGHASHCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds Objective-C implementations that implement -isEqual: without also
+/// appropriately implementing -hash.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-missing-hash.html
+class MissingHashCheck : public ClangTidyCheck {
+public:
+ MissingHashCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_MISSINGHASHCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.h b/linux-x64/clang/include/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.h
new file mode 100644
index 0000000..6d0c30c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.h
@@ -0,0 +1,39 @@
+//===--- NSInvocationArgumentLifetimeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_NSINVOCATIONARGUMENTLIFETIMECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_NSINVOCATIONARGUMENTLIFETIMECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "clang/Basic/LangStandard.h"
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds calls to NSInvocation methods under ARC that don't have proper
+/// argument object lifetimes.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-nsinvocation-argument-lifetime.html
+class NSInvocationArgumentLifetimeCheck : public ClangTidyCheck {
+public:
+ NSInvocationArgumentLifetimeCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC && LangOpts.ObjCAutoRefCount;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_NSINVOCATIONARGUMENTLIFETIMECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/PropertyDeclarationCheck.h b/linux-x64/clang/include/clang-tidy/objc/PropertyDeclarationCheck.h
new file mode 100644
index 0000000..4b4ac46
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/PropertyDeclarationCheck.h
@@ -0,0 +1,41 @@
+//===--- PropertyDeclarationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds Objective-C property declarations which
+/// are not in Lower Camel Case.
+///
+/// The format of property should look like:
+/// @property(nonatomic) NSString *lowerCamelCase;
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-property-declaration.html
+class PropertyDeclarationCheck : public ClangTidyCheck {
+public:
+ PropertyDeclarationCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
diff --git a/linux-x64/clang/include/clang-tidy/objc/SuperSelfCheck.h b/linux-x64/clang/include/clang-tidy/objc/SuperSelfCheck.h
new file mode 100644
index 0000000..4dcc0c1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/objc/SuperSelfCheck.h
@@ -0,0 +1,39 @@
+//===--- SuperSelfCheck.h - clang-tidy --------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_SUPERSELFCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_SUPERSELFCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace objc {
+
+/// Finds invocations of -self on super instances in initializers of subclasses
+/// of NSObject and recommends calling a superclass initializer instead.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/objc-super-self.html
+class SuperSelfCheck : public ClangTidyCheck {
+public:
+ SuperSelfCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.ObjC;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace objc
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_SUPERSELFCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/openmp/ExceptionEscapeCheck.h b/linux-x64/clang/include/clang-tidy/openmp/ExceptionEscapeCheck.h
new file mode 100644
index 0000000..1fb78a9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/openmp/ExceptionEscapeCheck.h
@@ -0,0 +1,44 @@
+//===--- ExceptionEscapeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OPENMP_EXCEPTIONESCAPECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OPENMP_EXCEPTIONESCAPECHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/ExceptionAnalyzer.h"
+
+namespace clang {
+namespace tidy {
+namespace openmp {
+
+/// Analyzes OpenMP Structured Blocks and checks that no exception escapes
+/// out of the Structured Block it was thrown in.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/openmp-exception-escape.html
+class ExceptionEscapeCheck : public ClangTidyCheck {
+public:
+ ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.OpenMP && LangOpts.CPlusPlus && LangOpts.CXXExceptions;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ std::string RawIgnoredExceptions;
+
+ utils::ExceptionAnalyzer Tracer;
+};
+
+} // namespace openmp
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OPENMP_EXCEPTIONESCAPECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/openmp/UseDefaultNoneCheck.h b/linux-x64/clang/include/clang-tidy/openmp/UseDefaultNoneCheck.h
new file mode 100644
index 0000000..8901fa7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/openmp/UseDefaultNoneCheck.h
@@ -0,0 +1,39 @@
+//===--- UseDefaultNoneCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OPENMP_USEDEFAULTNONECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OPENMP_USEDEFAULTNONECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace openmp {
+
+/// Finds OpenMP directives that are allowed to contain a ``default`` clause,
+/// but either don't specify it or the clause is specified but with the kind
+/// other than ``none``, and suggests to use the ``default(none)`` clause.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/openmp-use-default-none.html
+class UseDefaultNoneCheck : public ClangTidyCheck {
+public:
+ UseDefaultNoneCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.OpenMP;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace openmp
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OPENMP_USEDEFAULTNONECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/FasterStringFindCheck.h b/linux-x64/clang/include/clang-tidy/performance/FasterStringFindCheck.h
new file mode 100644
index 0000000..71a4570
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/FasterStringFindCheck.h
@@ -0,0 +1,45 @@
+//===--- FasterStringFindCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_FASTER_STRING_FIND_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_FASTER_STRING_FIND_H
+
+#include "../ClangTidyCheck.h"
+
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Optimize calls to std::string::find() and friends when the needle passed is
+/// a single character string literal.
+/// The character literal overload is more efficient.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html
+class FasterStringFindCheck : public ClangTidyCheck {
+public:
+ FasterStringFindCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const std::vector<std::string> StringLikeClasses;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_FASTER_STRING_FIND_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/ForRangeCopyCheck.h b/linux-x64/clang/include/clang-tidy/performance/ForRangeCopyCheck.h
new file mode 100644
index 0000000..71f662b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/ForRangeCopyCheck.h
@@ -0,0 +1,52 @@
+//===--- ForRangeCopyCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_FORRANGECOPYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_FORRANGECOPYCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// A check that detects copied loop variables and suggests using const
+/// references.
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html
+class ForRangeCopyCheck : public ClangTidyCheck {
+public:
+ ForRangeCopyCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ // Checks if the loop variable is a const value and expensive to copy. If so
+ // suggests it be converted to a const reference.
+ bool handleConstValueCopy(const VarDecl &LoopVar, ASTContext &Context);
+
+ // Checks if the loop variable is a non-const value and whether only
+ // const methods are invoked on it or whether it is only used as a const
+ // reference argument. If so it suggests it be made a const reference.
+ bool handleCopyIsOnlyConstReferenced(const VarDecl &LoopVar,
+ const CXXForRangeStmt &ForRange,
+ ASTContext &Context);
+
+ const bool WarnOnAllAutoCopies;
+ const std::vector<std::string> AllowedTypes;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_FORRANGECOPYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/ImplicitConversionInLoopCheck.h b/linux-x64/clang/include/clang-tidy/performance/ImplicitConversionInLoopCheck.h
new file mode 100644
index 0000000..4b27136
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/ImplicitConversionInLoopCheck.h
@@ -0,0 +1,40 @@
+//===--- ImplicitConversionInLoopCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_IMPLICIT_CONVERSION_IN_LOOP_CHECK_H_
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_IMPLICIT_CONVERSION_IN_LOOP_CHECK_H_
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+// Checks that in a for range loop, if the provided type is a reference, then
+// the underlying type is the one returned by the iterator (i.e. that there
+// isn't any implicit conversion).
+class ImplicitConversionInLoopCheck : public ClangTidyCheck {
+public:
+ ImplicitConversionInLoopCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void ReportAndFix(const ASTContext *Context, const VarDecl *VD,
+ const Expr *OperatorCall);
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_IMPLICIT_CONVERSION_IN_LOOP_CHECK_H_
diff --git a/linux-x64/clang/include/clang-tidy/performance/InefficientAlgorithmCheck.h b/linux-x64/clang/include/clang-tidy/performance/InefficientAlgorithmCheck.h
new file mode 100644
index 0000000..14f8fbb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/InefficientAlgorithmCheck.h
@@ -0,0 +1,38 @@
+//===--- InefficientAlgorithmCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENTALGORITHMCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENTALGORITHMCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Warns on inefficient use of STL algorithms on associative containers.
+///
+/// Associative containers implements some of the algorithms as methods which
+/// should be preferred to the algorithms in the algorithm header. The methods
+/// can take advantage of the order of the elements.
+class InefficientAlgorithmCheck : public ClangTidyCheck {
+public:
+ InefficientAlgorithmCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENTALGORITHMCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/InefficientStringConcatenationCheck.h b/linux-x64/clang/include/clang-tidy/performance/InefficientStringConcatenationCheck.h
new file mode 100644
index 0000000..512f5c1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/InefficientStringConcatenationCheck.h
@@ -0,0 +1,43 @@
+//===--- InefficientStringConcatenationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENTSTRINGCONCATENATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENTSTRINGCONCATENATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// This check is to warn about the performance overhead arising from
+/// concatenating strings, using the operator+, instead of operator+=.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-inefficient-string-concatenation.html
+class InefficientStringConcatenationCheck : public ClangTidyCheck {
+public:
+ InefficientStringConcatenationCheck(StringRef Name,
+ ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const bool StrictMode;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENTSTRINGCONCATENATION_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/InefficientVectorOperationCheck.h b/linux-x64/clang/include/clang-tidy/performance/InefficientVectorOperationCheck.h
new file mode 100644
index 0000000..533b30d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/InefficientVectorOperationCheck.h
@@ -0,0 +1,51 @@
+//===--- InefficientVectorOperationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENT_VECTOR_OPERATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENT_VECTOR_OPERATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Finds possible inefficient `std::vector` operations (e.g. `push_back`) in
+/// for loops that may cause unnecessary memory reallocations.
+///
+/// When EnableProto, also finds calls that add element to protobuf repeated
+/// field without calling Reserve() first.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-inefficient-vector-operation.html
+class InefficientVectorOperationCheck : public ClangTidyCheck {
+public:
+ InefficientVectorOperationCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ void AddMatcher(const ast_matchers::DeclarationMatcher &TargetRecordDecl,
+ StringRef VarDeclName, StringRef VarDeclStmtName,
+ const ast_matchers::DeclarationMatcher &AppendMethodDecl,
+ StringRef AppendCallName, ast_matchers::MatchFinder *Finder);
+ const std::vector<std::string> VectorLikeClasses;
+
+ // If true, also check inefficient operations for proto repeated fields.
+ bool EnableProto;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_INEFFICIENT_VECTOR_OPERATION_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/MoveConstArgCheck.h b/linux-x64/clang/include/clang-tidy/performance/MoveConstArgCheck.h
new file mode 100644
index 0000000..28fe8d5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/MoveConstArgCheck.h
@@ -0,0 +1,45 @@
+//===--- MoveConstArgCheck.h - clang-tidy -------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MOVECONSTANTARGUMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MOVECONSTANTARGUMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Find casts of calculation results to bigger type. Typically from int to
+///
+/// There is one option:
+///
+/// - `CheckTriviallyCopyableMove`: Whether to check for trivially-copyable
+// types as their objects are not moved but copied. Enabled by default.
+class MoveConstArgCheck : public ClangTidyCheck {
+public:
+ MoveConstArgCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ CheckTriviallyCopyableMove(
+ Options.get("CheckTriviallyCopyableMove", true)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool CheckTriviallyCopyableMove;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MOVECONSTANTARGUMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/MoveConstructorInitCheck.h b/linux-x64/clang/include/clang-tidy/performance/MoveConstructorInitCheck.h
new file mode 100644
index 0000000..0b637b6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/MoveConstructorInitCheck.h
@@ -0,0 +1,46 @@
+//===--- MoveConstructorInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_MOVECONSTRUCTORINITCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_MOVECONSTRUCTORINITCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+#include <memory>
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// The check flags user-defined move constructors that have a ctor-initializer
+/// initializing a member or base class through a copy constructor instead of a
+/// move constructor.
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-move-constructor-init.html
+class MoveConstructorInitCheck : public ClangTidyCheck {
+public:
+ MoveConstructorInitCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ utils::IncludeInserter Inserter;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_MOVECONSTRUCTORINITCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/NoAutomaticMoveCheck.h b/linux-x64/clang/include/clang-tidy/performance/NoAutomaticMoveCheck.h
new file mode 100644
index 0000000..037a34e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/NoAutomaticMoveCheck.h
@@ -0,0 +1,39 @@
+//===--- NoAutomaticMoveCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOAUTOMATICMOVECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOAUTOMATICMOVECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Finds local variables that cannot be automatically moved due to constness.
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-no-automatic-move.html
+class NoAutomaticMoveCheck : public ClangTidyCheck {
+public:
+ NoAutomaticMoveCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ const std::vector<std::string> AllowedTypes;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOAUTOMATICMOVECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/NoIntToPtrCheck.h b/linux-x64/clang/include/clang-tidy/performance/NoIntToPtrCheck.h
new file mode 100644
index 0000000..f073431
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/NoIntToPtrCheck.h
@@ -0,0 +1,34 @@
+//===--- NoIntToPtrCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOINTTOPTRCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOINTTOPTRCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Diagnoses every integer to pointer cast.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-no-int-to-ptr.html
+class NoIntToPtrCheck : public ClangTidyCheck {
+public:
+ NoIntToPtrCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOINTTOPTRCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/NoexceptMoveConstructorCheck.h b/linux-x64/clang/include/clang-tidy/performance/NoexceptMoveConstructorCheck.h
new file mode 100644
index 0000000..473b518
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/NoexceptMoveConstructorCheck.h
@@ -0,0 +1,40 @@
+//===--- NoexceptMoveConstructorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOEXCEPTMOVECONSTRUCTORCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOEXCEPTMOVECONSTRUCTORCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// The check flags user-defined move constructors and assignment operators not
+/// marked with `noexcept` or marked with `noexcept(expr)` where `expr`
+/// evaluates to `false` (but is not a `false` literal itself).
+///
+/// Move constructors of all the types used with STL containers, for example,
+/// need to be declared `noexcept`. Otherwise STL will choose copy constructors
+/// instead. The same is valid for move assignment operations.
+class NoexceptMoveConstructorCheck : public ClangTidyCheck {
+public:
+ NoexceptMoveConstructorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_NOEXCEPTMOVECONSTRUCTORCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/TriviallyDestructibleCheck.h b/linux-x64/clang/include/clang-tidy/performance/TriviallyDestructibleCheck.h
new file mode 100644
index 0000000..e644fd8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/TriviallyDestructibleCheck.h
@@ -0,0 +1,43 @@
+//===--- TriviallyDestructibleCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_TRIVIALLYDESTRUCTIBLECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_TRIVIALLYDESTRUCTIBLECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// A check that finds classes that would be trivial if not for the defaulted
+/// destructors declared out-of-line:
+/// struct A: TrivialClass {
+/// ~A();
+/// TrivialClass trivial_fields;
+/// };
+/// A::~A() = default;
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-trivially-destructible.html
+class TriviallyDestructibleCheck : public ClangTidyCheck {
+public:
+ TriviallyDestructibleCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_TRIVIALLYDESTRUCTIBLECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/TypePromotionInMathFnCheck.h b/linux-x64/clang/include/clang-tidy/performance/TypePromotionInMathFnCheck.h
new file mode 100644
index 0000000..dd7c1c0
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/TypePromotionInMathFnCheck.h
@@ -0,0 +1,46 @@
+//===--- TypePromotionInMathFnCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_TYPE_PROMOTION_IN_MATH_FN_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_TYPE_PROMOTION_IN_MATH_FN_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// Finds calls to C math library functions with implicit float to double
+/// promotions.
+///
+/// For example, warns on ::sin(0.f), because this funciton's parameter is a
+/// double. You probably meant to call std::sin(0.f) (in C++), or sinf(0.f) (in
+/// C).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-type-promotion-in-math-fn.html
+class TypePromotionInMathFnCheck : public ClangTidyCheck {
+public:
+ TypePromotionInMathFnCheck(StringRef Name, ClangTidyContext *Context);
+
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ utils::IncludeInserter IncludeInserter;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_TYPE_PROMOTION_IN_MATH_FN_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/UnnecessaryCopyInitialization.h b/linux-x64/clang/include/clang-tidy/performance/UnnecessaryCopyInitialization.h
new file mode 100644
index 0000000..eeb9138
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/UnnecessaryCopyInitialization.h
@@ -0,0 +1,50 @@
+//===--- UnnecessaryCopyInitialization.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_COPY_INITIALIZATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_COPY_INITIALIZATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+// The check detects local variable declarations that are copy initialized with
+// the const reference of a function call or the const reference of a method
+// call whose object is guaranteed to outlive the variable's scope and suggests
+// to use a const reference.
+//
+// The check currently only understands a subset of variables that are
+// guaranteed to outlive the const reference returned, namely: const variables,
+// const references, and const pointers to const.
+class UnnecessaryCopyInitialization : public ClangTidyCheck {
+public:
+ UnnecessaryCopyInitialization(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override{
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ void handleCopyFromMethodReturn(const VarDecl &Var, const Stmt &BlockStmt,
+ bool IssueFix, const VarDecl *ObjectArg,
+ ASTContext &Context);
+ void handleCopyFromLocalVar(const VarDecl &NewVar, const VarDecl &OldVar,
+ const Stmt &BlockStmt, bool IssueFix,
+ ASTContext &Context);
+ const std::vector<std::string> AllowedTypes;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_COPY_INITIALIZATION_H
diff --git a/linux-x64/clang/include/clang-tidy/performance/UnnecessaryValueParamCheck.h b/linux-x64/clang/include/clang-tidy/performance/UnnecessaryValueParamCheck.h
new file mode 100644
index 0000000..a84079e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/performance/UnnecessaryValueParamCheck.h
@@ -0,0 +1,52 @@
+//===--- UnnecessaryValueParamCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_VALUE_PARAM_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_VALUE_PARAM_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+#include "clang/Analysis/Analyses/ExprMutationAnalyzer.h"
+
+namespace clang {
+namespace tidy {
+namespace performance {
+
+/// A check that flags value parameters of expensive to copy types that
+/// can safely be converted to const references.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-value-param.html
+class UnnecessaryValueParamCheck : public ClangTidyCheck {
+public:
+ UnnecessaryValueParamCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void onEndOfTranslationUnit() override;
+
+private:
+ void handleMoveFix(const ParmVarDecl &Var, const DeclRefExpr &CopyArgument,
+ const ASTContext &Context);
+
+ llvm::DenseMap<const FunctionDecl *, FunctionParmMutationAnalyzer>
+ MutationAnalyzers;
+ utils::IncludeInserter Inserter;
+ const std::vector<std::string> AllowedTypes;
+};
+
+} // namespace performance
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PERFORMANCE_UNNECESSARY_VALUE_PARAM_H
diff --git a/linux-x64/clang/include/clang-tidy/portability/RestrictSystemIncludesCheck.h b/linux-x64/clang/include/clang-tidy/portability/RestrictSystemIncludesCheck.h
new file mode 100644
index 0000000..80eddf7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/portability/RestrictSystemIncludesCheck.h
@@ -0,0 +1,85 @@
+//===--- RestrictSystemIncludesCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_RESTRICTINCLUDESSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_RESTRICTINCLUDESSCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../GlobList.h"
+#include "clang/Lex/PPCallbacks.h"
+
+namespace clang {
+namespace tidy {
+namespace portability {
+
+/// Checks for allowed includes and suggests removal of any others. If no
+/// includes are specified, the check will exit without issuing any warnings.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/portability-restrict-system-includes.html
+class RestrictSystemIncludesCheck : public ClangTidyCheck {
+public:
+ RestrictSystemIncludesCheck(StringRef Name, ClangTidyContext *Context,
+ std::string DefaultAllowedIncludes = "*")
+ : ClangTidyCheck(Name, Context),
+ AllowedIncludes(Options.get("Includes", DefaultAllowedIncludes)),
+ AllowedIncludesGlobList(AllowedIncludes) {}
+
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ bool contains(StringRef FileName) {
+ return AllowedIncludesGlobList.contains(FileName);
+ }
+
+private:
+ std::string AllowedIncludes;
+ GlobList AllowedIncludesGlobList;
+};
+
+class RestrictedIncludesPPCallbacks : public PPCallbacks {
+public:
+ explicit RestrictedIncludesPPCallbacks(RestrictSystemIncludesCheck &Check,
+ const SourceManager &SM)
+ : Check(Check), SM(SM) {}
+
+ void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
+ StringRef FileName, bool IsAngled,
+ CharSourceRange FilenameRange, const FileEntry *File,
+ StringRef SearchPath, StringRef RelativePath,
+ const Module *Imported,
+ SrcMgr::CharacteristicKind FileType) override;
+ void EndOfMainFile() override;
+
+private:
+ struct IncludeDirective {
+ IncludeDirective() = default;
+ IncludeDirective(SourceLocation Loc, CharSourceRange Range,
+ StringRef Filename, StringRef FullPath, bool IsInMainFile)
+ : Loc(Loc), Range(Range), IncludeFile(Filename), IncludePath(FullPath),
+ IsInMainFile(IsInMainFile) {}
+
+ SourceLocation Loc; // '#' location in the include directive
+ CharSourceRange Range; // SourceRange for the file name
+ std::string IncludeFile; // Filename as a string
+ std::string IncludePath; // Full file path as a string
+ bool IsInMainFile; // Whether or not the include is in the main file
+ };
+
+ using FileIncludes = llvm::SmallVector<IncludeDirective, 8>;
+ llvm::SmallDenseMap<FileID, FileIncludes> IncludeDirectives;
+
+ RestrictSystemIncludesCheck &Check;
+ const SourceManager &SM;
+};
+
+} // namespace portability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_RESTRICTINCLUDESSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/portability/SIMDIntrinsicsCheck.h b/linux-x64/clang/include/clang-tidy/portability/SIMDIntrinsicsCheck.h
new file mode 100644
index 0000000..17ed4bb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/portability/SIMDIntrinsicsCheck.h
@@ -0,0 +1,44 @@
+//===--- SIMDIntrinsicsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H
+
+#include "../ClangTidyCheck.h"
+
+#include "llvm/ADT/SmallString.h"
+
+namespace clang {
+namespace tidy {
+namespace portability {
+
+/// Find SIMD intrinsics calls and suggest std::experimental::simd alternatives.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/portability-simd-intrinsics.html
+class SIMDIntrinsicsCheck : public ClangTidyCheck {
+public:
+ SIMDIntrinsicsCheck(StringRef Name, ClangTidyContext *Context);
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+ private:
+ llvm::SmallString<32> Std;
+ const bool Suggest;
+};
+
+} // namespace portability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_SIMD_INTRINSICS_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/AvoidConstParamsInDecls.h b/linux-x64/clang/include/clang-tidy/readability/AvoidConstParamsInDecls.h
new file mode 100644
index 0000000..08aac94
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/AvoidConstParamsInDecls.h
@@ -0,0 +1,33 @@
+//===--- AvoidConstParamsInDecls.h - clang-tidy----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOID_CONST_PARAMS_IN_DECLS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOID_CONST_PARAMS_IN_DECLS_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+// Detect function declarations that have const value parameters and discourage
+// them.
+class AvoidConstParamsInDecls : public ClangTidyCheck {
+public:
+ AvoidConstParamsInDecls(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_AVOID_CONST_PARAMS_IN_DECLS_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/BracesAroundStatementsCheck.h b/linux-x64/clang/include/clang-tidy/readability/BracesAroundStatementsCheck.h
new file mode 100644
index 0000000..7c019c6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/BracesAroundStatementsCheck.h
@@ -0,0 +1,68 @@
+//===--- BracesAroundStatementsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_BRACESAROUNDSTATEMENTSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_BRACESAROUNDSTATEMENTSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks that bodies of `if` statements and loops (`for`, `range-for`,
+/// `do-while`, and `while`) are inside braces
+///
+/// Before:
+///
+/// \code
+/// if (condition)
+/// statement;
+/// \endcode
+///
+/// After:
+///
+/// \code
+/// if (condition) {
+/// statement;
+/// }
+/// \endcode
+///
+/// Additionally, one can define an option `ShortStatementLines` defining the
+/// minimal number of lines that the statement should have in order to trigger
+/// this check.
+///
+/// The number of lines is counted from the end of condition or initial keyword
+/// (`do`/`else`) until the last line of the inner statement. Default value 0
+/// means that braces will be added to all statements (not having them already).
+class BracesAroundStatementsCheck : public ClangTidyCheck {
+public:
+ BracesAroundStatementsCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+
+private:
+ bool checkStmt(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Stmt *S, SourceLocation StartLoc,
+ SourceLocation EndLocHint = SourceLocation());
+ template <typename IfOrWhileStmt>
+ SourceLocation findRParenLoc(const IfOrWhileStmt *S, const SourceManager &SM,
+ const ASTContext *Context);
+
+private:
+ std::set<const Stmt *> ForceBracesStmts;
+ const unsigned ShortStatementLines;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_BRACESAROUNDSTATEMENTSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/ConstReturnTypeCheck.h b/linux-x64/clang/include/clang-tidy/readability/ConstReturnTypeCheck.h
new file mode 100644
index 0000000..3a5fb08
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/ConstReturnTypeCheck.h
@@ -0,0 +1,34 @@
+//===--- ConstReturnTypeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONSTRETURNTYPECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONSTRETURNTYPECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// For any function whose return type is const-qualified, suggests removal of
+/// the `const` qualifier from that return type.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-const-return-type.html
+class ConstReturnTypeCheck : public ClangTidyCheck {
+ public:
+ using ClangTidyCheck::ClangTidyCheck;
+ void registerMatchers(ast_matchers::MatchFinder* finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult& result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONSTRETURNTYPECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/ContainerSizeEmptyCheck.h b/linux-x64/clang/include/clang-tidy/readability/ContainerSizeEmptyCheck.h
new file mode 100644
index 0000000..8afff22
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/ContainerSizeEmptyCheck.h
@@ -0,0 +1,42 @@
+//===--- ContainerSizeEmptyCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks whether a call to the `size()` method can be replaced with a call to
+/// `empty()`.
+///
+/// The emptiness of a container should be checked using the `empty()` method
+/// instead of the `size()` method. It is not guaranteed that `size()` is a
+/// constant-time function, and it is generally more efficient and also shows
+/// clearer intent to use `empty()`. Furthermore some containers may implement
+/// the `empty()` method but not implement the `size()` method. Using `empty()`
+/// whenever possible makes it easier to switch to another container in the
+/// future.
+class ContainerSizeEmptyCheck : public ClangTidyCheck {
+public:
+ ContainerSizeEmptyCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONTAINERSIZEEMPTYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/ConvertMemberFunctionsToStatic.h b/linux-x64/clang/include/clang-tidy/readability/ConvertMemberFunctionsToStatic.h
new file mode 100644
index 0000000..333fe94
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/ConvertMemberFunctionsToStatic.h
@@ -0,0 +1,37 @@
+//===--- ConvertMemberFunctionsToStatic.h - clang-tidy ----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMFUNCTOSTATIC_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMFUNCTOSTATIC_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// This check finds C++ class methods than can be made static
+/// because they don't use the 'this' pointer.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/
+/// readability-convert-member-functions-to-static.html
+class ConvertMemberFunctionsToStatic : public ClangTidyCheck {
+public:
+ ConvertMemberFunctionsToStatic(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_CONVERTMEMFUNCTOSTATIC_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/DeleteNullPointerCheck.h b/linux-x64/clang/include/clang-tidy/readability/DeleteNullPointerCheck.h
new file mode 100644
index 0000000..0e310f7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/DeleteNullPointerCheck.h
@@ -0,0 +1,35 @@
+//===--- DeleteNullPointerCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_DELETE_NULL_POINTER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_DELETE_NULL_POINTER_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Check whether the 'if' statement is unnecessary before calling 'delete' on a
+/// pointer.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-delete-null-pointer.html
+class DeleteNullPointerCheck : public ClangTidyCheck {
+public:
+ DeleteNullPointerCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_DELETE_NULL_POINTER_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/DeletedDefaultCheck.h b/linux-x64/clang/include/clang-tidy/readability/DeletedDefaultCheck.h
new file mode 100644
index 0000000..ab7f141
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/DeletedDefaultCheck.h
@@ -0,0 +1,35 @@
+//===--- DeletedDefaultCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_DELETED_DEFAULT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_DELETED_DEFAULT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks when a constructor or an assignment operator is marked as '= default'
+/// but is actually deleted by the compiler.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-deleted-default.html
+class DeletedDefaultCheck : public ClangTidyCheck {
+public:
+ DeletedDefaultCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_DELETED_DEFAULT_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/ElseAfterReturnCheck.h b/linux-x64/clang/include/clang-tidy/readability/ElseAfterReturnCheck.h
new file mode 100644
index 0000000..440cf4b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/ElseAfterReturnCheck.h
@@ -0,0 +1,45 @@
+//===--- ElseAfterReturnCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ELSEAFTERRETURNCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ELSEAFTERRETURNCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/DenseMap.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Flags the usages of `else` after `return`.
+///
+/// http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
+class ElseAfterReturnCheck : public ClangTidyCheck {
+public:
+ ElseAfterReturnCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+ using ConditionalBranchMap =
+ llvm::DenseMap<FileID, SmallVector<SourceRange, 1>>;
+
+private:
+ const bool WarnOnUnfixable;
+ const bool WarnOnConditionVariables;
+ ConditionalBranchMap PPConditionals;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ELSEAFTERRETURNCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/FunctionCognitiveComplexityCheck.h b/linux-x64/clang/include/clang-tidy/readability/FunctionCognitiveComplexityCheck.h
new file mode 100644
index 0000000..96b6723
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/FunctionCognitiveComplexityCheck.h
@@ -0,0 +1,43 @@
+//===--- FunctionCognitiveComplexityCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONCOGNITIVECOMPLEXITYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONCOGNITIVECOMPLEXITYCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks function Cognitive Complexity metric.
+///
+/// There is only one configuration option:
+///
+/// * `Threshold` - flag functions with Cognitive Complexity exceeding
+/// this number. The default is `25`.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-function-cognitive-complexity.html
+class FunctionCognitiveComplexityCheck : public ClangTidyCheck {
+public:
+ FunctionCognitiveComplexityCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const unsigned Threshold;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONCOGNITIVECOMPLEXITYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/FunctionSizeCheck.h b/linux-x64/clang/include/clang-tidy/readability/FunctionSizeCheck.h
new file mode 100644
index 0000000..d85dbc9
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/FunctionSizeCheck.h
@@ -0,0 +1,58 @@
+//===--- FunctionSizeCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks for large functions based on various metrics.
+///
+/// These options are supported:
+///
+/// * `LineThreshold` - flag functions exceeding this number of lines. The
+/// default is `-1` (ignore the number of lines).
+/// * `StatementThreshold` - flag functions exceeding this number of
+/// statements. This may differ significantly from the number of lines for
+/// macro-heavy code. The default is `800`.
+/// * `BranchThreshold` - flag functions exceeding this number of control
+/// statements. The default is `-1` (ignore the number of branches).
+/// * `ParameterThreshold` - flag functions having a high number of
+/// parameters. The default is `-1` (ignore the number of parameters).
+/// * `NestingThreshold` - flag compound statements which create next nesting
+/// level after `NestingThreshold`. This may differ significantly from the
+/// expected value for macro-heavy code. The default is `-1` (ignore the
+/// nesting level).
+/// * `VariableThreshold` - flag functions having a high number of variable
+/// declarations. The default is `-1` (ignore the number of variables).
+class FunctionSizeCheck : public ClangTidyCheck {
+public:
+ FunctionSizeCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const unsigned LineThreshold;
+ const unsigned StatementThreshold;
+ const unsigned BranchThreshold;
+ const unsigned ParameterThreshold;
+ const unsigned NestingThreshold;
+ const unsigned VariableThreshold;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/IdentifierNamingCheck.h b/linux-x64/clang/include/clang-tidy/readability/IdentifierNamingCheck.h
new file mode 100644
index 0000000..565eb9d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/IdentifierNamingCheck.h
@@ -0,0 +1,121 @@
+//===--- IdentifierNamingCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
+
+#include "../utils/RenamerClangTidyCheck.h"
+#include "llvm/ADT/Optional.h"
+namespace clang {
+
+class MacroInfo;
+
+namespace tidy {
+namespace readability {
+
+/// Checks for identifiers naming style mismatch.
+///
+/// This check will try to enforce coding guidelines on the identifiers naming.
+/// It supports `lower_case`, `UPPER_CASE`, `camelBack` and `CamelCase` casing
+/// and tries to convert from one to another if a mismatch is detected.
+///
+/// It also supports a fixed prefix and suffix that will be prepended or
+/// appended to the identifiers, regardless of the casing.
+///
+/// Many configuration options are available, in order to be able to create
+/// different rules for different kind of identifier. In general, the
+/// rules are falling back to a more generic rule if the specific case is not
+/// configured.
+class IdentifierNamingCheck final : public RenamerClangTidyCheck {
+public:
+ IdentifierNamingCheck(StringRef Name, ClangTidyContext *Context);
+ ~IdentifierNamingCheck();
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ enum CaseType {
+ CT_AnyCase = 0,
+ CT_LowerCase,
+ CT_CamelBack,
+ CT_UpperCase,
+ CT_CamelCase,
+ CT_CamelSnakeCase,
+ CT_CamelSnakeBack
+ };
+
+ struct NamingStyle {
+ NamingStyle() = default;
+
+ NamingStyle(llvm::Optional<CaseType> Case, const std::string &Prefix,
+ const std::string &Suffix, const std::string &IgnoredRegexpStr);
+ NamingStyle(const NamingStyle &O) = delete;
+ NamingStyle &operator=(NamingStyle &&O) = default;
+ NamingStyle(NamingStyle &&O) = default;
+
+ llvm::Optional<CaseType> Case;
+ std::string Prefix;
+ std::string Suffix;
+ // Store both compiled and non-compiled forms so original value can be
+ // serialized
+ llvm::Regex IgnoredRegexp;
+ std::string IgnoredRegexpStr;
+ };
+
+ struct FileStyle {
+ FileStyle() : IsActive(false), IgnoreMainLikeFunctions(false) {}
+ FileStyle(SmallVectorImpl<Optional<NamingStyle>> &&Styles,
+ bool IgnoreMainLike)
+ : Styles(std::move(Styles)), IsActive(true),
+ IgnoreMainLikeFunctions(IgnoreMainLike) {}
+
+ ArrayRef<Optional<NamingStyle>> getStyles() const {
+ assert(IsActive);
+ return Styles;
+ }
+ bool isActive() const { return IsActive; }
+ bool isIgnoringMainLikeFunction() const { return IgnoreMainLikeFunctions; }
+
+ private:
+ SmallVector<Optional<NamingStyle>, 0> Styles;
+ bool IsActive;
+ bool IgnoreMainLikeFunctions;
+ };
+
+private:
+ llvm::Optional<FailureInfo>
+ GetDeclFailureInfo(const NamedDecl *Decl,
+ const SourceManager &SM) const override;
+ llvm::Optional<FailureInfo>
+ GetMacroFailureInfo(const Token &MacroNameTok,
+ const SourceManager &SM) const override;
+ DiagInfo GetDiagInfo(const NamingCheckId &ID,
+ const NamingCheckFailure &Failure) const override;
+
+ const FileStyle &getStyleForFile(StringRef FileName) const;
+
+ /// Stores the style options as a vector, indexed by the specified \ref
+ /// StyleKind, for a given directory.
+ mutable llvm::StringMap<FileStyle> NamingStylesCache;
+ FileStyle *MainFileStyle;
+ ClangTidyContext *const Context;
+ const std::string CheckName;
+ const bool GetConfigPerFile;
+ const bool IgnoreFailedSplit;
+};
+
+} // namespace readability
+template <>
+struct OptionEnumMapping<readability::IdentifierNamingCheck::CaseType> {
+ static llvm::ArrayRef<
+ std::pair<readability::IdentifierNamingCheck::CaseType, StringRef>>
+ getEnumMapping();
+};
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IDENTIFIERNAMINGCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/ImplicitBoolConversionCheck.h b/linux-x64/clang/include/clang-tidy/readability/ImplicitBoolConversionCheck.h
new file mode 100644
index 0000000..03abeaf
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/ImplicitBoolConversionCheck.h
@@ -0,0 +1,47 @@
+//===--- ImplicitBoolConversionCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CONVERSION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CONVERSION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks for use of implicit bool conversions in expressions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html
+class ImplicitBoolConversionCheck : public ClangTidyCheck {
+public:
+ ImplicitBoolConversionCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.Bool;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void handleCastToBool(const ImplicitCastExpr *CastExpression,
+ const Stmt *ParentStatement, ASTContext &Context);
+ void handleCastFromBool(const ImplicitCastExpr *CastExpression,
+ const ImplicitCastExpr *FurtherImplicitCastExpression,
+ ASTContext &Context);
+
+ const bool AllowIntegerConditions;
+ const bool AllowPointerConditions;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_IMPLICIT_BOOL_CONVERSION_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.h b/linux-x64/clang/include/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.h
new file mode 100644
index 0000000..aac2f50
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.h
@@ -0,0 +1,49 @@
+//===- InconsistentDeclarationParameterNameCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_INCONSISTENT_DECLARATION_PARAMETER_NAME_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_INCONSISTENT_DECLARATION_PARAMETER_NAME_H
+
+#include "../ClangTidyCheck.h"
+
+#include "llvm/ADT/DenseSet.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks for declarations of functions which differ in parameter names.
+///
+/// For detailed documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.html
+///
+class InconsistentDeclarationParameterNameCheck : public ClangTidyCheck {
+public:
+ InconsistentDeclarationParameterNameCheck(StringRef Name,
+ ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ IgnoreMacros(Options.getLocalOrGlobal("IgnoreMacros", true)),
+ Strict(Options.getLocalOrGlobal("Strict", false)) {}
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void markRedeclarationsAsVisited(const FunctionDecl *FunctionDeclaration);
+
+ llvm::DenseSet<const FunctionDecl *> VisitedDeclarations;
+ const bool IgnoreMacros;
+ const bool Strict;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_INCONSISTENT_DECLARATION_PARAMETER_NAME_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/IsolateDeclarationCheck.h b/linux-x64/clang/include/clang-tidy/readability/IsolateDeclarationCheck.h
new file mode 100644
index 0000000..29f547e
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/IsolateDeclarationCheck.h
@@ -0,0 +1,35 @@
+//===--- IsolateDeclarationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ISOLATEDECLCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ISOLATEDECLCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// This check diagnoses all DeclStmt's declaring more than one variable and
+/// tries to refactor the code to one statement per declaration.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-isolate-declaration.html
+class IsolateDeclarationCheck : public ClangTidyCheck {
+public:
+ IsolateDeclarationCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ISOLATEDECLCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/MagicNumbersCheck.h b/linux-x64/clang/include/clang-tidy/readability/MagicNumbersCheck.h
new file mode 100644
index 0000000..9612fd7
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/MagicNumbersCheck.h
@@ -0,0 +1,109 @@
+//===--- MagicNumbersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MAGICNUMBERSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MAGICNUMBERSCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "clang/Lex/Lexer.h"
+#include <llvm/ADT/APFloat.h>
+#include <llvm/ADT/SmallVector.h>
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Detects magic numbers, integer and floating point literals embedded in code.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-magic-numbers.html
+class MagicNumbersCheck : public ClangTidyCheck {
+public:
+ MagicNumbersCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ bool isConstant(const clang::ast_matchers::MatchFinder::MatchResult &Result,
+ const clang::Expr &ExprResult) const;
+
+ bool isIgnoredValue(const IntegerLiteral *Literal) const;
+ bool isIgnoredValue(const FloatingLiteral *Literal) const;
+
+ bool isSyntheticValue(const clang::SourceManager *,
+ const FloatingLiteral *) const {
+ return false;
+ }
+ bool isSyntheticValue(const clang::SourceManager *SourceManager,
+ const IntegerLiteral *Literal) const;
+
+ bool isBitFieldWidth(const clang::ast_matchers::MatchFinder::MatchResult &,
+ const FloatingLiteral &) const {
+ return false;
+ }
+
+ bool isBitFieldWidth(const clang::ast_matchers::MatchFinder::MatchResult &Result,
+ const IntegerLiteral &Literal) const;
+
+ template <typename L>
+ void checkBoundMatch(const ast_matchers::MatchFinder::MatchResult &Result,
+ const char *BoundName) {
+ const L *MatchedLiteral = Result.Nodes.getNodeAs<L>(BoundName);
+ if (!MatchedLiteral)
+ return;
+
+ if (Result.SourceManager->isMacroBodyExpansion(
+ MatchedLiteral->getLocation()))
+ return;
+
+ if (isIgnoredValue(MatchedLiteral))
+ return;
+
+ if (isConstant(Result, *MatchedLiteral))
+ return;
+
+ if (isSyntheticValue(Result.SourceManager, MatchedLiteral))
+ return;
+
+ if (isBitFieldWidth(Result, *MatchedLiteral))
+ return;
+
+ const StringRef LiteralSourceText = Lexer::getSourceText(
+ CharSourceRange::getTokenRange(MatchedLiteral->getSourceRange()),
+ *Result.SourceManager, getLangOpts());
+
+ diag(MatchedLiteral->getLocation(),
+ "%0 is a magic number; consider replacing it with a named constant")
+ << LiteralSourceText;
+ }
+
+ const bool IgnoreAllFloatingPointValues;
+ const bool IgnoreBitFieldsWidths;
+ const bool IgnorePowersOf2IntegerValues;
+ const std::string RawIgnoredIntegerValues;
+ const std::string RawIgnoredFloatingPointValues;
+
+ constexpr static unsigned SensibleNumberOfMagicValueExceptions = 16;
+
+ constexpr static llvm::APFloat::roundingMode DefaultRoundingMode =
+ llvm::APFloat::rmNearestTiesToEven;
+
+ llvm::SmallVector<int64_t, SensibleNumberOfMagicValueExceptions>
+ IgnoredIntegerValues;
+ llvm::SmallVector<float, SensibleNumberOfMagicValueExceptions>
+ IgnoredFloatingPointValues;
+ llvm::SmallVector<double, SensibleNumberOfMagicValueExceptions>
+ IgnoredDoublePointValues;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MAGICNUMBERSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/MakeMemberFunctionConstCheck.h b/linux-x64/clang/include/clang-tidy/readability/MakeMemberFunctionConstCheck.h
new file mode 100644
index 0000000..f07f66b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/MakeMemberFunctionConstCheck.h
@@ -0,0 +1,37 @@
+//===--- MakeMemberFunctionConstCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MAKEMEMBERFUNCTIONCONSTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MAKEMEMBERFUNCTIONCONSTCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds non-static member functions that can be made 'const'.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-make-member-function-const.html
+class MakeMemberFunctionConstCheck : public ClangTidyCheck {
+public:
+ MakeMemberFunctionConstCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MAKEMEMBERFUNCTIONCONSTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/MisleadingIndentationCheck.h b/linux-x64/clang/include/clang-tidy/readability/MisleadingIndentationCheck.h
new file mode 100644
index 0000000..ed5ba5b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/MisleadingIndentationCheck.h
@@ -0,0 +1,41 @@
+//===--- MisleadingIndentationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MISLEADING_INDENTATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MISLEADING_INDENTATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks the code for dangling else, and possible misleading indentations due
+/// to missing braces. Note that this check only works as expected when the tabs
+/// or spaces are used consistently and not mixed.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-misleading-indentation.html
+class MisleadingIndentationCheck : public ClangTidyCheck {
+public:
+ MisleadingIndentationCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void danglingElseCheck(const SourceManager &SM, ASTContext *Context,
+ const IfStmt *If);
+ void missingBracesCheck(const SourceManager &SM, const CompoundStmt *CStmt);
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MISLEADING_INDENTATION_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/MisplacedArrayIndexCheck.h b/linux-x64/clang/include/clang-tidy/readability/MisplacedArrayIndexCheck.h
new file mode 100644
index 0000000..e4256b5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/MisplacedArrayIndexCheck.h
@@ -0,0 +1,35 @@
+//===--- MisplacedArrayIndexCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MISPLACED_ARRAY_INDEX_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MISPLACED_ARRAY_INDEX_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Warn about unusual array index syntax (`index[array]` instead of
+/// `array[index]`).
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-misplaced-array-index.html
+class MisplacedArrayIndexCheck : public ClangTidyCheck {
+public:
+ MisplacedArrayIndexCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_MISPLACED_ARRAY_INDEX_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/NamedParameterCheck.h b/linux-x64/clang/include/clang-tidy/readability/NamedParameterCheck.h
new file mode 100644
index 0000000..33a51b4
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/NamedParameterCheck.h
@@ -0,0 +1,41 @@
+//===--- NamedParameterCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Find functions with unnamed arguments.
+///
+/// The check implements the following rule originating in the Google C++ Style
+/// Guide:
+///
+/// https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
+///
+/// All parameters should be named, with identical names in the declaration and
+/// implementation.
+///
+/// Corresponding cpplint.py check name: 'readability/function'.
+class NamedParameterCheck : public ClangTidyCheck {
+public:
+ NamedParameterCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/NamespaceCommentCheck.h b/linux-x64/clang/include/clang-tidy/readability/NamespaceCommentCheck.h
new file mode 100644
index 0000000..84ece64
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/NamespaceCommentCheck.h
@@ -0,0 +1,46 @@
+//===--- NamespaceCommentCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/Support/Regex.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks that long namespaces have a closing comment.
+///
+/// http://llvm.org/docs/CodingStandards.html#namespace-indentation
+///
+/// https://google.github.io/styleguide/cppguide.html#Namespaces
+class NamespaceCommentCheck : public ClangTidyCheck {
+public:
+ NamespaceCommentCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void storeOptions(ClangTidyOptions::OptionMap &Options) override;
+
+ llvm::Regex NamespaceCommentPattern;
+ const unsigned ShortNamespaceLines;
+ const unsigned SpacesBeforeComments;
+ llvm::SmallVector<SourceLocation, 4> Ends;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMESPACECOMMENTCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/NonConstParameterCheck.h b/linux-x64/clang/include/clang-tidy/readability/NonConstParameterCheck.h
new file mode 100644
index 0000000..39959e6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/NonConstParameterCheck.h
@@ -0,0 +1,63 @@
+//===--- NonConstParameterCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NON_CONST_PARAMETER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NON_CONST_PARAMETER_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Warn when a pointer function parameter can be const.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-non-const-parameter.html
+class NonConstParameterCheck : public ClangTidyCheck {
+public:
+ NonConstParameterCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void onEndOfTranslationUnit() override;
+
+private:
+ /// Parameter info.
+ struct ParmInfo {
+ /// Is function parameter referenced?
+ bool IsReferenced;
+
+ /// Can function parameter be const?
+ bool CanBeConst;
+ };
+
+ /// Track all nonconst integer/float parameters.
+ std::map<const ParmVarDecl *, ParmInfo> Parameters;
+
+ /// Add function parameter.
+ void addParm(const ParmVarDecl *Parm);
+
+ /// Set IsReferenced.
+ void setReferenced(const DeclRefExpr *Ref);
+
+ /// Set CanNotBeConst.
+ /// Visits sub expressions recursively. If a DeclRefExpr is found
+ /// and CanNotBeConst is true the Parameter is marked as not-const.
+ /// The CanNotBeConst is updated as sub expressions are visited.
+ void markCanNotBeConst(const Expr *E, bool CanNotBeConst);
+
+ /// Diagnose non const parameters.
+ void diagnoseNonConstParameters();
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NON_CONST_PARAMETER_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/QualifiedAutoCheck.h b/linux-x64/clang/include/clang-tidy/readability/QualifiedAutoCheck.h
new file mode 100644
index 0000000..d327bf6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/QualifiedAutoCheck.h
@@ -0,0 +1,44 @@
+//===--- QualifiedAutoCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_QUALIFIEDAUTOCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_QUALIFIEDAUTOCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds variables declared as auto that could be declared as:
+/// 'auto*' or 'const auto *' and reference variables declared as:
+/// 'const auto &'.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-qualified-auto.html
+class QualifiedAutoCheck : public ClangTidyCheck {
+public:
+ QualifiedAutoCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ AddConstToQualified(Options.get("AddConstToQualified", true)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool AddConstToQualified;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_QUALIFIEDAUTOCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantAccessSpecifiersCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantAccessSpecifiersCheck.h
new file mode 100644
index 0000000..507687f
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantAccessSpecifiersCheck.h
@@ -0,0 +1,42 @@
+//===--- RedundantAccessSpecifiersCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTACCESSSPECIFIERSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTACCESSSPECIFIERSCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Detects redundant access specifiers inside classes, structs, and unions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-access-specifiers.html
+class RedundantAccessSpecifiersCheck : public ClangTidyCheck {
+public:
+ RedundantAccessSpecifiersCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ CheckFirstDeclaration(
+ Options.getLocalOrGlobal("CheckFirstDeclaration", false)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool CheckFirstDeclaration;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTACCESSSPECIFIERSCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantControlFlowCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantControlFlowCheck.h
new file mode 100644
index 0000000..d4513e6
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantControlFlowCheck.h
@@ -0,0 +1,50 @@
+//===--- RedundantControlFlowCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_CONTROL_FLOW_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_CONTROL_FLOW_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Eliminates redundant `return` statements at the end of a function that
+/// returns `void`.
+///
+/// Eliminates redundant `continue` statements at the end of a loop body.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-control-flow.html
+class RedundantControlFlowCheck : public ClangTidyCheck {
+public:
+ RedundantControlFlowCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ void
+ checkRedundantReturn(const ast_matchers::MatchFinder::MatchResult &Result,
+ const CompoundStmt *Block);
+
+ void
+ checkRedundantContinue(const ast_matchers::MatchFinder::MatchResult &Result,
+ const CompoundStmt *Block);
+
+ void issueDiagnostic(const ast_matchers::MatchFinder::MatchResult &Result,
+ const CompoundStmt *Block, const SourceRange &StmtRange,
+ const char *Diag);
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_CONTROL_FLOW_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantDeclarationCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantDeclarationCheck.h
new file mode 100644
index 0000000..4b4b2a1
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantDeclarationCheck.h
@@ -0,0 +1,37 @@
+//===--- RedundantDeclarationCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_DECLARATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_DECLARATION_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Find redundant variable declarations.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-declaration.html
+class RedundantDeclarationCheck : public ClangTidyCheck {
+public:
+ RedundantDeclarationCheck(StringRef Name, ClangTidyContext *Context);
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool IgnoreMacros;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_DECLARATION_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
new file mode 100644
index 0000000..7a284b3
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.h
@@ -0,0 +1,34 @@
+//===--- RedundantFunctionPtrDereferenceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_FUNCTION_PTR_DEREFERENCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_FUNCTION_PTR_DEREFERENCE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Eliminate redundant dereferences of a function pointer.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-function-ptr-dereference.html
+class RedundantFunctionPtrDereferenceCheck : public ClangTidyCheck {
+public:
+ RedundantFunctionPtrDereferenceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_FUNCTION_PTR_DEREFERENCE_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantMemberInitCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantMemberInitCheck.h
new file mode 100644
index 0000000..9454278
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantMemberInitCheck.h
@@ -0,0 +1,44 @@
+//===--- RedundantMemberInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_MEMBER_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_MEMBER_INIT_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds member initializations that are unnecessary because the same default
+/// constructor would be called if they were not present.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-member-init.html
+class RedundantMemberInitCheck : public ClangTidyCheck {
+public:
+ RedundantMemberInitCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ IgnoreBaseInCopyConstructors(
+ Options.get("IgnoreBaseInCopyConstructors", false)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ bool IgnoreBaseInCopyConstructors;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_MEMBER_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantPreprocessorCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantPreprocessorCheck.h
new file mode 100644
index 0000000..af4ccaa
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantPreprocessorCheck.h
@@ -0,0 +1,35 @@
+//===--- RedundantPreprocessorCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTPREPROCESSORCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTPREPROCESSORCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// This check flags redundant preprocessor directives: nested directives with
+/// the same condition.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-preprocessor.html
+class RedundantPreprocessorCheck : public ClangTidyCheck {
+public:
+ RedundantPreprocessorCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTPREPROCESSORCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantSmartptrGetCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantSmartptrGetCheck.h
new file mode 100644
index 0000000..3214863
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantSmartptrGetCheck.h
@@ -0,0 +1,47 @@
+//===--- RedundantSmartptrGetCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Find and remove redundant calls to smart pointer's `.get()` method.
+///
+/// Examples:
+///
+/// \code
+/// ptr.get()->Foo() ==> ptr->Foo()
+/// *ptr.get() ==> *ptr
+/// *ptr->get() ==> **ptr
+/// \endcode
+class RedundantSmartptrGetCheck : public ClangTidyCheck {
+public:
+ RedundantSmartptrGetCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ IgnoreMacros(Options.getLocalOrGlobal("IgnoreMacros", true)) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool IgnoreMacros;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSMARTPTRGETCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantStringCStrCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantStringCStrCheck.h
new file mode 100644
index 0000000..c808f2a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantStringCStrCheck.h
@@ -0,0 +1,34 @@
+//===--- RedundantStringCStrCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSTRINGCSTRCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSTRINGCSTRCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds unnecessary calls to `std::string::c_str()`.
+class RedundantStringCStrCheck : public ClangTidyCheck {
+public:
+ RedundantStringCStrCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANTSTRINGCSTRCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/RedundantStringInitCheck.h b/linux-x64/clang/include/clang-tidy/readability/RedundantStringInitCheck.h
new file mode 100644
index 0000000..bf694fd
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/RedundantStringInitCheck.h
@@ -0,0 +1,39 @@
+//===- RedundantStringInitCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_STRING_INIT_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_STRING_INIT_H
+
+#include "../ClangTidyCheck.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds unnecessary string initializations.
+class RedundantStringInitCheck : public ClangTidyCheck {
+public:
+ RedundantStringInitCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ std::vector<std::string> StringNames;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_REDUNDANT_STRING_INIT_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/SimplifyBooleanExprCheck.h b/linux-x64/clang/include/clang-tidy/readability/SimplifyBooleanExprCheck.h
new file mode 100644
index 0000000..af9017d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/SimplifyBooleanExprCheck.h
@@ -0,0 +1,89 @@
+//===--- SimplifyBooleanExpr.h 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_SIMPLIFY_BOOLEAN_EXPR_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_SIMPLIFY_BOOLEAN_EXPR_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Looks for boolean expressions involving boolean constants and simplifies
+/// them to use the appropriate boolean expression directly.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-simplify-boolean-expr.html
+class SimplifyBooleanExprCheck : public ClangTidyCheck {
+public:
+ SimplifyBooleanExprCheck(StringRef Name, ClangTidyContext *Context);
+
+ void storeOptions(ClangTidyOptions::OptionMap &Options) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ class Visitor;
+
+ void reportBinOp(const ast_matchers::MatchFinder::MatchResult &Result,
+ const BinaryOperator *Op);
+
+ void matchBoolCondition(ast_matchers::MatchFinder *Finder, bool Value,
+ StringRef BooleanId);
+
+ void matchTernaryResult(ast_matchers::MatchFinder *Finder, bool Value,
+ StringRef TernaryId);
+
+ void matchIfReturnsBool(ast_matchers::MatchFinder *Finder, bool Value,
+ StringRef Id);
+
+ void matchIfAssignsBool(ast_matchers::MatchFinder *Finder, bool Value,
+ StringRef Id);
+
+ void matchCompoundIfReturnsBool(ast_matchers::MatchFinder *Finder, bool Value,
+ StringRef Id);
+
+ void
+ replaceWithThenStatement(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr *BoolLiteral);
+
+ void
+ replaceWithElseStatement(const ast_matchers::MatchFinder::MatchResult &Result,
+ const Expr *FalseConditionRemoved);
+
+ void
+ replaceWithCondition(const ast_matchers::MatchFinder::MatchResult &Result,
+ const ConditionalOperator *Ternary,
+ bool Negated = false);
+
+ void replaceWithReturnCondition(
+ const ast_matchers::MatchFinder::MatchResult &Result, const IfStmt *If,
+ bool Negated = false);
+
+ void
+ replaceWithAssignment(const ast_matchers::MatchFinder::MatchResult &Result,
+ const IfStmt *If, bool Negated = false);
+
+ void replaceCompoundReturnWithCondition(
+ const ast_matchers::MatchFinder::MatchResult &Result,
+ const CompoundStmt *Compound, bool Negated = false);
+
+ void issueDiag(const ast_matchers::MatchFinder::MatchResult &Result,
+ SourceLocation Loc, StringRef Description,
+ SourceRange ReplacementRange, StringRef Replacement);
+
+ const bool ChainedConditionalReturn;
+ const bool ChainedConditionalAssignment;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_SIMPLIFY_BOOLEAN_EXPR_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/SimplifySubscriptExprCheck.h b/linux-x64/clang/include/clang-tidy/readability/SimplifySubscriptExprCheck.h
new file mode 100644
index 0000000..4f43cdb
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/SimplifySubscriptExprCheck.h
@@ -0,0 +1,40 @@
+//===--- SimplifySubscriptExprCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_SIMPLIFYSUBSCRIPTEXPRCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_SIMPLIFYSUBSCRIPTEXPRCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Simplifies subscript expressions.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-simplify-subscript-expr.html
+class SimplifySubscriptExprCheck : public ClangTidyCheck {
+public:
+ SimplifySubscriptExprCheck(StringRef Name, ClangTidyContext *Context);
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap& Opts) override;
+
+private:
+ const std::vector<std::string> Types;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_SIMPLIFYSUBSCRIPTEXPRCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/StaticAccessedThroughInstanceCheck.h b/linux-x64/clang/include/clang-tidy/readability/StaticAccessedThroughInstanceCheck.h
new file mode 100644
index 0000000..d12e821
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/StaticAccessedThroughInstanceCheck.h
@@ -0,0 +1,42 @@
+//===--- StaticAccessedThroughInstanceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_ACCESSED_THROUGH_INSTANCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_ACCESSED_THROUGH_INSTANCE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Checks for member expressions that access static members through
+/// instances and replaces them with uses of the appropriate qualified-id.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-static-accessed-through-instance.html
+class StaticAccessedThroughInstanceCheck : public ClangTidyCheck {
+public:
+ StaticAccessedThroughInstanceCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ NameSpecifierNestingThreshold(
+ Options.get("NameSpecifierNestingThreshold", 3U)) {}
+
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const unsigned NameSpecifierNestingThreshold;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_ACCESSED_THROUGH_INSTANCE_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.h b/linux-x64/clang/include/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.h
new file mode 100644
index 0000000..18f93b8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.h
@@ -0,0 +1,35 @@
+//===--- StaticDefinitionInAnonymousNamespaceCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_DEFINITION_IN_ANONYMOUS_NAMESPACE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_DEFINITION_IN_ANONYMOUS_NAMESPACE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds static function and variable definitions in anonymous namespace.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-static-definition-in-anonymous-namespace.html
+class StaticDefinitionInAnonymousNamespaceCheck : public ClangTidyCheck {
+public:
+ StaticDefinitionInAnonymousNamespaceCheck(StringRef Name,
+ ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_DEFINITION_IN_ANONYMOUS_NAMESPACE_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/StringCompareCheck.h b/linux-x64/clang/include/clang-tidy/readability/StringCompareCheck.h
new file mode 100644
index 0000000..3d2a3ab
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/StringCompareCheck.h
@@ -0,0 +1,38 @@
+//===--- StringCompareCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STRINGCOMPARECHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STRINGCOMPARECHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// This check flags all calls compare when used to check for string
+/// equality or inequality.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-string-compare.html
+class StringCompareCheck : public ClangTidyCheck {
+public:
+ StringCompareCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus;
+ }
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STRINGCOMPARECHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h b/linux-x64/clang/include/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h
new file mode 100644
index 0000000..3e6f184
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h
@@ -0,0 +1,35 @@
+//===--- UniqueptrDeleteReleaseCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_UNIQUEPTR_DELETE_RELEASE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_UNIQUEPTR_DELETE_RELEASE_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Flags statements of the form ``delete <unique_ptr expr>.release();`` and
+/// replaces them with: ``<unique_ptr expr> = nullptr;``
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-uniqueptr-delete-release.html
+class UniqueptrDeleteReleaseCheck : public ClangTidyCheck {
+public:
+ UniqueptrDeleteReleaseCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context) {}
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_UNIQUEPTR_DELETE_RELEASE_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/UppercaseLiteralSuffixCheck.h b/linux-x64/clang/include/clang-tidy/readability/UppercaseLiteralSuffixCheck.h
new file mode 100644
index 0000000..c31fc06
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/UppercaseLiteralSuffixCheck.h
@@ -0,0 +1,44 @@
+//===--- UppercaseLiteralSuffixCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_UPPERCASELITERALSUFFIXCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_UPPERCASELITERALSUFFIXCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/OptionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Detects when the integral literal or floating point literal has
+/// non-uppercase suffix, and suggests to make the suffix uppercase.
+/// Alternatively, a list of destination suffixes can be provided.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-uppercase-literal-suffix.html
+class UppercaseLiteralSuffixCheck : public ClangTidyCheck {
+public:
+ UppercaseLiteralSuffixCheck(StringRef Name, ClangTidyContext *Context);
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+private:
+ template <typename LiteralType>
+ bool checkBoundMatch(const ast_matchers::MatchFinder::MatchResult &Result);
+
+ const std::vector<std::string> NewSuffixes;
+ const bool IgnoreMacros;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_UPPERCASELITERALSUFFIXCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/readability/UseAnyOfAllOfCheck.h b/linux-x64/clang/include/clang-tidy/readability/UseAnyOfAllOfCheck.h
new file mode 100644
index 0000000..768fb52
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/readability/UseAnyOfAllOfCheck.h
@@ -0,0 +1,41 @@
+//===--- UseAnyOfAllOfCheck.h - clang-tidy-----------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/IncludeInserter.h"
+
+namespace clang {
+namespace tidy {
+namespace readability {
+
+/// Finds ranged-based for loops that can be replaced by a call to std::any_of
+/// or std::all_of.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/readability-use-anyofallof.html
+class UseAnyOfAllOfCheck : public ClangTidyCheck {
+public:
+ using ClangTidyCheck::ClangTidyCheck;
+
+ bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+ return LangOpts.CPlusPlus11;
+ }
+
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+};
+
+} // namespace readability
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_USEALGORITHMCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/tool/ClangTidyMain.h b/linux-x64/clang/include/clang-tidy/tool/ClangTidyMain.h
new file mode 100644
index 0000000..f87f84b
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/tool/ClangTidyMain.h
@@ -0,0 +1,23 @@
+//===--- tools/extra/clang-tidy/ClangTidyMain.h - Clang tidy tool -------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file This file declares the main function for the clang-tidy tool.
+///
+/// This tool uses the Clang Tooling infrastructure, see
+/// http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
+/// for details on setting it up with LLVM source tree.
+///
+//===----------------------------------------------------------------------===//
+
+namespace clang {
+namespace tidy {
+
+int clangTidyMain(int argc, const char **argv);
+
+} // namespace tidy
+} // namespace clang
diff --git a/linux-x64/clang/include/clang-tidy/utils/ASTUtils.h b/linux-x64/clang/include/clang-tidy/utils/ASTUtils.h
new file mode 100644
index 0000000..ad2a055
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/ASTUtils.h
@@ -0,0 +1,45 @@
+//===---------- ASTUtils.h - clang-tidy -----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H
+
+#include "clang/AST/AST.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+// Returns the (closest) Function declaration surrounding |Statement| or NULL.
+const FunctionDecl *getSurroundingFunction(ASTContext &Context,
+ const Stmt &Statement);
+// Determine whether Expr is a Binary or Ternary expression.
+bool IsBinaryOrTernary(const Expr *E);
+
+/// Checks whether a macro flag is present in the given argument. Only considers
+/// cases of single match or match in a binary OR expression. For example,
+/// <needed-flag> or <flag> | <needed-flag> | ...
+bool exprHasBitFlagWithSpelling(const Expr *Flags, const SourceManager &SM,
+ const LangOptions &LangOpts,
+ StringRef FlagName);
+
+// Check if the range is entirely contained within a macro argument.
+bool rangeIsEntirelyWithinMacroArgument(SourceRange Range,
+ const SourceManager *SM);
+
+// Check if the range contains any locations from a macro expansion.
+bool rangeContainsMacroExpansion(SourceRange Range, const SourceManager *SM);
+
+// Can a fix-it be issued for this whole Range?
+// FIXME: false-negative if the entire range is fully expanded from a macro.
+bool rangeCanBeFixed(SourceRange Range, const SourceManager *SM);
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/Aliasing.h b/linux-x64/clang/include/clang-tidy/utils/Aliasing.h
new file mode 100644
index 0000000..e43995a
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/Aliasing.h
@@ -0,0 +1,36 @@
+//===------------- Aliasing.h - clang-tidy --------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
+
+#include "clang/AST/Decl.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+/// Returns whether \p Var has a pointer or reference in \p Func.
+///
+/// Example:
+/// void f() {
+/// int n;
+/// ...
+/// int *p = &n;
+/// }
+///
+/// For `f()` and `n` the function returns ``true`` because `p` is a
+/// pointer to `n` created in `f()`.
+
+bool hasPtrOrReferenceInFunc(const FunctionDecl *Func, const VarDecl *Var);
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/DeclRefExprUtils.h b/linux-x64/clang/include/clang-tidy/utils/DeclRefExprUtils.h
new file mode 100644
index 0000000..abf3529
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/DeclRefExprUtils.h
@@ -0,0 +1,59 @@
+//===--- DeclRefExprUtils.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_DECLREFEXPRUTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_DECLREFEXPRUTILS_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Type.h"
+#include "llvm/ADT/SmallPtrSet.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+namespace decl_ref_expr {
+
+/// Returns true if all ``DeclRefExpr`` to the variable within ``Stmt``
+/// do not modify it.
+///
+/// Returns ``true`` if only const methods or operators are called on the
+/// variable or the variable is a const reference or value argument to a
+/// ``callExpr()``.
+bool isOnlyUsedAsConst(const VarDecl &Var, const Stmt &Stmt,
+ ASTContext &Context);
+
+/// Returns set of all ``DeclRefExprs`` to ``VarDecl`` within ``Stmt``.
+llvm::SmallPtrSet<const DeclRefExpr *, 16>
+allDeclRefExprs(const VarDecl &VarDecl, const Stmt &Stmt, ASTContext &Context);
+
+/// Returns set of all ``DeclRefExprs`` to ``VarDecl`` within ``Decl``.
+llvm::SmallPtrSet<const DeclRefExpr *, 16>
+allDeclRefExprs(const VarDecl &VarDecl, const Decl &Decl, ASTContext &Context);
+
+/// Returns set of all ``DeclRefExprs`` to ``VarDecl`` within ``Stmt`` where
+/// ``VarDecl`` is guaranteed to be accessed in a const fashion.
+llvm::SmallPtrSet<const DeclRefExpr *, 16>
+constReferenceDeclRefExprs(const VarDecl &VarDecl, const Stmt &Stmt,
+ ASTContext &Context);
+
+/// Returns ``true`` if ``DeclRefExpr`` is the argument of a copy-constructor
+/// call expression within ``Decl``.
+bool isCopyConstructorArgument(const DeclRefExpr &DeclRef, const Decl &Decl,
+ ASTContext &Context);
+
+/// Returns ``true`` if ``DeclRefExpr`` is the argument of a copy-assignment
+/// operator CallExpr within ``Decl``.
+bool isCopyAssignmentArgument(const DeclRefExpr &DeclRef, const Decl &Decl,
+ ASTContext &Context);
+
+} // namespace decl_ref_expr
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_DECLREFEXPRUTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/ExceptionAnalyzer.h b/linux-x64/clang/include/clang-tidy/utils/ExceptionAnalyzer.h
new file mode 100644
index 0000000..2ae08c8
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/ExceptionAnalyzer.h
@@ -0,0 +1,156 @@
+//===--- ExceptionAnalyzer.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_EXCEPTION_ANALYZER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_EXCEPTION_ANALYZER_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/StringSet.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+/// This class analysis if a `FunctionDecl` can in principle throw an
+/// exception, either directly or indirectly. It can be configured to ignore
+/// custom exception types.
+class ExceptionAnalyzer {
+public:
+ enum class State : std::int8_t {
+ Throwing = 0, ///< The function can definitely throw given an AST.
+ NotThrowing = 1, ///< This function can not throw, given an AST.
+ Unknown = 2, ///< This can happen for extern functions without available
+ ///< definition.
+ };
+
+ /// Bundle the gathered information about an entity like a function regarding
+ /// it's exception behaviour. The 'NonThrowing'-state can be considered as the
+ /// neutral element in terms of information propagation.
+ /// In the case of 'Throwing' state it is possible that 'getExceptionTypes'
+ /// does not include *ALL* possible types as there is the possibility that
+ /// an 'Unknown' function is called that might throw a previously unknown
+ /// exception at runtime.
+ class ExceptionInfo {
+ public:
+ using Throwables = llvm::SmallSet<const Type *, 2>;
+ static ExceptionInfo createUnknown() {
+ return ExceptionInfo(State::Unknown);
+ }
+ static ExceptionInfo createNonThrowing() {
+ return ExceptionInfo(State::Throwing);
+ }
+
+ /// By default the exception situation is unknown and must be
+ /// clarified step-wise.
+ ExceptionInfo() : Behaviour(State::NotThrowing), ContainsUnknown(false) {}
+ ExceptionInfo(State S)
+ : Behaviour(S), ContainsUnknown(S == State::Unknown) {}
+
+ ExceptionInfo(const ExceptionInfo &) = default;
+ ExceptionInfo &operator=(const ExceptionInfo &) = default;
+ ExceptionInfo(ExceptionInfo &&) = default;
+ ExceptionInfo &operator=(ExceptionInfo &&) = default;
+
+ State getBehaviour() const { return Behaviour; }
+
+ /// Register a single exception type as recognized potential exception to be
+ /// thrown.
+ void registerException(const Type *ExceptionType);
+
+ /// Registers a `SmallVector` of exception types as recognized potential
+ /// exceptions to be thrown.
+ void registerExceptions(const Throwables &Exceptions);
+
+ /// Updates the local state according to the other state. That means if
+ /// for example a function contains multiple statements the 'ExceptionInfo'
+ /// for the final function is the merged result of each statement.
+ /// If one of these statements throws the whole function throws and if one
+ /// part is unknown and the rest is non-throwing the result will be
+ /// unknown.
+ ExceptionInfo &merge(const ExceptionInfo &Other);
+
+ /// This method is useful in case 'catch' clauses are analyzed as it is
+ /// possible to catch multiple exception types by one 'catch' if they
+ /// are a subclass of the 'catch'ed exception type.
+ /// Returns 'true' if some exceptions were filtered, otherwise 'false'.
+ bool filterByCatch(const Type *BaseClass);
+
+ /// Filter the set of thrown exception type against a set of ignored
+ /// types that shall not be considered in the exception analysis.
+ /// This includes explicit `std::bad_alloc` ignoring as separate option.
+ ExceptionInfo &
+ filterIgnoredExceptions(const llvm::StringSet<> &IgnoredTypes,
+ bool IgnoreBadAlloc);
+
+ /// Clear the state to 'NonThrowing' to make the corresponding entity
+ /// neutral.
+ void clear();
+
+ /// References the set of known exception types that can escape from the
+ /// corresponding entity.
+ const Throwables &getExceptionTypes() const { return ThrownExceptions; }
+
+ /// Signal if the there is any 'Unknown' element within the scope of
+ /// the related entity. This might be relevant if the entity is 'Throwing'
+ /// and to ensure that no other exception then 'getExceptionTypes' can
+ /// occur. If there is an 'Unknown' element this can not be guaranteed.
+ bool containsUnknownElements() const { return ContainsUnknown; }
+
+ private:
+ /// Recalculate the 'Behaviour' for example after filtering.
+ void reevaluateBehaviour();
+
+ /// Keep track if the entity related to this 'ExceptionInfo' can in princple
+ /// throw, if it's unknown or if it won't throw.
+ State Behaviour;
+
+ /// Keep track if the entity contains any unknown elements to keep track
+ /// of the certainty of decisions and/or correct 'Behaviour' transition
+ /// after filtering.
+ bool ContainsUnknown;
+
+ /// 'ThrownException' is empty if the 'Behaviour' is either 'NotThrowing' or
+ /// 'Unknown'.
+ Throwables ThrownExceptions;
+ };
+
+ ExceptionAnalyzer() = default;
+
+ void ignoreBadAlloc(bool ShallIgnore) { IgnoreBadAlloc = ShallIgnore; }
+ void ignoreExceptions(llvm::StringSet<> ExceptionNames) {
+ IgnoredExceptions = std::move(ExceptionNames);
+ }
+
+ ExceptionInfo analyze(const FunctionDecl *Func);
+ ExceptionInfo analyze(const Stmt *Stmt);
+
+private:
+ ExceptionInfo
+ throwsException(const FunctionDecl *Func,
+ llvm::SmallSet<const FunctionDecl *, 32> &CallStack);
+ ExceptionInfo
+ throwsException(const Stmt *St, const ExceptionInfo::Throwables &Caught,
+ llvm::SmallSet<const FunctionDecl *, 32> &CallStack);
+
+ ExceptionInfo analyzeImpl(const FunctionDecl *Func);
+ ExceptionInfo analyzeImpl(const Stmt *Stmt);
+
+ template <typename T> ExceptionInfo analyzeDispatch(const T *Node);
+
+ bool IgnoreBadAlloc = true;
+ llvm::StringSet<> IgnoredExceptions;
+ std::map<const FunctionDecl *, ExceptionInfo> FunctionCache;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_EXCEPTION_ANALYZER_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/ExprSequence.h b/linux-x64/clang/include/clang-tidy/utils/ExprSequence.h
new file mode 100644
index 0000000..7bb87ad
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/ExprSequence.h
@@ -0,0 +1,124 @@
+//===------------- ExprSequence.h - clang-tidy ----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_EXPRSEQUENCE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_EXPRSEQUENCE_H
+
+#include "clang/Analysis/CFG.h"
+#include "clang/Lex/Lexer.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+
+#include "../ClangTidy.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+/// Provides information about the evaluation order of (sub-)expressions within
+/// a `CFGBlock`.
+///
+/// While a `CFGBlock` does contain individual `CFGElement`s for some
+/// sub-expressions, the order in which those `CFGElement`s appear reflects
+/// only one possible order in which the sub-expressions may be evaluated.
+/// However, we want to warn if any of the potential evaluation orders can lead
+/// to a use-after-move, not just the one contained in the `CFGBlock`.
+///
+/// This class implements only a simplified version of the C++ sequencing
+/// rules. The main limitation is that we do not distinguish between value
+/// computation and side effect -- see the "Implementation" section for more
+/// details.
+///
+/// Note: `SequenceChecker` from SemaChecking.cpp does a similar job (and much
+/// more thoroughly), but using it would require
+/// - Pulling `SequenceChecker` out into a header file (i.e. making it part of
+/// the API),
+/// - Removing the dependency of `SequenceChecker` on `Sema`, and
+/// - (Probably) modifying `SequenceChecker` to make it suitable to be used in
+/// this context.
+/// For the moment, it seems preferable to re-implement our own version of
+/// sequence checking that is special-cased to what we need here.
+///
+/// Implementation
+/// --------------
+///
+/// `ExprSequence` uses two types of sequencing edges between nodes in the AST:
+///
+/// - Every `Stmt` is assumed to be sequenced after its children. This is
+/// overly optimistic because the standard only states that value computations
+/// of operands are sequenced before the value computation of the operator,
+/// making no guarantees about side effects (in general).
+///
+/// For our purposes, this rule is sufficient, however, because this check is
+/// interested in operations on objects, which are generally performed through
+/// function calls (whether explicit and implicit). Function calls guarantee
+/// that the value computations and side effects for all function arguments
+/// are sequenced before the execution of the function.
+///
+/// - In addition, some `Stmt`s are known to be sequenced before or after
+/// their siblings. For example, the `Stmt`s that make up a `CompoundStmt`are
+/// all sequenced relative to each other. The function
+/// `getSequenceSuccessor()` implements these sequencing rules.
+class ExprSequence {
+public:
+ /// Initializes this `ExprSequence` with sequence information for the given
+ /// `CFG`. `Root` is the root statement the CFG was built from.
+ ExprSequence(const CFG *TheCFG, const Stmt *Root, ASTContext *TheContext);
+
+ /// Returns whether \p Before is sequenced before \p After.
+ bool inSequence(const Stmt *Before, const Stmt *After) const;
+
+ /// Returns whether \p After can potentially be evaluated after \p Before.
+ /// This is exactly equivalent to `!inSequence(After, Before)` but makes some
+ /// conditions read more naturally.
+ bool potentiallyAfter(const Stmt *After, const Stmt *Before) const;
+
+private:
+ // Returns the sibling of \p S (if any) that is directly sequenced after \p S,
+ // or nullptr if no such sibling exists. For example, if \p S is the child of
+ // a `CompoundStmt`, this would return the Stmt that directly follows \p S in
+ // the `CompoundStmt`.
+ //
+ // As the sequencing of many constructs that change control flow is already
+ // encoded in the `CFG`, this function only implements the sequencing rules
+ // for those constructs where sequencing cannot be inferred from the `CFG`.
+ const Stmt *getSequenceSuccessor(const Stmt *S) const;
+
+ const Stmt *resolveSyntheticStmt(const Stmt *S) const;
+
+ ASTContext *Context;
+ const Stmt *Root;
+
+ llvm::DenseMap<const Stmt *, const Stmt *> SyntheticStmtSourceMap;
+};
+
+/// Maps `Stmt`s to the `CFGBlock` that contains them. Some `Stmt`s may be
+/// contained in more than one `CFGBlock`; in this case, they are mapped to the
+/// innermost block (i.e. the one that is furthest from the root of the tree).
+class StmtToBlockMap {
+public:
+ /// Initializes the map for the given `CFG`.
+ StmtToBlockMap(const CFG *TheCFG, ASTContext *TheContext);
+
+ /// Returns the block that \p S is contained in. Some `Stmt`s may be contained
+ /// in more than one `CFGBlock`; in this case, this function returns the
+ /// innermost block (i.e. the one that is furthest from the root of the tree).
+ const CFGBlock *blockContainingStmt(const Stmt *S) const;
+
+private:
+ ASTContext *Context;
+
+ llvm::DenseMap<const Stmt *, const CFGBlock *> Map;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_EXPRSEQUENCE_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/FileExtensionsUtils.h b/linux-x64/clang/include/clang-tidy/utils/FileExtensionsUtils.h
new file mode 100644
index 0000000..26184a5
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/FileExtensionsUtils.h
@@ -0,0 +1,68 @@
+//===--- FileExtensionsUtils.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FILE_EXTENSIONS_UTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FILE_EXTENSIONS_UTILS_H
+
+#include "clang/Basic/SourceLocation.h"
+#include "clang/Basic/SourceManager.h"
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/StringRef.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+typedef llvm::SmallSet<llvm::StringRef, 5> FileExtensionsSet;
+
+/// Checks whether expansion location of \p Loc is in header file.
+bool isExpansionLocInHeaderFile(SourceLocation Loc, const SourceManager &SM,
+ const FileExtensionsSet &HeaderFileExtensions);
+
+/// Checks whether presumed location of \p Loc is in header file.
+bool isPresumedLocInHeaderFile(SourceLocation Loc, SourceManager &SM,
+ const FileExtensionsSet &HeaderFileExtensions);
+
+/// Checks whether spelling location of \p Loc is in header file.
+bool isSpellingLocInHeaderFile(SourceLocation Loc, SourceManager &SM,
+ const FileExtensionsSet &HeaderFileExtensions);
+
+/// Returns recommended default value for the list of header file
+/// extensions.
+inline StringRef defaultHeaderFileExtensions() { return ";h;hh;hpp;hxx"; }
+
+/// Returns recommended default value for the list of implementation file
+/// extensions.
+inline StringRef defaultImplementationFileExtensions() {
+ return "c;cc;cpp;cxx";
+}
+
+/// Returns recommended default value for the list of file extension
+/// delimiters.
+inline StringRef defaultFileExtensionDelimiters() { return ",;"; }
+
+/// Parses header file extensions from a semicolon-separated list.
+bool parseFileExtensions(StringRef AllFileExtensions,
+ FileExtensionsSet &FileExtensions,
+ StringRef Delimiters);
+
+/// Decides whether a file has a header file extension.
+/// Returns the file extension, if included in the provided set.
+llvm::Optional<StringRef>
+getFileExtension(StringRef FileName, const FileExtensionsSet &FileExtensions);
+
+/// Decides whether a file has one of the specified file extensions.
+bool isFileExtension(StringRef FileName,
+ const FileExtensionsSet &FileExtensions);
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FILE_EXTENSIONS_UTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/FixItHintUtils.h b/linux-x64/clang/include/clang-tidy/utils/FixItHintUtils.h
new file mode 100644
index 0000000..2f5a741
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/FixItHintUtils.h
@@ -0,0 +1,54 @@
+//===--- FixItHintUtils.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FIXITHINTUTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FIXITHINTUTILS_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Decl.h"
+#include "clang/Sema/DeclSpec.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+namespace fixit {
+
+/// Creates fix to make ``VarDecl`` a reference by adding ``&``.
+FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context);
+
+/// This enum defines where the qualifier shall be preferably added.
+enum class QualifierPolicy {
+ Left, // Add the qualifier always to the left side, if that is possible.
+ Right, // Add the qualifier always to the right side.
+};
+
+/// This enum defines which entity is the target for adding the qualifier. This
+/// makes only a difference for pointer-types. Other types behave identical
+/// for either value of \c ConstTarget.
+enum class QualifierTarget {
+ Pointee, /// Transforming a pointer attaches to the pointee and not the
+ /// pointer itself. For references and normal values this option has
+ /// no effect. `int * p = &i;` -> `const int * p = &i` or `int const
+ /// * p = &i`.
+ Value, /// Transforming pointers will consider the pointer itself.
+ /// `int * p = &i;` -> `int * const = &i`
+};
+
+/// \brief Creates fix to qualify ``VarDecl`` with the specified \c Qualifier.
+/// Requires that `Var` is isolated in written code like in `int foo = 42;`.
+Optional<FixItHint>
+addQualifierToVarDecl(const VarDecl &Var, const ASTContext &Context,
+ DeclSpec::TQ Qualifier,
+ QualifierTarget CT = QualifierTarget::Pointee,
+ QualifierPolicy CP = QualifierPolicy::Left);
+} // namespace fixit
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FIXITHINTUTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/HeaderGuard.h b/linux-x64/clang/include/clang-tidy/utils/HeaderGuard.h
new file mode 100644
index 0000000..86c0f3d
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/HeaderGuard.h
@@ -0,0 +1,67 @@
+//===--- HeaderGuard.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADERGUARD_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADERGUARD_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/FileExtensionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+/// Finds and fixes header guards.
+/// The check supports these options:
+/// - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extension should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+///
+/// For extension-less header files, using an empty string or leaving an
+/// empty string between ";" if there are other filename extensions.
+class HeaderGuardCheck : public ClangTidyCheck {
+public:
+ HeaderGuardCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ RawStringHeaderFileExtensions(Options.getLocalOrGlobal(
+ "HeaderFileExtensions", utils::defaultHeaderFileExtensions())) {
+ utils::parseFileExtensions(RawStringHeaderFileExtensions,
+ HeaderFileExtensions,
+ utils::defaultFileExtensionDelimiters());
+ }
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+
+ /// Returns ``true`` if the check should suggest inserting a trailing comment
+ /// on the ``#endif`` of the header guard. It will use the same name as
+ /// returned by ``HeaderGuardCheck::getHeaderGuard``.
+ virtual bool shouldSuggestEndifComment(StringRef Filename);
+ /// Returns ``true`` if the check should suggest changing an existing header
+ /// guard to the string returned by ``HeaderGuardCheck::getHeaderGuard``.
+ virtual bool shouldFixHeaderGuard(StringRef Filename);
+ /// Returns ``true`` if the check should add a header guard to the file
+ /// if it has none.
+ virtual bool shouldSuggestToAddHeaderGuard(StringRef Filename);
+ /// Returns a replacement for the ``#endif`` line with a comment mentioning
+ /// \p HeaderGuard. The replacement should start with ``endif``.
+ virtual std::string formatEndIf(StringRef HeaderGuard);
+ /// Gets the canonical header guard for a file.
+ virtual std::string getHeaderGuard(StringRef Filename,
+ StringRef OldGuard = StringRef()) = 0;
+
+private:
+ std::string RawStringHeaderFileExtensions;
+ utils::FileExtensionsSet HeaderFileExtensions;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADERGUARD_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/IncludeInserter.h b/linux-x64/clang/include/clang-tidy/utils/IncludeInserter.h
new file mode 100644
index 0000000..74903b2
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/IncludeInserter.h
@@ -0,0 +1,102 @@
+//===---------- IncludeInserter.h - clang-tidy ----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
+
+#include "IncludeSorter.h"
+#include "clang/Basic/Diagnostic.h"
+#include "llvm/ADT/StringSet.h"
+#include <memory>
+
+namespace clang {
+class Preprocessor;
+namespace tidy {
+namespace utils {
+
+/// Produces fixes to insert specified includes to source files, if not
+/// yet present.
+///
+/// ``IncludeInserter`` can be used in clang-tidy checks in the following way:
+/// \code
+/// #include "../ClangTidyCheck.h"
+/// #include "../utils/IncludeInserter.h"
+///
+/// namespace clang {
+/// namespace tidy {
+///
+/// class MyCheck : public ClangTidyCheck {
+/// public:
+/// void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+/// Preprocessor *ModuleExpanderPP) override {
+/// Inserter.registerPreprocessor(PP);
+/// }
+///
+/// void registerMatchers(ast_matchers::MatchFinder* Finder) override { ... }
+///
+/// void check(
+/// const ast_matchers::MatchFinder::MatchResult& Result) override {
+/// ...
+/// Inserter.createMainFileIncludeInsertion("path/to/Header.h");
+/// ...
+/// }
+///
+/// private:
+/// utils::IncludeInserter Inserter{utils::IncludeSorter::IS_Google};
+/// };
+/// } // namespace tidy
+/// } // namespace clang
+/// \endcode
+class IncludeInserter {
+public:
+ /// Initializes the IncludeInserter using the IncludeStyle \p Style.
+ /// In most cases the \p Style will be retrieved from the ClangTidyOptions
+ /// using \code
+ /// Options.getLocalOrGlobal("IncludeStyle", <DefaultStyle>)
+ /// \endcode
+ explicit IncludeInserter(IncludeSorter::IncludeStyle Style);
+
+ /// Registers this with the Preprocessor \p PP, must be called before this
+ /// class is used.
+ void registerPreprocessor(Preprocessor *PP);
+
+ /// Creates a \p Header inclusion directive fixit in the File \p FileID.
+ /// When \p Header is enclosed in angle brackets, uses angle brackets in the
+ /// inclusion directive, otherwise uses quotes.
+ /// Returns ``llvm::None`` on error or if the inclusion directive already
+ /// exists.
+ llvm::Optional<FixItHint> createIncludeInsertion(FileID FileID,
+ llvm::StringRef Header);
+
+ /// Creates a \p Header inclusion directive fixit in the main file.
+ /// When \p Header is enclosed in angle brackets, uses angle brackets in the
+ /// inclusion directive, otherwise uses quotes.
+ /// Returns ``llvm::None`` on error or if the inclusion directive already
+ /// exists.
+ llvm::Optional<FixItHint>
+ createMainFileIncludeInsertion(llvm::StringRef Header);
+
+ IncludeSorter::IncludeStyle getStyle() const { return Style; }
+
+private:
+ void addInclude(StringRef FileName, bool IsAngled,
+ SourceLocation HashLocation, SourceLocation EndLocation);
+
+ IncludeSorter &getOrCreate(FileID FileID);
+
+ llvm::DenseMap<FileID, std::unique_ptr<IncludeSorter>> IncludeSorterByFile;
+ llvm::DenseMap<FileID, llvm::StringSet<>> InsertedHeaders;
+ const SourceManager *SourceMgr{nullptr};
+ const IncludeSorter::IncludeStyle Style;
+ friend class IncludeInserterCallback;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDEINSERTER_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/IncludeSorter.h b/linux-x64/clang/include/clang-tidy/utils/IncludeSorter.h
new file mode 100644
index 0000000..a8cf18c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/IncludeSorter.h
@@ -0,0 +1,75 @@
+//===------------ IncludeSorter.h - clang-tidy ----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDESORTER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDESORTER_H
+
+#include "../ClangTidyCheck.h"
+#include <string>
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+/// Class used by ``IncludeInserterCallback`` to record the names of the
+/// inclusions in a given source file being processed and generate the necessary
+/// commands to sort the inclusions according to the precedence encoded in
+/// ``IncludeKinds``.
+class IncludeSorter {
+public:
+ /// Supported include styles.
+ enum IncludeStyle { IS_LLVM = 0, IS_Google = 1, IS_Google_ObjC };
+
+ /// The classifications of inclusions, in the order they should be sorted.
+ enum IncludeKinds {
+ IK_MainTUInclude = 0, ///< e.g. ``#include "foo.h"`` when editing foo.cc
+ IK_CSystemInclude = 1, ///< e.g. ``#include <stdio.h>``
+ IK_CXXSystemInclude = 2, ///< e.g. ``#include <vector>``
+ IK_NonSystemInclude = 3, ///< e.g. ``#include "bar.h"``
+ IK_GeneratedInclude = 4, ///< e.g. ``#include "bar.proto.h"``
+ IK_InvalidInclude = 5 ///< total number of valid ``IncludeKind``s
+ };
+
+ /// ``IncludeSorter`` constructor; takes the FileID and name of the file to be
+ /// processed by the sorter.
+ IncludeSorter(const SourceManager *SourceMgr, const FileID FileID,
+ StringRef FileName, IncludeStyle Style);
+
+ /// Adds the given include directive to the sorter.
+ void AddInclude(StringRef FileName, bool IsAngled,
+ SourceLocation HashLocation, SourceLocation EndLocation);
+
+ /// Creates a quoted inclusion directive in the right sort order. Returns None
+ /// on error or if header inclusion directive for header already exists.
+ Optional<FixItHint> CreateIncludeInsertion(StringRef FileName, bool IsAngled);
+
+private:
+ typedef SmallVector<SourceRange, 1> SourceRangeVector;
+
+ const SourceManager *SourceMgr;
+ const IncludeStyle Style;
+ FileID CurrentFileID;
+ /// The file name stripped of common suffixes.
+ StringRef CanonicalFile;
+ /// Locations of visited include directives.
+ SourceRangeVector SourceLocations;
+ /// Mapping from file name to #include locations.
+ llvm::StringMap<SourceRangeVector> IncludeLocations;
+ /// Includes sorted into buckets.
+ SmallVector<std::string, 1> IncludeBucket[IK_InvalidInclude];
+};
+
+} // namespace utils
+
+template <> struct OptionEnumMapping<utils::IncludeSorter::IncludeStyle> {
+ static ArrayRef<std::pair<utils::IncludeSorter::IncludeStyle, StringRef>>
+ getEnumMapping();
+};
+} // namespace tidy
+} // namespace clang
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_INCLUDESORTER_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/LexerUtils.h b/linux-x64/clang/include/clang-tidy/utils/LexerUtils.h
new file mode 100644
index 0000000..8781b05
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/LexerUtils.h
@@ -0,0 +1,112 @@
+//===--- LexerUtils.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_LEXER_UTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_LEXER_UTILS_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/Basic/TokenKinds.h"
+#include "clang/Lex/Lexer.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+namespace lexer {
+
+/// Returns previous token or ``tok::unknown`` if not found.
+Token getPreviousToken(SourceLocation Location, const SourceManager &SM,
+ const LangOptions &LangOpts, bool SkipComments = true);
+
+SourceLocation findPreviousTokenStart(SourceLocation Start,
+ const SourceManager &SM,
+ const LangOptions &LangOpts);
+
+SourceLocation findPreviousTokenKind(SourceLocation Start,
+ const SourceManager &SM,
+ const LangOptions &LangOpts,
+ tok::TokenKind TK);
+
+SourceLocation findNextTerminator(SourceLocation Start, const SourceManager &SM,
+ const LangOptions &LangOpts);
+
+template <typename TokenKind, typename... TokenKinds>
+SourceLocation findPreviousAnyTokenKind(SourceLocation Start,
+ const SourceManager &SM,
+ const LangOptions &LangOpts,
+ TokenKind TK, TokenKinds... TKs) {
+ if (Start.isInvalid() || Start.isMacroID())
+ return SourceLocation();
+ while (true) {
+ SourceLocation L = findPreviousTokenStart(Start, SM, LangOpts);
+ if (L.isInvalid() || L.isMacroID())
+ return SourceLocation();
+
+ Token T;
+ // Returning 'true' is used to signal failure to retrieve the token.
+ if (Lexer::getRawToken(L, T, SM, LangOpts, /*IgnoreWhiteSpace=*/true))
+ return SourceLocation();
+
+ if (T.isOneOf(TK, TKs...))
+ return T.getLocation();
+
+ Start = L;
+ }
+}
+
+template <typename TokenKind, typename... TokenKinds>
+SourceLocation findNextAnyTokenKind(SourceLocation Start,
+ const SourceManager &SM,
+ const LangOptions &LangOpts, TokenKind TK,
+ TokenKinds... TKs) {
+ while (true) {
+ Optional<Token> CurrentToken = Lexer::findNextToken(Start, SM, LangOpts);
+
+ if (!CurrentToken)
+ return SourceLocation();
+
+ Token PotentialMatch = *CurrentToken;
+ if (PotentialMatch.isOneOf(TK, TKs...))
+ return PotentialMatch.getLocation();
+
+ // If we reach the end of the file, and eof is not the target token, we stop
+ // the loop, otherwise we will get infinite loop (findNextToken will return
+ // eof on eof).
+ if (PotentialMatch.is(tok::eof))
+ return SourceLocation();
+ Start = PotentialMatch.getLastLoc();
+ }
+}
+
+// Finds next token that's not a comment.
+Optional<Token> findNextTokenSkippingComments(SourceLocation Start,
+ const SourceManager &SM,
+ const LangOptions &LangOpts);
+
+/// Re-lex the provide \p Range and return \c false if either a macro spans
+/// multiple tokens, a pre-processor directive or failure to retrieve the
+/// next token is found, otherwise \c true.
+bool rangeContainsExpansionsOrDirectives(SourceRange Range,
+ const SourceManager &SM,
+ const LangOptions &LangOpts);
+
+/// Assuming that ``Range`` spans a CVR-qualified type, returns the
+/// token in ``Range`` that is responsible for the qualification. ``Range``
+/// must be valid with respect to ``SM``. Returns ``None`` if no qualifying
+/// tokens are found.
+/// \note: doesn't support member function qualifiers.
+llvm::Optional<Token> getQualifyingToken(tok::TokenKind TK,
+ CharSourceRange Range,
+ const ASTContext &Context,
+ const SourceManager &SM);
+
+} // namespace lexer
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_LEXER_UTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/Matchers.h b/linux-x64/clang/include/clang-tidy/utils/Matchers.h
new file mode 100644
index 0000000..9b765ae
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/Matchers.h
@@ -0,0 +1,63 @@
+//===--- Matchers.h - clang-tidy-------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
+
+#include "TypeTraits.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
+
+namespace clang {
+namespace tidy {
+namespace matchers {
+
+AST_MATCHER(BinaryOperator, isRelationalOperator) {
+ return Node.isRelationalOp();
+}
+
+AST_MATCHER(BinaryOperator, isEqualityOperator) { return Node.isEqualityOp(); }
+
+AST_MATCHER(QualType, isExpensiveToCopy) {
+ llvm::Optional<bool> IsExpensive =
+ utils::type_traits::isExpensiveToCopy(Node, Finder->getASTContext());
+ return IsExpensive && *IsExpensive;
+}
+
+AST_MATCHER(RecordDecl, isTriviallyDefaultConstructible) {
+ return utils::type_traits::recordIsTriviallyDefaultConstructible(
+ Node, Finder->getASTContext());
+}
+
+AST_MATCHER(QualType, isTriviallyDestructible) {
+ return utils::type_traits::isTriviallyDestructible(Node);
+}
+
+// Returns QualType matcher for references to const.
+AST_MATCHER_FUNCTION(ast_matchers::TypeMatcher, isReferenceToConst) {
+ using namespace ast_matchers;
+ return referenceType(pointee(qualType(isConstQualified())));
+}
+
+// Returns QualType matcher for pointers to const.
+AST_MATCHER_FUNCTION(ast_matchers::TypeMatcher, isPointerToConst) {
+ using namespace ast_matchers;
+ return pointerType(pointee(qualType(isConstQualified())));
+}
+
+AST_MATCHER_P(NamedDecl, matchesAnyListedName, std::vector<std::string>,
+ NameList) {
+ return llvm::any_of(NameList, [&Node](const std::string &Name) {
+ return llvm::Regex(Name).match(Node.getName());
+ });
+}
+
+} // namespace matchers
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/NamespaceAliaser.h b/linux-x64/clang/include/clang-tidy/utils/NamespaceAliaser.h
new file mode 100644
index 0000000..ab1b978
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/NamespaceAliaser.h
@@ -0,0 +1,51 @@
+//===---------- NamespaceAliaser.h - clang-tidy ---------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NAMESPACEALIASER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NAMESPACEALIASER_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Stmt.h"
+#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/SourceManager.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/StringMap.h"
+#include <map>
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+// This class creates function-level namespace aliases.
+class NamespaceAliaser {
+public:
+ explicit NamespaceAliaser(const SourceManager &SourceMgr);
+ // Adds a namespace alias for \p Namespace valid near \p
+ // Statement. Picks the first available name from \p Abbreviations.
+ // Returns ``llvm::None`` if an alias already exists or there is an error.
+ llvm::Optional<FixItHint>
+ createAlias(ASTContext &Context, const Stmt &Statement,
+ llvm::StringRef Namespace,
+ const std::vector<std::string> &Abbreviations);
+
+ // Get an alias name for \p Namespace valid at \p Statement. Returns \p
+ // Namespace if there is no alias.
+ std::string getNamespaceName(ASTContext &Context, const Stmt &Statement,
+ llvm::StringRef Namespace) const;
+
+private:
+ const SourceManager &SourceMgr;
+ llvm::DenseMap<const FunctionDecl *, llvm::StringMap<std::string>>
+ AddedAliases;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_NAMESPACEALIASER_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/OptionsUtils.h b/linux-x64/clang/include/clang-tidy/utils/OptionsUtils.h
new file mode 100644
index 0000000..5f83747
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/OptionsUtils.h
@@ -0,0 +1,31 @@
+//===--- DanglingHandleCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_OPTIONUTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_OPTIONUTILS_H
+
+#include "../ClangTidy.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+namespace options {
+
+/// Parse a semicolon separated list of strings.
+std::vector<std::string> parseStringList(StringRef Option);
+
+/// Serialize a sequence of names that can be parsed by
+/// ``parseStringList``.
+std::string serializeStringList(ArrayRef<std::string> Strings);
+
+} // namespace options
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_OPTIONUTILS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/RenamerClangTidyCheck.h b/linux-x64/clang/include/clang-tidy/utils/RenamerClangTidyCheck.h
new file mode 100644
index 0000000..fd5b320
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/RenamerClangTidyCheck.h
@@ -0,0 +1,165 @@
+//===--- RenamderClangTidyCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_RENAMERCLANGTIDYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_RENAMERCLANGTIDYCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/FunctionExtras.h"
+#include "llvm/ADT/Optional.h"
+#include <string>
+#include <utility>
+
+namespace clang {
+
+class MacroInfo;
+
+namespace tidy {
+
+/// Base class for clang-tidy checks that want to flag declarations and/or
+/// macros for renaming based on customizable criteria.
+class RenamerClangTidyCheck : public ClangTidyCheck {
+public:
+ RenamerClangTidyCheck(StringRef CheckName, ClangTidyContext *Context);
+ ~RenamerClangTidyCheck();
+
+ /// Derived classes should not implement any matching logic themselves; this
+ /// class will do the matching and call the derived class'
+ /// GetDeclFailureInfo() and GetMacroFailureInfo() for determining whether a
+ /// given identifier passes or fails the check.
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override final;
+ void
+ check(const ast_matchers::MatchFinder::MatchResult &Result) override final;
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override final;
+ void onEndOfTranslationUnit() override final;
+
+ /// Derived classes that override this function should call this method from
+ /// the overridden method.
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ /// This enum will be used in %select of the diagnostic message.
+ /// Each value below IgnoreFailureThreshold should have an error message.
+ enum class ShouldFixStatus {
+ ShouldFix,
+
+ /// The fixup will conflict with a language keyword,
+ /// so we can't fix it automatically.
+ ConflictsWithKeyword,
+
+ /// The fixup will conflict with a macro
+ /// definition, so we can't fix it
+ /// automatically.
+ ConflictsWithMacroDefinition,
+
+ /// The fixup results in an identifier that is not a valid c/c++ identifier.
+ FixInvalidIdentifier,
+
+ /// Values pass this threshold will be ignored completely
+ /// i.e no message, no fixup.
+ IgnoreFailureThreshold,
+
+ /// If the identifier was used or declared within a macro we
+ /// won't offer a fixup for safety reasons.
+ InsideMacro,
+ };
+
+ /// Information describing a failed check
+ struct FailureInfo {
+ std::string KindName; // Tag or misc info to be used as derived classes need
+ std::string Fixup; // The name that will be proposed as a fix-it hint
+ };
+
+ /// Holds an identifier name check failure, tracking the kind of the
+ /// identifier, its possible fixup and the starting locations of all the
+ /// identifier usages.
+ struct NamingCheckFailure {
+ FailureInfo Info;
+
+ /// Whether the failure should be fixed or not.
+ ///
+ /// e.g.: if the identifier was used or declared within a macro we won't
+ /// offer a fixup for safety reasons.
+ bool ShouldFix() const {
+ return FixStatus == ShouldFixStatus::ShouldFix && !Info.Fixup.empty();
+ }
+
+ bool ShouldNotify() const {
+ return FixStatus < ShouldFixStatus::IgnoreFailureThreshold;
+ }
+
+ ShouldFixStatus FixStatus = ShouldFixStatus::ShouldFix;
+
+ /// A set of all the identifier usages starting SourceLocation.
+ llvm::DenseSet<SourceLocation> RawUsageLocs;
+
+ NamingCheckFailure() = default;
+ };
+
+ using NamingCheckId = std::pair<SourceLocation, std::string>;
+
+ using NamingCheckFailureMap =
+ llvm::DenseMap<NamingCheckId, NamingCheckFailure>;
+
+ /// Check Macros for style violations.
+ void checkMacro(SourceManager &sourceMgr, const Token &MacroNameTok,
+ const MacroInfo *MI);
+
+ /// Add a usage of a macro if it already has a violation.
+ void expandMacro(const Token &MacroNameTok, const MacroInfo *MI);
+
+ void addUsage(const RenamerClangTidyCheck::NamingCheckId &Decl,
+ SourceRange Range, SourceManager *SourceMgr = nullptr);
+
+ /// Convenience method when the usage to be added is a NamedDecl.
+ void addUsage(const NamedDecl *Decl, SourceRange Range,
+ SourceManager *SourceMgr = nullptr);
+
+protected:
+ /// Overridden by derived classes, returns information about if and how a Decl
+ /// failed the check. A 'None' result means the Decl did not fail the check.
+ virtual llvm::Optional<FailureInfo>
+ GetDeclFailureInfo(const NamedDecl *Decl, const SourceManager &SM) const = 0;
+
+ /// Overridden by derived classes, returns information about if and how a
+ /// macro failed the check. A 'None' result means the macro did not fail the
+ /// check.
+ virtual llvm::Optional<FailureInfo>
+ GetMacroFailureInfo(const Token &MacroNameTok,
+ const SourceManager &SM) const = 0;
+
+ /// Represents customized diagnostic text and how arguments should be applied.
+ /// Example usage:
+ ///
+ /// return DiagInfo{"my %1 very %2 special %3 text",
+ /// [=](DiagnosticBuilder &diag) {
+ /// diag << arg1 << arg2 << arg3;
+ /// }};
+ struct DiagInfo {
+ std::string Text;
+ llvm::unique_function<void(DiagnosticBuilder &)> ApplyArgs;
+ };
+
+ /// Overridden by derived classes, returns a description of the diagnostic
+ /// that should be emitted for the given failure. The base class will then
+ /// further customize the diagnostic by adding info about whether the fix-it
+ /// can be automatically applied or not.
+ virtual DiagInfo GetDiagInfo(const NamingCheckId &ID,
+ const NamingCheckFailure &Failure) const = 0;
+
+private:
+ NamingCheckFailureMap NamingCheckFailures;
+ const bool AggressiveDependentMemberLookup;
+};
+
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_RENAMERCLANGTIDYCHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/TransformerClangTidyCheck.h b/linux-x64/clang/include/clang-tidy/utils/TransformerClangTidyCheck.h
new file mode 100644
index 0000000..9736e64
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/TransformerClangTidyCheck.h
@@ -0,0 +1,88 @@
+//===---------- TransformerClangTidyCheck.h - clang-tidy ------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_TRANSFORMER_CLANG_TIDY_CHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_TRANSFORMER_CLANG_TIDY_CHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "IncludeInserter.h"
+#include "IncludeSorter.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Tooling/Transformer/Transformer.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+/// A base class for defining a ClangTidy check based on a `RewriteRule`.
+//
+// For example, given a rule `MyCheckAsRewriteRule`, one can define a tidy check
+// as follows:
+//
+// class MyCheck : public TransformerClangTidyCheck {
+// public:
+// MyCheck(StringRef Name, ClangTidyContext *Context)
+// : TransformerClangTidyCheck(MyCheckAsRewriteRule, Name, Context) {}
+// };
+//
+// `TransformerClangTidyCheck` recognizes this clang-tidy option:
+//
+// * IncludeStyle. A string specifying which file naming convention is used by
+// the source code, 'llvm' or 'google'. Default is 'llvm'. The naming
+// convention influences how canonical headers are distinguished from other
+// includes.
+class TransformerClangTidyCheck : public ClangTidyCheck {
+public:
+ TransformerClangTidyCheck(StringRef Name, ClangTidyContext *Context);
+
+ /// DEPRECATED: prefer the two argument constructor in conjunction with
+ /// \c setRule.
+ ///
+ /// \p MakeRule generates the rewrite rule to be used by the check, based on
+ /// the given language and clang-tidy options. It can return \c None to handle
+ /// cases where the options disable the check.
+ ///
+ /// See \c setRule for constraints on the rule.
+ TransformerClangTidyCheck(std::function<Optional<transformer::RewriteRule>(
+ const LangOptions &, const OptionsView &)>
+ MakeRule,
+ StringRef Name, ClangTidyContext *Context);
+
+ /// Convenience overload of the constructor when the rule doesn't have any
+ /// dependies.
+ TransformerClangTidyCheck(transformer::RewriteRule R, StringRef Name,
+ ClangTidyContext *Context);
+
+ void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
+ Preprocessor *ModuleExpanderPP) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) final;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) final;
+
+ /// Derived classes that override this function should call this method from
+ /// the overridden method.
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+
+ /// Set the rule that this check implements. All cases in the rule must have
+ /// a non-null \c Explanation, even though \c Explanation is optional for
+ /// RewriteRule in general. Because the primary purpose of clang-tidy checks
+ /// is to provide users with diagnostics, we assume that a missing explanation
+ /// is a bug. If no explanation is desired, indicate that explicitly (for
+ /// example, by passing `text("no explanation")` to `makeRule` as the
+ /// `Explanation` argument).
+ void setRule(transformer::RewriteRule R);
+
+private:
+ transformer::RewriteRule Rule;
+ IncludeInserter Inserter;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_TRANSFORMER_CLANG_TIDY_CHECK_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/TypeTraits.h b/linux-x64/clang/include/clang-tidy/utils/TypeTraits.h
new file mode 100644
index 0000000..f4d3455
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/TypeTraits.h
@@ -0,0 +1,45 @@
+//===--- TypeTraits.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
+
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Type.h"
+
+namespace clang {
+namespace tidy {
+namespace utils {
+namespace type_traits {
+
+/// Returns `true` if `Type` is expensive to copy.
+llvm::Optional<bool> isExpensiveToCopy(QualType Type,
+ const ASTContext &Context);
+
+/// Returns `true` if `Type` is trivially default constructible.
+bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context);
+
+/// Returns `true` if `RecordDecl` is trivially default constructible.
+bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
+ const ASTContext &Context);
+
+/// Returns `true` if `Type` is trivially destructible.
+bool isTriviallyDestructible(QualType Type);
+
+/// Returns true if `Type` has a non-trivial move constructor.
+bool hasNonTrivialMoveConstructor(QualType Type);
+
+/// Return true if `Type` has a non-trivial move assignment operator.
+bool hasNonTrivialMoveAssignment(QualType Type);
+
+} // type_traits
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
diff --git a/linux-x64/clang/include/clang-tidy/utils/UsingInserter.h b/linux-x64/clang/include/clang-tidy/utils/UsingInserter.h
new file mode 100644
index 0000000..9d3c60c
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/utils/UsingInserter.h
@@ -0,0 +1,49 @@
+//===---------- UsingInserter.h - clang-tidy ----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_USINGINSERTER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_USINGINSERTER_H
+
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
+#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/SourceManager.h"
+#include <set>
+
+namespace clang {
+namespace tidy {
+namespace utils {
+
+// UsingInserter adds using declarations for |QualifiedName| to the surrounding
+// function.
+// This allows using a shorter name without clobbering other scopes.
+class UsingInserter {
+public:
+ UsingInserter(const SourceManager &SourceMgr);
+
+ // Creates a \p using declaration fixit. Returns ``llvm::None`` on error
+ // or if the using declaration already exists.
+ llvm::Optional<FixItHint>
+ createUsingDeclaration(ASTContext &Context, const Stmt &Statement,
+ llvm::StringRef QualifiedName);
+
+ // Returns the unqualified version of the name if there is an
+ // appropriate using declaration and the qualified name otherwise.
+ llvm::StringRef getShortName(ASTContext &Context, const Stmt &Statement,
+ llvm::StringRef QualifiedName);
+
+private:
+ typedef std::pair<const FunctionDecl *, std::string> NameInFunction;
+ const SourceManager &SourceMgr;
+ std::set<NameInFunction> AddedUsing;
+};
+
+} // namespace utils
+} // namespace tidy
+} // namespace clang
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_USINGINSERTER_H
diff --git a/linux-x64/clang/include/clang-tidy/zircon/TemporaryObjectsCheck.h b/linux-x64/clang/include/clang-tidy/zircon/TemporaryObjectsCheck.h
new file mode 100644
index 0000000..1243dad
--- /dev/null
+++ b/linux-x64/clang/include/clang-tidy/zircon/TemporaryObjectsCheck.h
@@ -0,0 +1,41 @@
+//===--- TemporaryObjectsCheck.h - 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
+
+#include "../ClangTidyCheck.h"
+#include "../utils/OptionsUtils.h"
+
+namespace clang {
+namespace tidy {
+namespace zircon {
+
+/// Construction of specific temporary objects in the Zircon kernel is
+/// discouraged.
+///
+/// For the user-facing documentation see:
+/// http://clang.llvm.org/extra/clang-tidy/checks/zircon-temporary-objects.html
+class TemporaryObjectsCheck : public ClangTidyCheck {
+public:
+ TemporaryObjectsCheck(StringRef Name, ClangTidyContext *Context)
+ : ClangTidyCheck(Name, Context),
+ Names(utils::options::parseStringList(Options.get("Names", ""))) {}
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
+ void registerMatchers(ast_matchers::MatchFinder *Finder) override;
+ void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ std::vector<std::string> Names;
+};
+
+} // namespace zircon
+} // namespace tidy
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H