llvm-project/clang/unittests
Ben Langmuir 93c87fc06e [index] Improve macro indexing support
The major change here is to index macro occurrences in more places than
before, specifically

* In non-expansion references such as `#if`, `#ifdef`, etc.
* When the macro is a reference to a builtin macro such as __LINE__.
* When using the preprocessor state instead of callbacks, we now include
  all definition locations and undefinitions instead of just the latest
  one (which may also have had the wrong location previously).
* When indexing an existing module file (.pcm), we now include module
  macros, and we no longer report unrelated preprocessor macros during
  indexing the module, which could have caused duplication.

Additionally, we now correctly obey the system symbol filter for macros,
so by default in system headers only definition/undefinition occurrences
are reported, but it can be configured to report references as well if
desired.

Extends FileIndexRecord to support occurrences of macros. Since the
design of this type is to keep a single list of entities organized by
source location, we incorporate macros into the existing DeclOccurrence
struct.

Differential Revision: https://reviews.llvm.org/D99758
2021-04-06 09:12:14 -07:00
..
AST Don't directly dereference getAs<> casts to avoid potential null dereferences. NFCI. 2021-04-06 12:24:19 +01:00
ASTMatchers [ASTMatcher] Add AST Matcher support for C++20 coroutine keywords 2021-03-22 10:27:46 +08:00
Analysis [analyzer] Introduce MacroExpansionContext to libAnalysis 2021-02-22 11:11:57 +01:00
Basic [clang][cli] Generate and round-trip language options 2021-02-09 10:18:55 +01:00
CodeGen Reland "Move the test compiler setup in a common place. NFCI" 2020-11-16 13:22:10 +00:00
CrossTU [analyzer][CTU] API for CTU macro expansions 2021-02-22 11:12:22 +01:00
DirectoryWatcher [DirectoryWatcher] Increase timeout to make test less flaky 2021-03-05 17:49:14 -08:00
Driver [Driver] Stop searching other prefixes once a GCC installation is found in one prefix 2021-03-19 20:35:59 -07:00
Format [clang-format] Fix east const pointer alignment of operators 2021-03-30 17:18:32 +02:00
Frontend [clang][cli] Ensure plugin args are generated in deterministic order 2021-04-06 09:24:42 +02:00
Index [index] Improve macro indexing support 2021-04-06 09:12:14 -07:00
Introspection [AST] Add introspection support for Decls 2021-03-22 23:16:02 +00:00
Lex [clang] Make sure argument expansion locations are correct in presence of predefined buffer 2020-04-22 21:01:52 +02:00
Rename [OpenMP] "UnFix" layering problem with FrontendOpenMP 2020-04-07 14:41:18 -05:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [clang][CodeComplete] Fix crash on ParenListExprs 2021-02-08 13:16:49 +01:00
Serialization Revert "[modules] Do not cache invalid state for modules that we attempted to load." 2020-03-10 10:59:26 -07:00
StaticAnalyzer [analyzer] Don't include private gtest headers 2021-03-22 13:31:38 +01:00
Tooling [clang][tooling] Create SourceManager for DiagnosticsEngine before command-line parsing 2021-04-06 10:40:47 +02:00
libclang [libclang] Add CXRewriter to libclang API 2020-09-04 14:17:03 -07:00
CMakeLists.txt [AST] Add generator for source location introspection 2021-03-15 10:52:44 +00:00