//===-- runtime/cpp-type.h --------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // Maps Fortran intrinsic types to C++ types used in the runtime. #ifndef FORTRAN_RUNTIME_CPP_TYPE_H_ #define FORTRAN_RUNTIME_CPP_TYPE_H_ #include "flang/Common/Fortran.h" #include "flang/Common/uint128.h" #include #include namespace Fortran::runtime { using common::TypeCategory; template struct CppTypeForHelper {}; template using CppTypeFor = typename CppTypeForHelper::type; template struct CppTypeForHelper { using type = common::HostSignedIntType<8 * KIND>; }; // TODO: REAL/COMPLEX(2 & 3) template <> struct CppTypeForHelper { using type = float; }; template <> struct CppTypeForHelper { using type = double; }; template <> struct CppTypeForHelper { using type = long double; }; template <> struct CppTypeForHelper { using type = long double; }; template struct CppTypeForHelper { using type = std::complex>; }; template <> struct CppTypeForHelper { using type = char; }; template <> struct CppTypeForHelper { using type = char16_t; }; template <> struct CppTypeForHelper { using type = char32_t; }; template struct CppTypeForHelper { using type = common::HostSignedIntType<8 * KIND>; }; template <> struct CppTypeForHelper { using type = bool; }; } // namespace Fortran::runtime #endif // FORTRAN_RUNTIME_CPP_TYPE_H_