From 6746a18e6b9542ec4c92bbe6a1d8ae8552d31296 Mon Sep 17 00:00:00 2001 From: Tim Keith Date: Wed, 18 Apr 2018 15:50:36 -0700 Subject: [PATCH] [flang] Address review comments. Original-commit: flang-compiler/f18@d3a363d6cbcb154201f45670c0a60edbff260719 Reviewed-on: https://github.com/flang-compiler/f18/pull/60 Tree-same-pre-rewrite: false --- flang/lib/semantics/resolve-names.cc | 2 +- flang/lib/semantics/rewrite-parse-tree.cc | 6 +++--- flang/lib/semantics/rewrite-parse-tree.h | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/flang/lib/semantics/resolve-names.cc b/flang/lib/semantics/resolve-names.cc index 87428bf..0cf5477 100644 --- a/flang/lib/semantics/resolve-names.cc +++ b/flang/lib/semantics/resolve-names.cc @@ -399,7 +399,7 @@ private: const parser::Name *funcResultName_{nullptr}; // The attribute corresponding to the statement containing an ObjectDecl std::optional objectDeclAttr_; - // Set when we a statement function that is really an array assignment + // Set when we see a stmt function that is really an array element assignment bool badStmtFuncFound_{false}; // Create a subprogram symbol in the current scope and push a new scope. diff --git a/flang/lib/semantics/rewrite-parse-tree.cc b/flang/lib/semantics/rewrite-parse-tree.cc index 89a2d29..990a154 100644 --- a/flang/lib/semantics/rewrite-parse-tree.cc +++ b/flang/lib/semantics/rewrite-parse-tree.cc @@ -12,7 +12,7 @@ namespace Fortran::semantics { using symbolMap = std::map; /// Walk the parse tree and add symbols from the symbolMap in Name nodes. -/// Convert mis-identified statement functions to array assignments. +/// Convert mis-identified statement functions to array element assignments. class RewriteMutator { public: RewriteMutator(const symbolMap &symbols) : symbols_{symbols} {} @@ -53,7 +53,7 @@ public: bool Pre(parser::ExecutionPart &x) { auto origFirst = x.v.begin(); // insert each elem before origFirst for (stmtFuncType &sf : stmtFuncsToConvert) { - x.v.insert(origFirst, std::move(ConvertToAssignment(sf))); + x.v.insert(origFirst, ConvertToAssignment(sf)); } stmtFuncsToConvert.clear(); return true; @@ -64,7 +64,7 @@ private: std::list stmtFuncsToConvert; // Convert a statement function statement to an ExecutionPartConstruct - // containing an array assignment statement. + // containing an array element assignment statement. static parser::ExecutionPartConstruct ConvertToAssignment(stmtFuncType &x) { parser::StmtFunctionStmt &sf{*x.statement}; auto &funcName = std::get(sf.t); diff --git a/flang/lib/semantics/rewrite-parse-tree.h b/flang/lib/semantics/rewrite-parse-tree.h index 725ddca..ff2f990 100644 --- a/flang/lib/semantics/rewrite-parse-tree.h +++ b/flang/lib/semantics/rewrite-parse-tree.h @@ -1,11 +1,7 @@ namespace Fortran::parser { - class Program; - } // namespace Fortran::parser namespace Fortran::semantics { - void RewriteParseTree(parser::Program &); - } // namespace Fortran::semantics -- 2.7.4