llvm-project/clang/unittests
Gabor Marton 1ad4b99d94 [ASTImporter] Mark erroneous nodes in from ctx
Summary:
During import of a specific Decl D, it may happen that some AST nodes
had already been created before we recognize an error. In this case we
signal back the error to the caller, but the "to" context remains
polluted with those nodes which had been created. Ideally, those nodes
should not had been created, but that time we did not know about the
error, the error happened later.  Since the AST is immutable (most of
the cases we can't remove existing nodes) we choose to mark these nodes
as erroneous.
Here are the steps of the algorithm:
1) We keep track of the nodes which we visit during the import of D: See
ImportPathTy.
2) If a Decl is already imported and it is already on the import path
(we have a cycle) then we copy/store the relevant part of the import
path. We store these cycles for each Decl.
3) When we recognize an error during the import of D then we set up this
error to all Decls in the stored cycles for D and we clear the stored
cycles.

Reviewers: a_sidorin, a.sidorin, shafik

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 364771
2019-07-01 14:19:53 +00:00
..
AST [ASTImporter] Mark erroneous nodes in from ctx 2019-07-01 14:19:53 +00:00
ASTMatchers [clang] Adapt ASTMatcher to explicit(bool) specifier 2019-06-19 18:27:56 +00:00
Analysis [analyzer] Treat functions without run-time branches as "small". 2019-04-30 03:01:02 +00:00
Basic [FileSystemStatCache] Update test for new FileSystemStatCache API 2019-04-16 18:00:43 +00:00
CodeGen Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CrossTU Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver [Driver] Support priority for multilibs 2019-04-27 00:25:11 +00:00
Format clang-format: better handle namespace macros 2019-06-06 20:06:23 +00:00
Frontend [test] Reinstate the assignment to the diagnostic log in the unittest 2019-06-12 20:35:44 +00:00
Index [clang][Index] Fix msan failure 2019-03-08 10:18:40 +00:00
Lex Fix for r42230, MSVC test failure in DependencyDirectivesSourceMinimizerTest.cpp 2019-06-11 14:58:26 +00:00
Rename Rename clangToolingRefactor to clangToolingRefactoring for consistency with its directory 2019-05-25 00:27:19 +00:00
Rewrite Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sema [CodeComplete] Set preferred type for qualified-id 2019-05-28 15:21:03 +00:00
Serialization Stop relying on allocator behaviour in modules unit test 2019-03-09 20:15:01 +00:00
StaticAnalyzer [analyzer] Remove the default value arg from getChecker*Option 2019-05-17 15:52:13 +00:00
Tooling [clang][Tooling] Fix windows build-bots after rL364386 2019-06-26 08:39:42 +00:00
libclang Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Modules: Rename MemoryBufferCache to InMemoryModuleCache 2019-03-09 17:33:56 +00:00