1 //===- ASTSrcLocProcessor.h ---------------------------------*- C++ -*-----===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H
10 #define LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H
13 #include "clang/ASTMatchers/ASTMatchFinder.h"
14 #include "llvm/ADT/StringRef.h"
21 class CompilerInstance
;
25 class ASTSrcLocProcessor
: public ast_matchers::MatchFinder::MatchCallback
{
27 explicit ASTSrcLocProcessor(StringRef JsonPath
);
29 std::unique_ptr
<ASTConsumer
> createASTConsumer(CompilerInstance
&Compiler
,
36 void run(const ast_matchers::MatchFinder::MatchResult
&Result
) override
;
38 std::optional
<TraversalKind
> getCheckTraversalKind() const override
{
39 return TK_IgnoreUnlessSpelledInSource
;
42 llvm::StringMap
<std::string
> ClassInheritance
;
43 llvm::StringMap
<std::vector
<StringRef
>> ClassesInClade
;
44 llvm::StringMap
<ClassData
> ClassEntries
;
47 std::unique_ptr
<clang::ast_matchers::MatchFinder
> Finder
;
50 } // namespace tooling