clang  14.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 
19 namespace clang {
20 
21 class CompilerInstance;
22 
23 namespace tooling {
24 
26 public:
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 
35 private:
36  void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
37 
38  llvm::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
clang::DeclaratorContext::File
@ File
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::tooling::ASTSrcLocProcessor::ASTSrcLocProcessor
ASTSrcLocProcessor(StringRef JsonPath)
Definition: ASTSrcLocProcessor.cpp:19
clang::tooling::ASTSrcLocProcessor::createASTConsumer
std::unique_ptr< ASTConsumer > createASTConsumer(CompilerInstance &Compiler, StringRef File)
Definition: ASTSrcLocProcessor.cpp:47
llvm::Optional
Definition: LLVM.h:40
ASTMatchFinder.h
clang::tooling::ASTSrcLocProcessor::generate
void generate()
Definition: ASTSrcLocProcessor.cpp:135
APIData.h
clang::tooling::ASTSrcLocProcessor::generateEmpty
void generateEmpty()
Definition: ASTSrcLocProcessor.cpp:140
clang::CompilerInstance
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Definition: CompilerInstance.h:74
clang::TK_IgnoreUnlessSpelledInSource
@ TK_IgnoreUnlessSpelledInSource
Ignore AST nodes not written in the source.
Definition: ASTTypeTraits.h:42
clang::ast_matchers::MatchFinder::MatchResult
Contains all information for a given match.
Definition: ASTMatchFinder.h:74
clang
Definition: CalledOnceCheck.h:17
clang::ast_matchers::MatchFinder::MatchCallback
Called when the Match registered for it was successfully found in the AST.
Definition: ASTMatchFinder.h:91
clang::tooling::ASTSrcLocProcessor
Definition: ASTSrcLocProcessor.h:25