1 //===- TemporaryStack.h --- temporary stack runtime API calls ---*- C++ -*-===// 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_TEMPORARYSTACK_H 10 #define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TEMPORARYSTACK_H 11 12 namespace mlir { 13 class Value; 14 class Location; 15 } // namespace mlir 16 17 namespace fir { 18 class FirOpBuilder; 19 } 20 21 namespace fir::runtime { 22 23 mlir::Value genCreateValueStack(mlir::Location loc, fir::FirOpBuilder &builder); 24 25 void genPushValue(mlir::Location loc, fir::FirOpBuilder &builder, 26 mlir::Value opaquePtr, mlir::Value boxValue); 27 void genValueAt(mlir::Location loc, fir::FirOpBuilder &builder, 28 mlir::Value opaquePtr, mlir::Value i, mlir::Value retValueBox); 29 30 void genDestroyValueStack(mlir::Location loc, fir::FirOpBuilder &builder, 31 mlir::Value opaquePtr); 32 33 mlir::Value genCreateDescriptorStack(mlir::Location loc, 34 fir::FirOpBuilder &builder); 35 36 void genPushDescriptor(mlir::Location loc, fir::FirOpBuilder &builder, 37 mlir::Value opaquePtr, mlir::Value boxValue); 38 void genDescriptorAt(mlir::Location loc, fir::FirOpBuilder &builder, 39 mlir::Value opaquePtr, mlir::Value i, 40 mlir::Value retValueBox); 41 42 void genDestroyDescriptorStack(mlir::Location loc, fir::FirOpBuilder &builder, 43 mlir::Value opaquePtr); 44 } // namespace fir::runtime 45 #endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TEMPORARYSTACK_H 46