================
@@ -166,8 +300,37 @@ void ExternalSource::completeVisibleDeclsMap(
             SetExternalVisibleDeclsForName(ChildDeclContext,
                                            importedNamedDecl->getDeclName(),
                                            importedNamedDecl);
-          }
+            if (auto *Record =
+                    llvm::dyn_cast<CXXRecordDecl>(importedNamedDecl)) {
+              if (auto Err = Importer->ImportDefinition(Decl))
+                consumeError(std::move(Err));
+              // LLVM_DEBUG(llvm::dbgs() << "\nHello :\n");
+              // Record->getTypeForDecl()->dump();
+              Record->setHasLoadedFieldsFromExternalStorage(true);
+              // auto ToOrErr = Importer->Import(->getTypeForDecl());
+              // if (!ToOrErr) {
+              //   consumeError(std::move(ToOrErr.takeError()));
+              // }
+              LLVM_DEBUG(
+                  llvm::dbgs()
+                  << "\nCXXRecrod : " << Record->getName() << " size(methods): 
"
+                  << std::distance(Record->method_begin(), 
Record->method_end())
+                  << " has def?:  " << Record->hasDefinition()
+                  << " # (methods): "
+                  << std::distance(Record->getDefinition()->method_begin(),
+                                   Record->getDefinition()->method_end())
+                  << "\n");
+              for (auto *Meth : Record->methods()) {
+                SetExternalVisibleDeclsForName(ChildDeclContext,
+                                               Meth->getDeclName(), Meth);
+                // if (Meth->getDeclName().isIdentifier()) {
+                // LLVM_DEBUG(llvm::dbgs() << "CXXRecrod Method: " <<
+                // Meth->getName() << "\n");
----------------
vgvassilev wrote:

Can we clean up the comments and reduce the indentation levels as suggested in 
previous comments?

https://github.com/llvm/llvm-project/pull/67349
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to