//===- ASTSrcLocProcessor.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_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H #define LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H #include "APIData.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "llvm/ADT/StringRef.h" #include #include #include namespace clang { class CompilerInstance; namespace tooling { class ASTSrcLocProcessor : public ast_matchers::MatchFinder::MatchCallback { public: explicit ASTSrcLocProcessor(StringRef JsonPath); std::unique_ptr createASTConsumer(CompilerInstance &Compiler, StringRef File); void generate(); void generateEmpty(); private: void run(const ast_matchers::MatchFinder::MatchResult &Result) override; std::optional getCheckTraversalKind() const override { return TK_IgnoreUnlessSpelledInSource; } llvm::StringMap ClassInheritance; llvm::StringMap> ClassesInClade; llvm::StringMap ClassEntries; std::string JsonPath; std::unique_ptr Finder; }; } // namespace tooling } // namespace clang #endif