[PATCH] D94017: [flang] Fix bogus message on internal subprogram with alternate return
Eric Schweitz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 7 15:45:49 PST 2021
schweitz added inline comments.
================
Comment at: flang/lib/Semantics/expression.cpp:2148
bool hasAlternateReturns{
callee->arguments.size() < actualArgList.size()};
callStmt.typedCall.Reset(
----------------
jeanPerier wrote:
> That part of the code is now wrong (since argument list now contains the labels). This will yield wrong lowering. You could replace it with a call to a helper like:
>
> ```
> static bool HasAlternateReturns(const evaluate::ActualArguments &args) {
> for (const auto &arg : args) {
> if (arg && arg->isAlternateReturn()) {
> return true;
> }
> }
> return false;
> }
> ```
>
> and `bool hasAlternateReturns{HasAlternateReturns(callee->arguments)};`
Let me know if you'd like Val to look at this one, Jean.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94017/new/
https://reviews.llvm.org/D94017
More information about the llvm-commits
mailing list