annotate clang-tools-extra/clang-include-fixer/find-all-symbols/PragmaCommentHandler.h @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===-- PragmaCommentHandler.h - find all symbols----------------*- C++ -*-===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_PRAGMA_COMMENT_HANDLER_H
anatofuz
parents:
diff changeset
10 #define LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_PRAGMA_COMMENT_HANDLER_H
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include "clang/Basic/SourceLocation.h"
anatofuz
parents:
diff changeset
13 #include "clang/Lex/Preprocessor.h"
anatofuz
parents:
diff changeset
14 #include <map>
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 namespace clang {
anatofuz
parents:
diff changeset
17 namespace find_all_symbols {
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 class HeaderMapCollector;
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 /// PragmaCommentHandler parses pragma comment on include files to
anatofuz
parents:
diff changeset
22 /// determine when we should include a different header from the header that
anatofuz
parents:
diff changeset
23 /// directly defines a symbol.
anatofuz
parents:
diff changeset
24 ///
anatofuz
parents:
diff changeset
25 /// Currently it only supports IWYU private pragma:
anatofuz
parents:
diff changeset
26 /// https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-private
anatofuz
parents:
diff changeset
27 class PragmaCommentHandler : public clang::CommentHandler {
anatofuz
parents:
diff changeset
28 public:
anatofuz
parents:
diff changeset
29 PragmaCommentHandler(HeaderMapCollector *Collector) : Collector(Collector) {}
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 bool HandleComment(Preprocessor &PP, SourceRange Range) override;
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 private:
anatofuz
parents:
diff changeset
34 HeaderMapCollector *const Collector;
anatofuz
parents:
diff changeset
35 };
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 } // namespace find_all_symbols
anatofuz
parents:
diff changeset
38 } // namespace clang
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 #endif // LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_PRAGMA_COMMENT_HANDLER_H