clang-tools 8.0.0

FindAllSymbolsAction.cpp
Go to the documentation of this file.
1 //===-- FindAllSymbolsAction.cpp - find all symbols action --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "FindAllSymbolsAction.h"
11 #include "FindAllMacros.h"
12 #include "clang/Lex/PPCallbacks.h"
13 #include "clang/Lex/Preprocessor.h"
14 #include "llvm/ADT/STLExtras.h"
15
16 namespace clang {
17 namespace find_all_symbols {
18
19 FindAllSymbolsAction::FindAllSymbolsAction(
20 SymbolReporter *Reporter,
21 const HeaderMapCollector::RegexHeaderMap *RegexHeaderMap)
22 : Reporter(Reporter), Collector(RegexHeaderMap), Handler(&Collector),
23 Matcher(Reporter, &Collector) {
24 Matcher.registerMatchers(&MatchFinder);
25 }
26
27 std::unique_ptr<ASTConsumer>
28 FindAllSymbolsAction::CreateASTConsumer(CompilerInstance &Compiler,
29 StringRef InFile) {
30 Compiler.getPreprocessor().addCommentHandler(&Handler);
31 Compiler.getPreprocessor().addPPCallbacks(llvm::make_unique<FindAllMacros>(
32 Reporter, &Compiler.getSourceManager(), &Collector));
33 return MatchFinder.newASTConsumer();
34 }
35
36 } // namespace find_all_symbols
37 } // namespace clang
clang::find_all_symbols::FindAllSymbolsAction::CreateASTConsumer
std::unique_ptr< clang::ASTConsumer > CreateASTConsumer(clang::CompilerInstance &Compiler, StringRef InFile) override
Definition: FindAllSymbolsAction.cpp:28
clang::find_all_symbols::HeaderMapCollector::RegexHeaderMap
std::vector< std::pair< const char *, const char * > > RegexHeaderMap
Definition: HeaderMapCollector.h:26
clang::find_all_symbols::SymbolReporter
An interface for classes that collect symbols.
Definition: SymbolReporter.h:19
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
clang::find_all_symbols::FindAllSymbolsAction::FindAllSymbolsAction
FindAllSymbolsAction(SymbolReporter *Reporter, const HeaderMapCollector::RegexHeaderMap *RegexHeaderMap=nullptr)
Definition: FindAllSymbolsAction.cpp:19
FindAllSymbolsAction.h
clang::find_all_symbols::FindAllSymbols::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *MatchFinder)
Definition: FindAllSymbols.cpp:117
FindAllMacros.h