[PATCH] D44079: [ASTImporter] Allow testing of import sequences; fix import of typedefs for anonymous decls

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 4 09:44:07 PST 2018


a.sidorin created this revision.
a.sidorin added reviewers: r.stahl, xazax.hun, jingham, szepet.
Herald added subscribers: martong, rnkovacs.

  This patch introduces the ability to test an arbitrary sequence of imports
  between a given set of virtual source files. This should finally allow
  us to write simple tests and fix annoying issues inside ASTImporter
  that cause failures in CSA CTU. This is done by refactoring
  ASTImporterTest functions and introducing `testImportSequence` facility.
  As a side effect, `testImport` facility was generalized a bit more. It
  should now allow import of non-decl AST nodes; however, there is still no
  test using this ability.
  
  As a "test for test", there is also a fix for import anonymous TagDecls
  referred by typedef. Before this patch, the setting of typedef for anonymous
  structure was delayed; however, this approach misses the corner case if
  an enum constant is imported directly. In this patch, typedefs for
  anonymous declarations are imported right after the anonymous declaration
  is imported, without any delay.


Repository:
  rC Clang

https://reviews.llvm.org/D44079

Files:
  include/clang/AST/ASTImporter.h
  lib/AST/ASTImporter.cpp
  unittests/AST/ASTImporterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44079.136943.patch
Type: text/x-patch
Size: 16480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180304/425241cb/attachment-0001.bin>


More information about the cfe-commits mailing list