[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / lib / Tooling / DumpTool / ASTSrcLocProcessor.h
blob5f2b48173f281eac3e4322a011dbd0f58cc80264
1 //===- ASTSrcLocProcessor.h ---------------------------------*- C++ -*-----===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H
10 #define LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H
12 #include "APIData.h"
13 #include "clang/ASTMatchers/ASTMatchFinder.h"
14 #include "llvm/ADT/StringRef.h"
15 #include <memory>
16 #include <string>
17 #include <vector>
19 namespace clang {
21 class CompilerInstance;
23 namespace tooling {
25 class ASTSrcLocProcessor : public ast_matchers::MatchFinder::MatchCallback {
26 public:
27 explicit ASTSrcLocProcessor(StringRef JsonPath);
29 std::unique_ptr<ASTConsumer> createASTConsumer(CompilerInstance &Compiler,
30 StringRef File);
32 void generate();
33 void generateEmpty();
35 private:
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;
46 std::string JsonPath;
47 std::unique_ptr<clang::ast_matchers::MatchFinder> Finder;
50 } // namespace tooling
51 } // namespace clang
53 #endif