[all-commits] [llvm/llvm-project] 8f5df8: [Flang][Semantics] Allow declare target to be used...
agozillon via All-commits
all-commits at lists.llvm.org
Tue Jan 21 07:05:35 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8f5df8891840bb698fec682c1d98346708c038be
https://github.com/llvm/llvm-project/commit/8f5df8891840bb698fec682c1d98346708c038be
Author: agozillon <Andrew.Gozillon at amd.com>
Date: 2025-01-21 (Tue, 21 Jan 2025)
Changed paths:
M flang/lib/Semantics/resolve-names.cpp
A flang/test/Semantics/OpenMP/declare-target08.f90
Log Message:
-----------
[Flang][Semantics] Allow declare target to be used on functions external to the declare targets scope (#122546)
Whilst a little contrived, OpenMP allows you to utilise declare target
in the scope of one function to mark another function declare target,
currently this leads to a semantic error.
This appears to be because when we process the declare target directive
in the scope of another function (referring to another function), we do
not search externally from that functions scope to find possible prior
definitions, we only search in the current scope, this leads to us
implicitly defining a new variable and using that when implicit none is
not specified and then error'ng out or error'ng out earlier when implict
none is defined. This patch tries to address this behaviour by looking
externally for a function first and using that, before defaulting back
to the prior behaviour.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list