llvm-project/clang/lib/Index
Adam Czachorowski 53b9199a5c [clangd] Fix crash-bug in preamble indexing when using modules.
When preamble contains #undef, indexing code finds the matching #define
and uses that during indexing. However, it would only look for local
definitions. If the macro was defined in a module, MacroInfo
would be nullptr and clangd would crash.

This change makes clangd ignore any #undef without a matching #define
inside the same TU.

The indexing of macros happens for preamble only, so then #undef must be
in the preamble, which is why we need two .h files in a test.

Note that clangd is currently not ready for module support, but this
brings us one step closer.

This was previously attempted in
4061d9e42c, but had to be reverted due to
broken test. This version fixes that test-only bug by setting a custom module
cache path to avoid re-use of modules across test invocations.

Differential Revision: https://reviews.llvm.org/D85923
2020-08-20 14:19:52 +02:00
..
CMakeLists.txt [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
CommentToXML.cpp Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
FileIndexRecord.cpp [clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString 2020-08-05 13:54:37 +01:00
FileIndexRecord.h [clang][index-while-building][NFC] FileIndexRecord - Comments, replace auto with type 2019-02-27 21:48:02 +00:00
IndexBody.cpp [clang][index] Fix a crash for accessing a null field decl. 2020-05-21 09:47:36 +02:00
IndexDecl.cpp [clangd] Don't traverse the AST within uninteresting files during indexing 2020-05-26 10:27:28 +02:00
IndexSymbol.cpp [clang][Index] Introduce a TemplateParm SymbolKind 2020-02-14 13:20:34 +01:00
IndexTypeSourceInfo.cpp [clang][index] Index the injected class name types. 2020-01-22 10:07:54 +01:00
IndexingAction.cpp [clangd] Fix crash-bug in preamble indexing when using modules. 2020-08-20 14:19:52 +02:00
IndexingContext.cpp [clang][Index] Fix the incomplete instantiations in libindex. 2020-02-20 14:42:30 +01:00
IndexingContext.h [clang][Index] Enable indexing of Template Type Parameters behind a flag 2019-02-21 09:52:33 +00:00
SimpleFormatContext.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
USRGeneration.cpp [ARM] Add __bf16 as new Bfloat16 C Type 2020-06-05 10:32:43 +01:00