[flang] Address review comments
authorTim Keith <tkeith@nvidia.com>
Thu, 7 Feb 2019 20:25:59 +0000 (12:25 -0800)
committerTim Keith <tkeith@nvidia.com>
Thu, 7 Feb 2019 20:25:59 +0000 (12:25 -0800)
Original-commit: flang-compiler/f18@9daa2351c2a6f8d67267d6b0e44f0cf25bd1acad
Reviewed-on: https://github.com/flang-compiler/f18/pull/277

flang/lib/semantics/mod-file.cc
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.cc
flang/lib/semantics/symbol.h

index f703ca1..f13ce14 100644 (file)
@@ -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<const Symbol *> CollectSymbols(const Scope &scope) {
   std::set<const Symbol *> symbols;  // to prevent duplicates
   std::vector<const Symbol *> sorted;
index f7d79c3..3754c40 100644 (file)
@@ -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;
     }
index 53a7964..75df629 100644 (file)
@@ -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<ObjectEntityDetails>(&details_)};
   return details && details->IsArray();
 }
index 22dedc9..df763d9 100644 (file)
@@ -452,7 +452,7 @@ public:
 
   void SetType(const DeclTypeSpec &);
 
-  bool IsArray() const;
+  bool IsObjectArray() const;
   bool IsSubprogram() const;
   bool IsSeparateModuleProc() const;
   bool HasExplicitInterface() const {