[Lldb-commits] [PATCH] D59485: [ASTImporter] Add an ImportImpl method to allow customizing Import behavior.

Gabor Marton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 29 06:09:41 PDT 2019


martong added inline comments.


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:625
+      "class shouldNotBeImported {};", Lang_CXX, "class realDecl {};", Lang_CXX,
+      "shouldNotBeImported", RedirectingImporter::Constructor);
+  auto *Imported = cast<CXXRecordDecl>(To);
----------------
I just realized that maybe we could simplify and make this part more elegant:
If `ASTImporterTestBase` had a data member with the type `ImporterConstructor` then we could overwrite that data member in the constructor of `CustomImporter`.
(The `ASTImporter` is created lazily when the first `getImportedDecl` is called, but by that time the creator is already set, so this will work.)
This way we could elide the last argument here (`RedirectingImporter::Constructor`) and in all subsequent `TEST_P` tests, it would be enough to set up the creator per test fixture.



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59485/new/

https://reviews.llvm.org/D59485





More information about the lldb-commits mailing list