clang 19.0.0git
ASTSrcLocProcessor.h
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H
10#define LLVM_CLANG_TOOLING_DUMPTOOL_ASTSRCLOCPROCESSOR_H
11
12#include "APIData.h"
14#include "llvm/ADT/StringRef.h"
15#include <memory>
16#include <string>
17#include <vector>
18
19namespace clang {
20
21class CompilerInstance;
22
23namespace tooling {
24
26public:
27 explicit ASTSrcLocProcessor(StringRef JsonPath);
28
29 std::unique_ptr<ASTConsumer> createASTConsumer(CompilerInstance &Compiler,
30 StringRef File);
31
32 void generate();
33 void generateEmpty();
34
35private:
36 void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
37
38 std::optional<TraversalKind> getCheckTraversalKind() const override {
40 }
41
42 llvm::StringMap<std::string> ClassInheritance;
43 llvm::StringMap<std::vector<StringRef>> ClassesInClade;
44 llvm::StringMap<ClassData> ClassEntries;
45
46 std::string JsonPath;
47 std::unique_ptr<clang::ast_matchers::MatchFinder> Finder;
48};
49
50} // namespace tooling
51} // namespace clang
52
53#endif
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Called when the Match registered for it was successfully found in the AST.
std::unique_ptr< ASTConsumer > createASTConsumer(CompilerInstance &Compiler, StringRef File)
The JSON file list parser is used to communicate input to InstallAPI.
@ TK_IgnoreUnlessSpelledInSource
Ignore AST nodes not written in the source.
Definition: ASTTypeTraits.h:43
@ Result
The result type of a method or function.
Contains all information for a given match.