[PATCH, d] Committed use guard to prevent declaration pass from running multiple times

Iain Buclaw ibuclaw@gdcproject.org
Sun Apr 21 08:44:00 GMT 2019


This patch adds checks for semanticRun in the Declaration visitor
passes.  While it shouldn't happen during normal traversal of the AST
provided from the front-end, 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.

Regression tested on x86_64-linux-gnu.

Committed to trunk as r270478.


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: semanticrun.patch
Type: text/x-patch
Size: 2782 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190421/1caf025d/attachment.bin>

More information about the Gcc-patches mailing list