13 #ifndef LLVM_CLANG_AST_INTERP_TYPE_H 14 #define LLVM_CLANG_AST_INTERP_TYPE_H 57 constexpr
size_t align(
size_t Size) {
58 return ((Size +
alignof(
void *) - 1) /
alignof(
void *)) *
alignof(
void *);
83 #define TYPE_SWITCH_CASE(Name, B) \ 84 case Name: { using T = PrimConv<Name>::T; do {B;} while(0); break; } 85 #define TYPE_SWITCH(Expr, B) \ 87 TYPE_SWITCH_CASE(PT_Sint8, B) \ 88 TYPE_SWITCH_CASE(PT_Uint8, B) \ 89 TYPE_SWITCH_CASE(PT_Sint16, B) \ 90 TYPE_SWITCH_CASE(PT_Uint16, B) \ 91 TYPE_SWITCH_CASE(PT_Sint32, B) \ 92 TYPE_SWITCH_CASE(PT_Uint32, B) \ 93 TYPE_SWITCH_CASE(PT_Sint64, B) \ 94 TYPE_SWITCH_CASE(PT_Uint64, B) \ 95 TYPE_SWITCH_CASE(PT_Bool, B) \ 96 TYPE_SWITCH_CASE(PT_Ptr, B) \ 98 #define COMPOSITE_TYPE_SWITCH(Expr, B, D) \ 100 TYPE_SWITCH_CASE(PT_Ptr, B) \ 101 default: do { D; } while(0); break; \ 103 #define INT_TYPE_SWITCH(Expr, B) \ 105 TYPE_SWITCH_CASE(PT_Sint8, B) \ 106 TYPE_SWITCH_CASE(PT_Uint8, B) \ 107 TYPE_SWITCH_CASE(PT_Sint16, B) \ 108 TYPE_SWITCH_CASE(PT_Uint16, B) \ 109 TYPE_SWITCH_CASE(PT_Sint32, B) \ 110 TYPE_SWITCH_CASE(PT_Uint32, B) \ 111 TYPE_SWITCH_CASE(PT_Sint64, B) \ 112 TYPE_SWITCH_CASE(PT_Uint64, B) \ 113 default: llvm_unreachable("not an integer"); \ size_t primSize(PrimType Type)
Returns the size of a primitive type in bytes.
bool isPrimitiveIntegral(PrimType Type)
Mapping from primitive types to their representation.
Wrapper around numeric types.
Wrapper around boolean types.
The base class of the type hierarchy.
constexpr size_t align(size_t Size)
Aligns a size to the pointer alignment.
A pointer to a memory block, live or dead.
PrimType
Enumeration of the primitive types of the VM.
Dataflow Directional Tag Classes.