clang 22.0.0git
CIRGenTypeCache.h
Go to the documentation of this file.
1//===--- CIRGenTypeCache.h - Commonly used LLVM types and info -*- 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// This structure provides a set of common types useful during CIR emission.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
14#define LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
15
16#include "clang/AST/CharUnits.h"
18
19namespace clang::CIRGen {
20
21/// This structure provides a set of types that are commonly used
22/// during IR emission. It's initialized once in CodeGenModule's
23/// constructor and then copied around into new CIRGenFunction's.
26
27 // ClangIR void type
28 cir::VoidType VoidTy;
29
30 // ClangIR signed integral types of common sizes
31 cir::IntType SInt8Ty;
32 cir::IntType SInt16Ty;
33 cir::IntType SInt32Ty;
34 cir::IntType SInt64Ty;
35 cir::IntType SInt128Ty;
36
37 // ClangIR unsigned integral type of common sizes
38 cir::IntType UInt8Ty;
39 cir::IntType UInt16Ty;
40 cir::IntType UInt32Ty;
41 cir::IntType UInt64Ty;
42 cir::IntType UInt128Ty;
43
44 // ClangIR floating-point types with fixed formats
45 cir::FP16Type FP16Ty;
46 cir::BF16Type BFloat16Ty;
47 cir::SingleType FloatTy;
48 cir::DoubleType DoubleTy;
49 cir::FP80Type FP80Ty;
50 cir::FP128Type FP128Ty;
51
52 /// intptr_t, size_t, and ptrdiff_t, which we assume are the same size.
53 union {
54 mlir::Type UIntPtrTy;
55 mlir::Type SizeTy;
56 };
57
58 mlir::Type PtrDiffTy;
59
60 /// void* in address space 0
61 cir::PointerType VoidPtrTy;
62 cir::PointerType UInt8PtrTy;
63
64 /// The size and alignment of a pointer into the generic address space.
65 union {
66 unsigned char PointerAlignInBytes;
67 unsigned char PointerSizeInBytes;
68 };
69
70 /// The alignment of size_t.
71 unsigned char SizeAlignInBytes;
72
75 }
76
79 }
80};
81
82} // namespace clang::CIRGen
83
84#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENTYPECACHE_H
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
Definition: CharUnits.h:63
This structure provides a set of types that are commonly used during IR emission.
cir::PointerType VoidPtrTy
void* in address space 0
clang::CharUnits getPointerAlign() const
unsigned char SizeAlignInBytes
The alignment of size_t.
clang::CharUnits getSizeAlign() const