6 Commits

Author SHA1 Message Date
Viktoriia Bakalova
81c3739156 [include-cleaner] Use expansion locations for macros.
Use expansion locations for target symbol decls when finding headers for macros.
Fix: https://github.com/llvm/llvm-project/issues/59392
Differential Revision: https://reviews.llvm.org/D139716
2022-12-19 14:18:16 +00:00
Haojian Wu
e864749d4d [include-cleaner] Add a newline at end of the file, NFC 2022-12-12 15:29:27 +01:00
Haojian Wu
0cf8885144 [include-cleaner] Add self-contained file support for PragmaIncludes.
And use it findHeaders. findHeaders now finds all header candidates
given a symbol location (these headers will be attached with proper
signals, in a followup patch).

Differential Revision: https://reviews.llvm.org/D137698
2022-11-18 13:52:30 +01:00
Sam McCall
2675773258 [include-cleaner] add macro symbols and implicit refs to HTML report
Demo: 8c5c5ad927/ASTTests.html

Differential Revision: https://reviews.llvm.org/D137677
2022-11-17 17:29:41 +01:00
Haojian Wu
e000c2bce7 [include-cleaner] NFC, move the macro location fixme to findHeaders. 2022-11-11 14:55:29 +01:00
Sam McCall
7943169273 [clang-include-cleaner] make SymbolLocation a real class, move FindHeaders
- replace SymbolLocation std::variant with enum-exposing version similar to
  those in types.cpp. There's no appropriate implementation file, added
  LocateSymbol.cpp in anticipation of locateDecl/locateMacro.
- FindHeaders is not part of the public Analysis interface, so should not
  be implemented/tested there (just code organization)
- rename findIncludeHeaders->findHeaders to avoid confusion with Include concept

Differential Revision: https://reviews.llvm.org/D137825
2022-11-11 13:41:54 +01:00