Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
IRType.h
Go to the documentation of this file.
1#ifndef PROTEUS_FRONTEND_IRTYPE_H
2#define PROTEUS_FRONTEND_IRTYPE_H
3
4#include <cstddef>
5
6namespace proteus {
7
12enum class IRTypeKind {
13 Void,
14 Int1,
15 Int16,
16 Int32,
17 Int64,
18 Float,
19 Double,
20 Pointer,
21 Array,
22};
23
34struct IRType {
36
38 bool Signed = false;
39
41 std::size_t NElem = 0;
42
45
47 unsigned AddrSpace = 0;
48};
49
51inline bool isIntegerKind(const IRType &T) {
52 return T.Kind == IRTypeKind::Int1 || T.Kind == IRTypeKind::Int16 ||
54}
55
57inline bool isFloatingPointKind(const IRType &T) {
59}
60
61} // namespace proteus
62
63#endif // PROTEUS_FRONTEND_IRTYPE_H
Definition MemoryCache.h:26
bool isFloatingPointKind(const IRType &T)
Returns true when T is a floating-point kind (Float or Double).
Definition IRType.h:57
IRTypeKind
Definition IRType.h:12
bool isIntegerKind(const IRType &T)
Returns true when T is an integer kind (Int1, Int16, Int32, or Int64).
Definition IRType.h:51
Definition IRType.h:34
IRTypeKind Kind
Definition IRType.h:35
bool Signed
Signedness of the type (meaningful for integer kinds and pointer-to-int).
Definition IRType.h:38
std::size_t NElem
Number of array elements; only meaningful when Kind == Array.
Definition IRType.h:41
IRTypeKind ElemKind
Element type kind; meaningful when Kind == Pointer or Kind == Array.
Definition IRType.h:44
unsigned AddrSpace
Address space of the pointer itself; only meaningful when Kind == Pointer.
Definition IRType.h:47