xref: /llvm-project/flang/include/flang/Optimizer/Builder/Runtime/Execute.h (revision e2b896aa640fec25f68d283948c1b44711087f0f)
1 //===-- Command.cpp -- generate command line runtime API calls ------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_EXECUTE_H
10 #define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_EXECUTE_H
11 
12 namespace mlir {
13 class Value;
14 class Location;
15 } // namespace mlir
16 
17 namespace fir {
18 class FirOpBuilder;
19 } // namespace fir
20 
21 namespace fir::runtime {
22 
23 /// Generate a call to the ExecuteCommandLine runtime function which implements
24 /// the GET_EXECUTE_ARGUMENT intrinsic.
25 /// \p wait must be bool that can be absent.
26 /// \p exitstat, \p cmdstat and \p cmdmsg must be fir.box that can be
27 /// absent (but not null mlir values). The status exitstat and cmdstat are
28 /// returned, along with the message cmdmsg.
29 void genExecuteCommandLine(fir::FirOpBuilder &, mlir::Location,
30                            mlir::Value command, mlir::Value wait,
31                            mlir::Value exitstat, mlir::Value cmdstat,
32                            mlir::Value cmdmsg);
33 
34 } // namespace fir::runtime
35 #endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_EXECUTE_H
36