From d0d92e4eff1ca7792ee08a32b9c5aaf8b3ed6d70 Mon Sep 17 00:00:00 2001 From: Tim Keith Date: Thu, 7 Feb 2019 12:25:59 -0800 Subject: [PATCH] [flang] Address review comments Original-commit: flang-compiler/f18@9daa2351c2a6f8d67267d6b0e44f0cf25bd1acad Reviewed-on: https://github.com/flang-compiler/f18/pull/277 --- flang/lib/semantics/mod-file.cc | 2 +- flang/lib/semantics/resolve-names.cc | 4 ++-- flang/lib/semantics/symbol.cc | 2 +- flang/lib/semantics/symbol.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flang/lib/semantics/mod-file.cc b/flang/lib/semantics/mod-file.cc index f703ca1..f13ce14 100644 --- a/flang/lib/semantics/mod-file.cc +++ b/flang/lib/semantics/mod-file.cc @@ -289,7 +289,7 @@ void ModFileWriter::PutUseExtraAttr( } // Collect the symbols of this scope sorted by their original order, not name. -// Namelists are an exception: they are sorted to the end. +// Namelists are an exception: they are sorted after other symbols. std::vector CollectSymbols(const Scope &scope) { std::set symbols; // to prevent duplicates std::vector sorted; diff --git a/flang/lib/semantics/resolve-names.cc b/flang/lib/semantics/resolve-names.cc index f7d79c3..3754c40 100644 --- a/flang/lib/semantics/resolve-names.cc +++ b/flang/lib/semantics/resolve-names.cc @@ -2358,7 +2358,7 @@ void DeclarationVisitor::CheckAccessibility( void DeclarationVisitor::CheckScalarIntegerType(const parser::Name &name) { if (name.symbol != nullptr) { const Symbol &symbol{*name.symbol}; - if (symbol.IsArray()) { + if (symbol.IsObjectArray()) { Say(name, "Variable '%s' is not scalar"_err_en_US); return; } @@ -3389,7 +3389,7 @@ void ConstructVisitor::Post(const parser::ConcurrentControl &x) { if (auto *type{prev->GetType()}) { symbol.SetType(*type); } - if (prev->IsArray()) { + if (prev->IsObjectArray()) { SayWithDecl(name, *prev, "Index variable '%s' is not scalar"_err_en_US); return; } diff --git a/flang/lib/semantics/symbol.cc b/flang/lib/semantics/symbol.cc index 53a7964..75df629 100644 --- a/flang/lib/semantics/symbol.cc +++ b/flang/lib/semantics/symbol.cc @@ -214,7 +214,7 @@ void Symbol::SetType(const DeclTypeSpec &type) { details_); } -bool Symbol::IsArray() const { +bool Symbol::IsObjectArray() const { const auto *details{std::get_if(&details_)}; return details && details->IsArray(); } diff --git a/flang/lib/semantics/symbol.h b/flang/lib/semantics/symbol.h index 22dedc9..df763d9 100644 --- a/flang/lib/semantics/symbol.h +++ b/flang/lib/semantics/symbol.h @@ -452,7 +452,7 @@ public: void SetType(const DeclTypeSpec &); - bool IsArray() const; + bool IsObjectArray() const; bool IsSubprogram() const; bool IsSeparateModuleProc() const; bool HasExplicitInterface() const { -- 2.7.4