Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
TypeMap.h
Go to the documentation of this file.
1#ifndef PROTEUS_FRONTEND_TYPEMAP_H
2#define PROTEUS_FRONTEND_TYPEMAP_H
3
5
6#include <cstddef>
7#include <optional>
8
9namespace proteus {
10
15template <typename T> struct TypeMap;
16
17// Specialization declarations; definitions are in TypeMap.cpp.
18
19template <> struct TypeMap<void> {
20 static IRType get(std::size_t NElem = 0);
21 static std::optional<IRType> getPointerElemType();
22 static bool isSigned();
23};
24
25template <> struct TypeMap<float> {
26 static IRType get(std::size_t NElem = 0);
27 static std::optional<IRType> getPointerElemType();
28 static bool isSigned();
29};
30
31template <> struct TypeMap<float[]> {
32 static IRType get(std::size_t NElem);
33 static std::optional<IRType> getPointerElemType();
34 static bool isSigned();
35};
36
37template <> struct TypeMap<double> {
38 static IRType get(std::size_t NElem = 0);
39 static std::optional<IRType> getPointerElemType();
40 static bool isSigned();
41};
42
43template <> struct TypeMap<double[]> {
44 static IRType get(std::size_t NElem);
45 static std::optional<IRType> getPointerElemType();
46 static bool isSigned();
47};
48
49template <> struct TypeMap<size_t> {
50 static IRType get(std::size_t NElem = 0);
51 static std::optional<IRType> getPointerElemType();
52 static bool isSigned();
53};
54
55template <> struct TypeMap<size_t[]> {
56 static IRType get(std::size_t NElem);
57 static std::optional<IRType> getPointerElemType();
58 static bool isSigned();
59};
60
61template <> struct TypeMap<int> {
62 static IRType get(std::size_t NElem = 0);
63 static std::optional<IRType> getPointerElemType();
64 static bool isSigned();
65};
66
67template <> struct TypeMap<int[]> {
68 static IRType get(std::size_t NElem);
69 static std::optional<IRType> getPointerElemType();
70 static bool isSigned();
71};
72
73template <> struct TypeMap<unsigned int> {
74 static IRType get(std::size_t NElem = 0);
75 static std::optional<IRType> getPointerElemType();
76 static bool isSigned();
77};
78
79template <> struct TypeMap<unsigned int[]> {
80 static IRType get(std::size_t NElem);
81 static std::optional<IRType> getPointerElemType();
82 static bool isSigned();
83};
84
85template <> struct TypeMap<int *> {
86 static IRType get(std::size_t NElem = 0);
87 static std::optional<IRType> getPointerElemType();
88 static bool isSigned();
89};
90
91template <> struct TypeMap<unsigned int *> {
92 static IRType get(std::size_t NElem = 0);
93 static std::optional<IRType> getPointerElemType();
94 static bool isSigned();
95};
96
97template <> struct TypeMap<bool> {
98 static IRType get(std::size_t NElem = 0);
99 static std::optional<IRType> getPointerElemType();
100 static bool isSigned();
101};
102
103template <> struct TypeMap<bool[]> {
104 static IRType get(std::size_t NElem);
105 static std::optional<IRType> getPointerElemType();
106 static bool isSigned();
107};
108
109template <> struct TypeMap<double *> {
110 static IRType get(std::size_t NElem = 0);
111 static std::optional<IRType> getPointerElemType();
112 static bool isSigned();
113};
114
115template <> struct TypeMap<float *> {
116 static IRType get(std::size_t NElem = 0);
117 static std::optional<IRType> getPointerElemType();
118 static bool isSigned();
119};
120
121// Forward const types to their non-const equivalent.
122template <typename T> struct TypeMap<const T> : TypeMap<T> {};
123
124template <typename T> struct TypeMap<const T *> : TypeMap<T *> {};
125
126// Forward reference types to their value types.
127template <typename T> struct TypeMap<T &> : TypeMap<T> {};
128
129} // namespace proteus
130
131#endif // PROTEUS_FRONTEND_TYPEMAP_H
Definition MemoryCache.h:26
Definition IRType.h:34
static IRType get(std::size_t NElem=0)
static std::optional< IRType > getPointerElemType()
static IRType get(std::size_t NElem=0)
static std::optional< IRType > getPointerElemType()
static IRType get(std::size_t NElem)
static std::optional< IRType > getPointerElemType()
Definition TypeMap.h:15