Skip to content

Commit

Permalink
[flang] Address review comment
Browse files Browse the repository at this point in the history
Original-commit: flang-compiler/f18@5d6749c
Reviewed-on: flang-compiler/f18#565
Tree-same-pre-rewrite: false
  • Loading branch information
klausler committed Jul 16, 2019
1 parent 8f40dbc commit 367d3ee
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions flang/lib/semantics/resolve-names.cc
Expand Up @@ -763,7 +763,7 @@ class DeclarationVisitor : public ArraySpecVisitor,
void CheckSaveStmts();
void CheckEquivalenceSets();
bool CheckNotInBlock(const char *);
Symbol *NameIsKnownOrIntrinsic(const parser::Name &);
bool NameIsKnownOrIntrinsic(const parser::Name &);

// Each of these returns a pointer to a resolved Name (i.e. with symbol)
// or nullptr in case of error.
Expand Down Expand Up @@ -829,7 +829,7 @@ class DeclarationVisitor : public ArraySpecVisitor,
Attrs HandleSaveName(const SourceName &, Attrs);
void AddSaveName(std::set<SourceName> &, const SourceName &);
void SetSaveAttr(Symbol &);
Symbol *HandleUnrestrictedSpecificIntrinsicFunction(const parser::Name &);
bool HandleUnrestrictedSpecificIntrinsicFunction(const parser::Name &);
const parser::Name *FindComponent(const parser::Name *, const parser::Name &);
void CheckInitialDataTarget(const Symbol &, const SomeExpr &, SourceName);
void Initialization(const parser::Name &, const parser::Initialization &,
Expand Down Expand Up @@ -3660,9 +3660,10 @@ Symbol &DeclarationVisitor::MakeCommonBlockSymbol(const parser::Name &name) {
return Resolve(name, currScope().MakeCommonBlock(name.source));
}

Symbol *DeclarationVisitor::NameIsKnownOrIntrinsic(const parser::Name &name) {
bool DeclarationVisitor::NameIsKnownOrIntrinsic(const parser::Name &name) {
if (Symbol * symbol{FindSymbol(name)}) {
return &Resolve(name, *symbol);
Resolve(name, *symbol);
return true;
} else {
return HandleUnrestrictedSpecificIntrinsicFunction(name);
}
Expand Down Expand Up @@ -3699,7 +3700,7 @@ void DeclarationVisitor::CheckCommonBlockDerivedType(
}
}

Symbol *DeclarationVisitor::HandleUnrestrictedSpecificIntrinsicFunction(
bool DeclarationVisitor::HandleUnrestrictedSpecificIntrinsicFunction(
const parser::Name &name) {
if (context()
.intrinsics()
Expand All @@ -3711,9 +3712,9 @@ Symbol *DeclarationVisitor::HandleUnrestrictedSpecificIntrinsicFunction(
MakeSymbol(InclusiveScope(), name.source, Attrs{Attr::INTRINSIC})};
symbol.set_details(ProcEntityDetails{});
Resolve(name, symbol);
return &symbol;
true;
} else {
return nullptr;
return false;
}
}

Expand Down

0 comments on commit 367d3ee

Please sign in to comment.