[all-commits] [llvm/llvm-project] 262dad: [flang] Deal with NULL() passed as actual arg to u...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Mon Jan 23 00:50:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 262dad4a8133c2befd6dae4cef5cee5b602f85cb
      https://github.com/llvm/llvm-project/commit/262dad4a8133c2befd6dae4cef5cee5b602f85cb
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIRType.h
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Optimizer/Dialect/FIRType.cpp
    M flang/test/Lower/polymorphic.f90

  Log Message:
  -----------
  [flang] Deal with NULL() passed as actual arg to unlimited polymorphic dummy

NULL() passed as actual argument to a procedure with an optional
dummy argument is represented with `fir.box<none>` type. When the dummy
argument is polymoprhic or unlimited polymorphic, the SelectOp will complain
if the types of the two arguments are not identical. Add a conversion from
`fir.box<none>` to `fir.class<none>` in that case.
Other situations with optional will require a fir.rebox and will be done in
a follow up patch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D142203




More information about the All-commits mailing list