File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
include/clang/CIR/Interfaces Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1- // ===- CIRFPTypeInterface.td - CIR FP Interface Definitions -----*- C++ -* -===//
1+ //===-- ------------------------------------------------------------------- -===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77//===----------------------------------------------------------------------===//
8+ //
9+ // Defines the interface to generically handle CIR floating-point types.
10+ //
11+ //===----------------------------------------------------------------------===//
812
913#ifndef LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_TD
1014#define LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_TD
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ bool CIRGenTypes::isFuncParamTypeConvertible(clang::QualType type) {
3030 // certain circumstances have been reached.
3131 assert (!type->getAs <MemberPointerType>() && " NYI" );
3232
33- // If this isn't a tagged type, we can convert it!
33+ // If this isn't a tag type, we can convert it.
3434 const TagType *tagType = type->getAs <TagType>();
3535 if (!tagType)
3636 return true ;
@@ -171,9 +171,15 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
171171 resultType = cgm.BFloat16Ty ;
172172 break ;
173173 case BuiltinType::Float:
174+ assert (&astContext.getFloatTypeSemantics (type) ==
175+ &llvm::APFloat::IEEEsingle () &&
176+ " ClangIR only supports float as IEEE 32-bit" );
174177 resultType = cgm.FloatTy ;
175178 break ;
176179 case BuiltinType::Double:
180+ assert (&astContext.getFloatTypeSemantics (type) ==
181+ &llvm::APFloat::IEEEdouble () &&
182+ " ClangIR only supports double as IEEE 64-bit" );
177183 resultType = cgm.DoubleTy ;
178184 break ;
179185 case BuiltinType::LongDouble:
Original file line number Diff line number Diff line change 1- // ====- CIRFPTypeInterface.cpp - Interface for floating-point types -------===//
1+ // ===--------------------------------------------------------------- -------===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
8+ //
9+ // Defines the interface to generically handle CIR floating-point types.
10+ //
11+ // ===----------------------------------------------------------------------===//
812
913#include " clang/CIR/Interfaces/CIRFPTypeInterface.h"
1014
You can’t perform that action at this time.
0 commit comments