1 //===-- Stop.h - generate stop 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_STOP_H 10 #define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_STOP_H 11 12 namespace llvm { 13 class StringRef; 14 } 15 16 namespace mlir { 17 class Value; 18 class Location; 19 } // namespace mlir 20 21 namespace fir { 22 class FirOpBuilder; 23 } 24 25 namespace fir::runtime { 26 27 /// Generate call to EXIT intrinsic runtime routine. 28 void genExit(fir::FirOpBuilder &, mlir::Location, mlir::Value status); 29 30 /// Generate call to ABORT intrinsic runtime routine. 31 void genAbort(fir::FirOpBuilder &, mlir::Location); 32 33 /// Generate call to crash the program with an error message when detecting 34 /// an invalid situation at runtime. 35 void genReportFatalUserError(fir::FirOpBuilder &, mlir::Location, 36 llvm::StringRef message); 37 38 } // namespace fir::runtime 39 #endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_STOP_H 40