[flang-commits] [PATCH] D109262: [flang] Fix GetHostProcedure() for main program
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Fri Sep 3 15:10:29 PDT 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.
It only worked for internal procedures of subprograms,
but must also allow for internal procedures of the
main program. This broke the use of host-associated
implicitly-typed symbols in specification expressions
of internal procedures.
https://reviews.llvm.org/D109262
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
@@ -2038,7 +2038,14 @@
Scope *ScopeHandler::GetHostProcedure() {
Scope &parent{InclusiveScope().parent()};
- return parent.kind() == Scope::Kind::Subprogram ? &parent : nullptr;
+ switch (parent.kind()) {
+ case Scope::Kind::Subprogram:
+ return &parent;
+ case Scope::Kind::MainProgram:
+ return &parent;
+ default:
+ return nullptr;
+ }
}
Scope &ScopeHandler::NonDerivedTypeScope() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109262.370677.patch
Type: text/x-patch
Size: 608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210903/a343fa1b/attachment.bin>
More information about the flang-commits
mailing list