[LoongArch] Fix the assertion for atomic store with 'ptr' type
[llvm-project.git] / clang-tools-extra / clang-include-fixer / find-all-symbols / FindAllSymbolsAction.h
blob1a8b99a35aee8662b7ad4dd9c68e691d8ea21ac5
1 //===-- FindAllSymbolsAction.h - find all symbols action --------*- 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_TOOLS_EXTRA_FIND_ALL_SYMBOLS_FIND_ALL_SYMBOLS_ACTION_H
10 #define LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_FIND_ALL_SYMBOLS_ACTION_H
12 #include "FindAllSymbols.h"
13 #include "HeaderMapCollector.h"
14 #include "PragmaCommentHandler.h"
15 #include "clang/ASTMatchers/ASTMatchFinder.h"
16 #include "clang/Frontend/CompilerInstance.h"
17 #include "clang/Frontend/FrontendAction.h"
18 #include "clang/Tooling/Tooling.h"
19 #include "llvm/ADT/StringRef.h"
20 #include <memory>
22 namespace clang {
23 namespace find_all_symbols {
25 class FindAllSymbolsAction : public clang::ASTFrontendAction {
26 public:
27 explicit FindAllSymbolsAction(
28 SymbolReporter *Reporter,
29 const HeaderMapCollector::RegexHeaderMap *RegexHeaderMap = nullptr);
31 std::unique_ptr<clang::ASTConsumer>
32 CreateASTConsumer(clang::CompilerInstance &Compiler,
33 StringRef InFile) override;
35 private:
36 SymbolReporter *const Reporter;
37 clang::ast_matchers::MatchFinder MatchFinder;
38 HeaderMapCollector Collector;
39 PragmaCommentHandler Handler;
40 FindAllSymbols Matcher;
43 class FindAllSymbolsActionFactory : public tooling::FrontendActionFactory {
44 public:
45 FindAllSymbolsActionFactory(
46 SymbolReporter *Reporter,
47 const HeaderMapCollector::RegexHeaderMap *RegexHeaderMap = nullptr)
48 : Reporter(Reporter), RegexHeaderMap(RegexHeaderMap) {}
50 std::unique_ptr<FrontendAction> create() override {
51 return std::make_unique<FindAllSymbolsAction>(Reporter, RegexHeaderMap);
54 private:
55 SymbolReporter *const Reporter;
56 const HeaderMapCollector::RegexHeaderMap *const RegexHeaderMap;
59 } // namespace find_all_symbols
60 } // namespace clang
62 #endif // LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_FIND_ALL_SYMBOLS_ACTION_H