]> granicus.if.org Git - clang/commit
[ASTImporter] Store import errors for Decls
authorGabor Marton <gabor.marton@ericsson.com>
Tue, 25 Jun 2019 08:00:51 +0000 (08:00 +0000)
committerGabor Marton <gabor.marton@ericsson.com>
Tue, 25 Jun 2019 08:00:51 +0000 (08:00 +0000)
commitdcdff72a1e83400fd15945dc7c1f60bcbbf4d03b
treed230f5fb439b38fa99597c8167a737e833240021
parent2c025c7a159794709375cd7910fa7cbc3a02cf1a
[ASTImporter] Store import errors for Decls

Summary:
We add a new member which is a mapping from the already-imported
declarations in the "from" context to the error status of the import of
that declaration.  This map contains only the declarations that were not
correctly imported. The same declaration may or may not be included in
ImportedDecls. This map is updated continuously during imports and never
cleared (like ImportedDecls).  In Import(Decl*) we use this mapping, so
if there was a previous failed import we return with the existing error.

We add/remove from the Lookuptable in consistency with ImportedFromDecls.
When we map a decl in the 'to' context to something in the 'from'
context then and only then we add it to the lookup table. When we
remove a mapping then and only then we remove it from the lookup table.

This patch is the first in a series of patches whose aim is to further
strengthen the error handling in ASTImporter.

Reviewers: a_sidorin, a.sidorin, shafik

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

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364279 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTImporter.h
lib/AST/ASTImporter.cpp
test/ASTMerge/class-template-partial-spec/test.cpp
unittests/AST/ASTImporterFixtures.cpp
unittests/AST/ASTImporterFixtures.h
unittests/AST/ASTImporterTest.cpp