[all-commits] [llvm/llvm-project] a459a2: [flang] Fix SELECT TYPE lowering when CLASS DEFAUL...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Thu Jan 19 08:32:47 PST 2023


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

  Changed paths:
    M flang/lib/Lower/Bridge.cpp
    M flang/test/Lower/select-type.f90

  Log Message:
  -----------
  [flang] Fix SELECT TYPE lowering when CLASS DEFAULT is not the last type guard

CLASS DEFAULT needs to be the last attribute when fir.select_type op is created.
It needs to be at its actual position in the Fortran code when the TypeGuardStmt
are processed. The current lowering was crashing when CLASS DEFAULT was not at
the last position.
This patch fixes the issue by tracking the actual position of the CLASS DEFAULT
type guard and set it at the correct position after the fir.select_type op
is created.

Reviewed By: jeanPerier, PeteSteinfeld

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




More information about the All-commits mailing list