[all-commits] [llvm/llvm-project] e2b896: [flang] Add EXECUTE_COMMAND_LINE runtime and lower...

Yi Wu via All-commits all-commits at lists.llvm.org
Wed Jan 10 02:03:00 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2b896aa640fec25f68d283948c1b44711087f0f
      https://github.com/llvm/llvm-project/commit/e2b896aa640fec25f68d283948c1b44711087f0f
  Author: Yi Wu <43659785+yi-wu-arm at users.noreply.github.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    M flang/docs/Intrinsics.md
    M flang/include/flang/Optimizer/Builder/IntrinsicCall.h
    A flang/include/flang/Optimizer/Builder/Runtime/Execute.h
    A flang/include/flang/Runtime/execute.h
    M flang/lib/Optimizer/Builder/CMakeLists.txt
    M flang/lib/Optimizer/Builder/IntrinsicCall.cpp
    A flang/lib/Optimizer/Builder/Runtime/Execute.cpp
    M flang/runtime/CMakeLists.txt
    M flang/runtime/command.cpp
    A flang/runtime/execute.cpp
    M flang/runtime/tools.cpp
    M flang/runtime/tools.h
    A flang/test/Lower/Intrinsics/execute_command_line-optional.f90
    A flang/test/Lower/Intrinsics/execute_command_line.f90
    M flang/unittests/Runtime/CommandTest.cpp

  Log Message:
  -----------
  [flang] Add EXECUTE_COMMAND_LINE runtime and lowering intrinsics implementation (#74077)

This patch add support of intrinsics Fortran 2008 EXECUTE_COMMAND_LINE.
The patch contains both the lowering and the runtime code and works on
both Windows and Linux. The patch contains a list of commits, to convey
the authorship and the history of changes. Some implementation specifics
or status has been added to `flang/docs/Intrinsics.md`.

I have provided a summary of the usage and the options required for the
`EXECUTE_COMMAND_LINE intrinsic`. The intrinsic supports both a
synchronous
(by default) and an asynchronous option.

| System  | Mode  | Implemention              |
|---------|-------|---------------------------|
| Linux   | Sync  | std::system()             |
| Windows | Sync  | std::system()             |
| Linux   | Async | fork()  |
| Windows | Async | CreateProcess             |

Support for the SYSTEM GNU extension will be added in a separate PR.

Co-authored with @jeffhammond

---------

Signed-off-by: Jeff Hammond <jeff.science at gmail.com>
Co-authored-by: Jeff Hammond <jeff.science at gmail.com>
Co-authored-by: Yi Wu <yiwu02 at wdev-yiwu02.arm.com>




More information about the All-commits mailing list