[all-commits] [llvm/llvm-project] dfb7d5: [flang] Lower VALUE derived types in BIND(C) inter...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Dec 12 04:20:55 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dfb7d56a05ca3e36a792a35bd89e4fe25473da04
      https://github.com/llvm/llvm-project/commit/dfb7d56a05ca3e36a792a35bd89e4fe25473da04
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2023-12-12 (Tue, 12 Dec 2023)

  Changed paths:
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    A flang/test/Lower/HLFIR/bindc-value-derived.f90

  Log Message:
  -----------
  [flang] Lower VALUE derived types in BIND(C) interface (#74847)

VALUE derived type are passed by reference outside of BIND(C) interface.
The ABI is much simpler and it is possible for these arguments to have
the OPTIONAL attribute.

In the BIND(C) context, these arguments must follow the C ABI for
struct, which may lead the data to be passed in register. OPTIONAL is
also forbidden for those arguments, so it is safe to directly use the
fir.type<T> type for the func.func argument.

Codegen is in charge of later applying the C passing ABI according to
the target (https://github.com/llvm/llvm-project/pull/74829).




More information about the All-commits mailing list