[flang-commits] [flang] 75f459d - [flang][hlfir][NFC] catch dynamically optional args with no lowering

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Jul 18 04:04:41 PDT 2023


Author: Tom Eccles
Date: 2023-07-18T11:03:35Z
New Revision: 75f459d555a46a337c9f77948392fa9d750ea555

URL: https://github.com/llvm/llvm-project/commit/75f459d555a46a337c9f77948392fa9d750ea555
DIFF: https://github.com/llvm/llvm-project/commit/75f459d555a46a337c9f77948392fa9d750ea555.diff

LOG: [flang][hlfir][NFC] catch dynamically optional args with no lowering

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

Added: 
    

Modified: 
    flang/lib/Lower/ConvertCall.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/ConvertCall.cpp b/flang/lib/Lower/ConvertCall.cpp
index f7d37f793e3694..c1d9d7ed7a37a6 100644
--- a/flang/lib/Lower/ConvertCall.cpp
+++ b/flang/lib/Lower/ConvertCall.cpp
@@ -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));


        


More information about the flang-commits mailing list