xref: /llvm-project/flang/include/flang/Optimizer/Builder/Runtime/Exceptions.h (revision ff862d6de92f478253a332ec48cfc2c2add76bb3)
1 //===-- Exceptions.h --------------------------------------------*- 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_EXCEPTIONS_H
10 #define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_EXCEPTIONS_H
11 
12 #include "mlir/IR/Value.h"
13 
14 namespace mlir {
15 class Location;
16 } // namespace mlir
17 
18 namespace fir {
19 class FirOpBuilder;
20 }
21 
22 namespace fir::runtime {
23 
24 /// Generate a runtime call to map a set of ieee_flag_type exceptions to a
25 /// libm fenv.h excepts value.
26 mlir::Value genMapExcept(fir::FirOpBuilder &builder, mlir::Location loc,
27                          mlir::Value excepts);
28 
29 mlir::Value genSupportHalting(fir::FirOpBuilder &builder, mlir::Location loc,
30                               mlir::Value excepts);
31 
32 mlir::Value genGetUnderflowMode(fir::FirOpBuilder &builder, mlir::Location loc);
33 void genSetUnderflowMode(fir::FirOpBuilder &builder, mlir::Location loc,
34                          mlir::Value bit);
35 
36 mlir::Value genGetModesTypeSize(fir::FirOpBuilder &builder, mlir::Location loc);
37 mlir::Value genGetStatusTypeSize(fir::FirOpBuilder &builder,
38                                  mlir::Location loc);
39 
40 } // namespace fir::runtime
41 #endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_EXCEPTIONS_H
42