| //===- 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 "clang/ASTMatchers/ASTMatchFinder.h" |
| #include "llvm/ADT/StringRef.h" |
| class ASTSrcLocProcessor : public ast_matchers::MatchFinder::MatchCallback { |
| explicit ASTSrcLocProcessor(StringRef JsonPath); |
| std::unique_ptr<ASTConsumer> createASTConsumer(CompilerInstance &Compiler, |
| void run(const ast_matchers::MatchFinder::MatchResult &Result) override; |
| llvm::Optional<TraversalKind> getCheckTraversalKind() const override { |
| return TK_IgnoreUnlessSpelledInSource; |
| llvm::StringMap<std::string> ClassInheritance; |
| llvm::StringMap<std::vector<StringRef>> ClassesInClade; |
| llvm::StringMap<ClassData> ClassEntries; |
| std::unique_ptr<clang::ast_matchers::MatchFinder> Finder; |