aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
diff options
context:
space:
mode:
authorAdam Czachorowski <adamcz@google.com>2020-08-13 17:24:22 +0200
committerAdam Czachorowski <adamcz@google.com>2020-08-20 14:19:52 +0200
commit53b9199a5cdba8a6e294e1fb183f308ec558db22 (patch)
tree428a61274b78bf18181c6f1d0a5ae1040946d1b9 /clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
parent0ee23b286ac48662b5e576fb837efa5564bc0578 (diff)
downloadllvm-53b9199a5cdba8a6e294e1fb183f308ec558db22.zip
llvm-53b9199a5cdba8a6e294e1fb183f308ec558db22.tar.gz
llvm-53b9199a5cdba8a6e294e1fb183f308ec558db22.tar.bz2
[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 4061d9e42cff621462931ac7df9666806c77a237, 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
Diffstat (limited to 'clang/unittests/Tooling/Syntax/BuildTreeTest.cpp')
0 files changed, 0 insertions, 0 deletions