[all-commits] [llvm/llvm-project] ddc939: [flang] Support lowering of intrinsic module proce...

PeixinQiao via All-commits all-commits at lists.llvm.org
Wed Aug 31 08:39:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ddc939fe15e420e2d3d9d156a8cfa8ce790573ab
      https://github.com/llvm/llvm-project/commit/ddc939fe15e420e2d3d9d156a8cfa8ce790573ab
  Author: Peixin Qiao <qiaopeixin at huawei.com>
  Date:   2022-08-31 (Wed, 31 Aug 2022)

  Changed paths:
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/IntrinsicCall.cpp
    A flang/test/Lower/Intrinsics/c_funloc.f90

  Log Message:
  -----------
  [flang] Support lowering of intrinsic module procedure C_FUNLOC

As Fortran 2018 18.2.3.5, the intrinsic c_funloc(x) gets the C address
of argument x. It returns the scalar of type C_FUNPTR. As defined in
iso_c_binding in flang/module/__fortran_builtins.f90, C_FUNPTR is the
derived type with only one component of integer 64.

This follows the implementation of https://reviews.llvm.org/D129659. The
argument is lowered as ProcBox and the address is generated using
fir.box_addr.

Reviewed By: jeanPerier, clementval

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




More information about the All-commits mailing list