]> granicus.if.org Git - clang/commit
[ASTImporter] Mark erroneous nodes in shared st
authorGabor Marton <gabor.marton@ericsson.com>
Mon, 1 Jul 2019 15:37:07 +0000 (15:37 +0000)
committerGabor Marton <gabor.marton@ericsson.com>
Mon, 1 Jul 2019 15:37:07 +0000 (15:37 +0000)
commit91dc12c934ac8b6828f9553d52cd43c3007caa2a
tree0e3f3004ab003eb781cf22a58e26d96594332549
parent44f7b2cea9a2ae54023740cf1a8c067d6b0e090a
[ASTImporter] Mark erroneous nodes in shared st

Summary:
Now we store the errors for the Decls in the "to" context too. For
that, however, we have to put these errors in a shared state (among all
the ASTImporter objects which handle the same "to" context but different
"from" contexts).

After a series of imports from different "from" TUs we have a "to" context
which may have erroneous nodes in it. (Remember, the AST is immutable so
there is no way to delete a node once we had created it and we realized
the error later.) All these erroneous nodes are marked in
ASTImporterSharedState::ImportErrors.  Clients of the ASTImporter may
use this as an input. E.g. the static analyzer engine may not try to
analyze a function if that is marked as erroneous (it can be queried via
ASTImporterSharedState::getImportDeclErrorIfAny()).

Reviewers: a_sidorin, a.sidorin, shafik

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

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364785 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTImporter.h
include/clang/AST/ASTImporterSharedState.h [new file with mode: 0644]
include/clang/CrossTU/CrossTranslationUnit.h
lib/AST/ASTImporter.cpp
lib/CrossTU/CrossTranslationUnit.cpp
lib/Frontend/ASTMerge.cpp
unittests/AST/ASTImporterFixtures.cpp
unittests/AST/ASTImporterFixtures.h
unittests/AST/ASTImporterTest.cpp