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

Balázs Kéri via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 22 01:44:32 PDT 2019


balazske added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:7738
+Expected<Decl *> ASTImporter::ImportInternal(Decl *FromD) {
+  // Import the declaration.
+  ASTNodeImporter Importer(*this);
----------------
Comment can be better: Import it using ASTNodeImporter.


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:581
+struct RedirectingImporter : public ASTImporter {
+  using ASTImporter::ASTImporter;
+  // Returns a ImporterConstructor that constructs this class.
----------------
Is this `using` needed?


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:583
+  // Returns a ImporterConstructor that constructs this class.
+  static ASTImporterOptionSpecificTestBase::ImporterConstructor
+  getConstructor() {
----------------
Is it possible to make this a static variable instead of function?


================
Comment at: clang/unittests/AST/ASTImporterTest.cpp:588
+              bool MinimalImport, ASTImporterLookupTable *LookupTabl) {
+      return static_cast<ASTImporter *>(
+          new RedirectingImporter(ToContext, ToFileManager, FromContext,
----------------
The `static_cast` should not be needed.


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

https://reviews.llvm.org/D59485





More information about the lldb-commits mailing list