d: Use semanticRun to prevent declaration pass from running multiple times.
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 21 Apr 2019 07:03:32 +0000 (07:03 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Sun, 21 Apr 2019 07:03:32 +0000 (07:03 +0000)
commite64deb7447955c4d513a1fb5f9e4c553ca64545c
tree5702c70a0dee4087eda5ed6068828e5fd6351fb6
parentf452f0d67f1a5a0da4e1e15026c5a9c322c2f5b7
d: Use semanticRun to prevent declaration pass from running multiple times.

This shouldn't happen during normal traversal of the AST provided from
the front-end, however as there are some cases where declarations need
to be visited out of order, such as what is being done in PR d/89017, it
then becomes necessary to guard against this.

gcc/d/ChangeLog:

2019-04-21  Iain Buclaw  <ibuclaw@gdcproject.org>

* decl.cc (DeclVisitor::visit(Import)): Set semanticRun after
completion, guard against being called more than once.
(DeclVisitor::visit(StructDeclaration)): Likewise.
(DeclVisitor::visit(ClassDeclaration)): Likewise.
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
(DeclVisitor::visit(VarDeclaration)): Likewise.
(DeclVisitor::visit(TypeInfoDeclaration)): Likewise.

From-SVN: r270478
gcc/d/ChangeLog
gcc/d/decl.cc