Go to file
Raphael Isemann 51e0bbb02d [lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST
Summary:
As we figured out in D67803, importing declarations from a temporary ASTContext that were originally from a persistent ASTContext
causes a bunch of duplicated declarations where we end up having declarations in the target AST that have no associated ASTImporter that
can complete them.

I haven't figured out how/if we can solve this in the current way we do things in LLDB, but in the modern-type-lookup this is solvable
as we have a saner architecture with the ExternalASTMerger. As we can (hopefully) make modern-type-lookup the default mode in the future,
I would say we try fixing this issue here. As we don't use the hack that was reinstated in D67803 during modern-type-lookup, the test case for this
is essentially just printing any kind of container in `std::` as we would otherwise run into the issue that required a hack like D67803.

What this patch is doing in essence is that instead of importing a declaration from a temporary ASTContext, we instead check if the
declaration originally came from a persistent ASTContext (e.g. the debug information) and we directly import from there. The ExternalASTMerger
is already connected with ASTImporters to these different sources, so this patch is essentially just two parts:
1. Mark our temporary ASTContext/ImporterSource as temporary when we import from the expression AST.
2. If the ExternalASTMerger sees we import from the expression AST, instead of trying to import these temporary declarations, check if we
can instead import from the persistent ASTContext that is already connected. This ensures that all records from the persistent source actually
come from the persistent source and are minimally imported in a way that allows them to be completed later on in the target AST.

The next step is to run the ASTImporter for these temporary expressions with the MinimalImport mode disabled, but that's a follow up patch.

This patch fixes most test failures with modern-type-lookup enabled by default (down to 73 failing tests, which includes the 22 import-std-module tests
which need special treatment).

Reviewers: shafik, martong

Reviewed By: martong

Subscribers: aprantl, rnkovacs, christof, abidh, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68326

llvm-svn: 373711
2019-10-04 08:26:17 +00:00
clang [lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST 2019-10-04 08:26:17 +00:00
clang-tools-extra [CodeComplete] Ensure object is the same in compareOverloads() 2019-10-04 08:10:27 +00:00
compiler-rt [compiler-rt] Remove O1 tests from signal_line.cpp 2019-10-04 07:25:53 +00:00
debuginfo-tests Make nrvo-string test more robust. 2019-06-27 20:38:37 +00:00
libc Add a director, along with README.txt and LICENSE.txt, for libc. 2019-09-16 21:39:08 +00:00
libclc travis: Add LLVM 9 build 2019-09-27 05:58:15 +00:00
libcxx Make libc++ gdb pretty printer Python 3 compatible 2019-10-04 04:47:33 +00:00
libcxxabi [libc++abi] Do not export some implementation-detail functions 2019-10-03 14:24:53 +00:00
libunwind [libunwind] Adjust libunwind_01.pass.cpp test for ARM EHABI 2019-10-03 17:01:04 +00:00
lld [ELF] Use union-find set and doubly linked list in Call-Chain Clustering (C³) heuristic 2019-10-04 07:56:54 +00:00
lldb [lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST 2019-10-04 08:26:17 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm [X86] Enable inline memcmp() to use AVX512 2019-10-04 07:42:34 +00:00
openmp [OpenMP] FreeBSD address check if mapped more native 2019-09-28 19:01:59 +00:00
parallel-libs
polly [Alignment][NFC] Remove StoreInst::setAlignment(unsigned) 2019-10-03 13:17:21 +00:00
pstl [pstl] Allow customizing whether per-TU insulation is provided 2019-08-13 12:49:00 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.git-blame-ignore-revs Add LLDB reformatting to .git-blame-ignore-revs 2019-09-04 09:31:55 +00:00
.gitignore Add a newline at the end of the file 2019-09-04 06:33:46 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.