[PATCH] D94567: [flang] Do not create HostAssoc symbols in derived type scopes
Peter Klausler via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 17:06:55 PST 2021
klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
When needed due to a specification expression in a derived type,
the host association symbols should be created in the surrounding
subprogram's scope instead.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D94567
Files:
flang/lib/Semantics/resolve-names.cpp
Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -2050,7 +2050,9 @@
}
Symbol &ScopeHandler::MakeHostAssocSymbol(
const parser::Name &name, const Symbol &hostSymbol) {
- Symbol &symbol{MakeSymbol(name, HostAssocDetails{hostSymbol})};
+ Symbol &symbol{*NonDerivedTypeScope()
+ .try_emplace(name.source, HostAssocDetails{hostSymbol})
+ .first->second};
name.symbol = &symbol;
symbol.attrs() = hostSymbol.attrs(); // TODO: except PRIVATE, PUBLIC?
symbol.flags() = hostSymbol.flags();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94567.316278.patch
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210113/c45411d9/attachment.bin>
More information about the llvm-commits
mailing list