#include "ParsedAST.h"
#include "../clang-tidy/ClangTidyCheck.h"
#include "../clang-tidy/ClangTidyDiagnosticConsumer.h"
#include "../clang-tidy/ClangTidyModule.h"
#include "../clang-tidy/ClangTidyModuleRegistry.h"
#include "../clang-tidy/ClangTidyOptions.h"
#include "AST.h"
#include "CollectMacros.h"
#include "Compiler.h"
#include "Config.h"
#include "Diagnostics.h"
#include "Feature.h"
#include "FeatureModule.h"
#include "Headers.h"
#include "HeuristicResolver.h"
#include "IncludeCleaner.h"
#include "IncludeFixer.h"
#include "Preamble.h"
#include "SourceCode.h"
#include "TidyProvider.h"
#include "clang-include-cleaner/Record.h"
#include "index/Symbol.h"
#include "support/Logger.h"
#include "support/Path.h"
#include "support/Trace.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclGroup.h"
#include "clang/AST/ExternalASTSource.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/FileEntry.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/FrontendOptions.h"
#include "clang/Frontend/PrecompiledPreamble.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Serialization/ASTWriter.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/Core/Diagnostic.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include <cassert>
#include <cstddef>
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#if CLANGD_TIDY_CHECKS
#define CLANG_TIDY_DISABLE_STATIC_ANALYZER_CHECKS
#include "../clang-tidy/ClangTidyForceLinker.h"
#endif
namespace clang {
namespace clangd {
namespace {
template <class T> std::size_t getUsedBytes(const std::vector<T> &Vec) { … }
class DeclTrackingASTConsumer : public ASTConsumer { … };
class ClangdFrontendAction : public SyntaxOnlyAction { … };
class ReplayPreamble : private PPCallbacks { … };
class TidyDiagnosticGroups { … };
void applyWarningOptions(llvm::ArrayRef<std::string> ExtraArgs,
llvm::function_ref<bool(diag::Group)> EnabledGroups,
DiagnosticsEngine &Diags) { … }
std::vector<Diag> getIncludeCleanerDiags(ParsedAST &AST, llvm::StringRef Code,
const ThreadsafeFS &TFS) { … }
tidy::ClangTidyCheckFactories
filterFastTidyChecks(const tidy::ClangTidyCheckFactories &All,
Config::FastCheckPolicy Policy) { … }
}
std::optional<ParsedAST>
ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
std::unique_ptr<clang::CompilerInvocation> CI,
llvm::ArrayRef<Diag> CompilerInvocationDiags,
std::shared_ptr<const PreambleData> Preamble) { … }
ParsedAST::ParsedAST(ParsedAST &&Other) = default;
ParsedAST &ParsedAST::operator=(ParsedAST &&Other) = default;
ParsedAST::~ParsedAST() { … }
ASTContext &ParsedAST::getASTContext() { … }
const ASTContext &ParsedAST::getASTContext() const { … }
Sema &ParsedAST::getSema() { … }
Preprocessor &ParsedAST::getPreprocessor() { … }
std::shared_ptr<Preprocessor> ParsedAST::getPreprocessorPtr() { … }
const Preprocessor &ParsedAST::getPreprocessor() const { … }
llvm::ArrayRef<Decl *> ParsedAST::getLocalTopLevelDecls() { … }
llvm::ArrayRef<const Decl *> ParsedAST::getLocalTopLevelDecls() const { … }
const MainFileMacros &ParsedAST::getMacros() const { … }
const std::vector<PragmaMark> &ParsedAST::getMarks() const { … }
std::size_t ParsedAST::getUsedBytes() const { … }
const IncludeStructure &ParsedAST::getIncludeStructure() const { … }
ParsedAST::ParsedAST(PathRef TUPath, llvm::StringRef Version,
std::shared_ptr<const PreambleData> Preamble,
std::unique_ptr<CompilerInstance> Clang,
std::unique_ptr<FrontendAction> Action,
syntax::TokenBuffer Tokens, MainFileMacros Macros,
std::vector<PragmaMark> Marks,
std::vector<Decl *> LocalTopLevelDecls,
std::vector<Diag> Diags, IncludeStructure Includes,
include_cleaner::PragmaIncludes PI)
: … { … }
const include_cleaner::PragmaIncludes &ParsedAST::getPragmaIncludes() const { … }
std::optional<llvm::StringRef> ParsedAST::preambleVersion() const { … }
llvm::ArrayRef<Diag> ParsedAST::getDiagnostics() const { … }
}
}