[PATCH] D62373: [ASTImporter] Store import errors for Decls

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 02:33:12 PDT 2019


martong created this revision.
martong added a reviewer: a_sidorin.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp, rnkovacs.
Herald added a reviewer: a.sidorin.
Herald added a reviewer: shafik.
Herald added a project: clang.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62373

Files:
  clang/include/clang/AST/ASTImporter.h
  clang/lib/AST/ASTImporter.cpp
  clang/test/ASTMerge/class-template-partial-spec/test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62373.201163.patch
Type: text/x-patch
Size: 8149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190524/e03fa36b/attachment.bin>


More information about the cfe-commits mailing list