From 66c9a69a6160090cc53560e263523d996867eb73 Mon Sep 17 00:00:00 2001 From: Tim Keith Date: Mon, 26 Feb 2018 15:07:24 -0800 Subject: [PATCH] [flang] Fix classes with variant and other fields Fortran::FormatItem and UseStmt have both normal fields and a variant named 'u'. The Walk calls for the normal fields were missing. These were the only two classes I found where this occurs. Original-commit: flang-compiler/f18@23b8695a74631e0207f7c87be5c602896a9f0880 Reviewed-on: https://github.com/flang-compiler/f18/pull/17 --- flang/lib/parser/parse-tree-visitor.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/flang/lib/parser/parse-tree-visitor.h b/flang/lib/parser/parse-tree-visitor.h index 4ec12e9..4400641 100644 --- a/flang/lib/parser/parse-tree-visitor.h +++ b/flang/lib/parser/parse-tree-visitor.h @@ -295,6 +295,10 @@ void Walk(const Fortran::DerivedTypeDataEditDesc &x, V &visitor) { visitor.Post(x); } } +template void Walk(const Fortran::FormatItem &x, V &visitor) { + Walk(x.repeatCount, visitor); + WalkUnionClass(x, visitor); +} template void Walk(const Fortran::IntrinsicTypeDataEditDesc &x, V &visitor) { if (visitor.Pre(x)) { @@ -401,6 +405,11 @@ void Walk(const TypeBoundProcedureStmt::WithoutInterface &x, V &visitor) { visitor.Post(x); } } +template void Walk(const UseStmt &x, V &visitor) { + Walk(x.nature, visitor); + Walk(x.moduleName, visitor); + WalkUnionClass(x, visitor); +} template void Walk(const WriteStmt &x, V &visitor) { if (visitor.Pre(x)) { Walk(x.iounit, visitor); @@ -1037,9 +1046,6 @@ void Walk(const FormTeamStmt::FormTeamSpec &x, V &visitor) { template void Walk(const Format &x, V &visitor) { WalkUnionClass(x, visitor); } -template void Walk(const Fortran::FormatItem &x, V &visitor) { - WalkUnionClass(x, visitor); -} template void Walk(const GenericSpec &x, V &visitor) { WalkUnionClass(x, visitor); } @@ -1197,9 +1203,6 @@ template void Walk(const TypeParamValue &x, V &visitor) { template void Walk(const TypeSpec &x, V &visitor) { WalkUnionClass(x, visitor); } -template void Walk(const UseStmt &x, V &visitor) { - WalkUnionClass(x, visitor); -} template void Walk(const Variable &x, V &visitor) { WalkUnionClass(x, visitor); } -- 2.7.4