[PATCH] D32751: [ASTImporter] Support new kinds of declarations (mostly Using*)
Aleksei Sidorin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat May 20 06:23:08 PDT 2017
a.sidorin added inline comments.
================
Comment at: lib/AST/ASTImporter.cpp:1311
+ EmptyDecl *ToD = EmptyDecl::Create(Importer.getToContext(), DC, Loc);
+ ToD->setLexicalDeclContext(LexicalDC);
+ LexicalDC->addDeclInternal(ToD);
----------------
xazax.hun wrote:
> Don't we need an Importer.Imported call here?
It's done a level upper in `ASTImporter::ImportDecl()` but I think it's worth it to add an explicit call.
================
Comment at: lib/AST/ASTImporter.cpp:1464
+
+ NamespaceDecl *TargetDecl = cast<NamespaceDecl>(
+ Importer.Import(D->getNamespace()));
----------------
szepet wrote:
> Since the Import can result nullptr (which is checked 2 lines below) this should be a cast_or_null as I see.
Nice spot, thank you!
https://reviews.llvm.org/D32751
More information about the cfe-commits
mailing list