1 //===--- CIRGenTypeCache.h - Commonly used LLVM types and info -*- C++ --*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This structure provides a set of common types useful during CIR emission.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
14 #define LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
16 #include "clang/CIR/Dialect/IR/CIRTypes.h"
18 namespace clang::CIRGen
{
20 /// This structure provides a set of types that are commonly used
21 /// during IR emission. It's initialized once in CodeGenModule's
22 /// constructor and then copied around into new CIRGenFunction's.
23 struct CIRGenTypeCache
{
24 CIRGenTypeCache() = default;
29 // ClangIR signed integral types of common sizes
31 cir::IntType SInt16Ty
;
32 cir::IntType SInt32Ty
;
33 cir::IntType SInt64Ty
;
34 cir::IntType SInt128Ty
;
36 // ClangIR unsigned integral type of common sizes
38 cir::IntType UInt16Ty
;
39 cir::IntType UInt32Ty
;
40 cir::IntType UInt64Ty
;
41 cir::IntType UInt128Ty
;
43 // ClangIR floating-point types with fixed formats
45 cir::BF16Type BFloat16Ty
;
46 cir::SingleType FloatTy
;
47 cir::DoubleType DoubleTy
;
49 cir::FP128Type FP128Ty
;
52 } // namespace clang::CIRGen
54 #endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENTYPECACHE_H