13#ifndef LLVM_CLANG_AST_INTERP_TYPE_H
14#define LLVM_CLANG_AST_INTERP_TYPE_H
16#include "llvm/Support/raw_ostream.h"
29template <
bool Signed>
class IntegralAP;
30template <
unsigned Bits,
bool Signed>
class Integral;
59inline llvm::raw_ostream &
operator<<(llvm::raw_ostream &OS,
63 OS <<
"reinterpret_cast";
126constexpr size_t align(
size_t Size) {
127 return ((Size +
alignof(
void *) - 1) /
alignof(
void *)) *
alignof(
void *);
131static_assert(
aligned(
sizeof(
void *)));
142#define TYPE_SWITCH_CASE(Name, B) \
144 using T = PrimConv<Name>::T; \
148#define TYPE_SWITCH(Expr, B) \
151 TYPE_SWITCH_CASE(PT_Sint8, B) \
152 TYPE_SWITCH_CASE(PT_Uint8, B) \
153 TYPE_SWITCH_CASE(PT_Sint16, B) \
154 TYPE_SWITCH_CASE(PT_Uint16, B) \
155 TYPE_SWITCH_CASE(PT_Sint32, B) \
156 TYPE_SWITCH_CASE(PT_Uint32, B) \
157 TYPE_SWITCH_CASE(PT_Sint64, B) \
158 TYPE_SWITCH_CASE(PT_Uint64, B) \
159 TYPE_SWITCH_CASE(PT_IntAP, B) \
160 TYPE_SWITCH_CASE(PT_IntAPS, B) \
161 TYPE_SWITCH_CASE(PT_Float, B) \
162 TYPE_SWITCH_CASE(PT_Bool, B) \
163 TYPE_SWITCH_CASE(PT_Ptr, B) \
164 TYPE_SWITCH_CASE(PT_FnPtr, B) \
165 TYPE_SWITCH_CASE(PT_MemberPtr, B) \
169#define INT_TYPE_SWITCH(Expr, B) \
172 TYPE_SWITCH_CASE(PT_Sint8, B) \
173 TYPE_SWITCH_CASE(PT_Uint8, B) \
174 TYPE_SWITCH_CASE(PT_Sint16, B) \
175 TYPE_SWITCH_CASE(PT_Uint16, B) \
176 TYPE_SWITCH_CASE(PT_Sint32, B) \
177 TYPE_SWITCH_CASE(PT_Uint32, B) \
178 TYPE_SWITCH_CASE(PT_Sint64, B) \
179 TYPE_SWITCH_CASE(PT_Uint64, B) \
180 TYPE_SWITCH_CASE(PT_IntAP, B) \
181 TYPE_SWITCH_CASE(PT_IntAPS, B) \
182 TYPE_SWITCH_CASE(PT_Bool, B) \
184 llvm_unreachable("Not an integer value"); \
188#define INT_TYPE_SWITCH_NO_BOOL(Expr, B) \
191 TYPE_SWITCH_CASE(PT_Sint8, B) \
192 TYPE_SWITCH_CASE(PT_Uint8, B) \
193 TYPE_SWITCH_CASE(PT_Sint16, B) \
194 TYPE_SWITCH_CASE(PT_Uint16, B) \
195 TYPE_SWITCH_CASE(PT_Sint32, B) \
196 TYPE_SWITCH_CASE(PT_Uint32, B) \
197 TYPE_SWITCH_CASE(PT_Sint64, B) \
198 TYPE_SWITCH_CASE(PT_Uint64, B) \
199 TYPE_SWITCH_CASE(PT_IntAP, B) \
200 TYPE_SWITCH_CASE(PT_IntAPS, B) \
202 llvm_unreachable("Not an integer value"); \
206#define COMPOSITE_TYPE_SWITCH(Expr, B, D) \
209 TYPE_SWITCH_CASE(PT_Ptr, B) \
The base class of the type hierarchy.
Wrapper around boolean types.
Wrapper around numeric types.
A pointer to a memory block, live or dead.
constexpr bool aligned(uintptr_t Value)
constexpr bool isPtrType(PrimType T)
constexpr size_t align(size_t Size)
Aligns a size to the pointer alignment.
PrimType
Enumeration of the primitive types of the VM.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const Boolean &B)
size_t primSize(PrimType Type)
Returns the size of a primitive type in bytes.
constexpr bool isIntegralType(PrimType T)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Mapping from primitive types to their representation.