Skip to content

Commit

Permalink
[flang][hlfir][NFC] catch dynamically optional args with no lowering
Browse files Browse the repository at this point in the history
These should be lowered with genOptionalValue as in D154897, but I
haven't found any cases where this code path is actually hit (flang
tests, gfortran test suite), so I don't think it would be testable.
Adding an assertion for if this code path ever becomes live.

Differential Revision: https://reviews.llvm.org/D155477
  • Loading branch information
tblah committed Jul 18, 2023
1 parent db7b665 commit 75f459d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flang/lib/Lower/ConvertCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,8 @@ genIntrinsicRefCore(Fortran::lower::PreparedActualArguments &loweredActuals,
}
if (!argLowering) {
// No argument lowering instruction, lower by value.
assert(!arg.value()->handleDynamicOptional() &&
"should use genOptionalValue");
hlfir::Entity actual = arg.value()->getActual(loc, builder);
operands.emplace_back(
Fortran::lower::convertToValue(loc, converter, actual, stmtCtx));
Expand Down

0 comments on commit 75f459d

Please sign in to comment.