clang 17.0.0git
Classes | Namespaces | Macros | Enumerations | Functions
PrimType.h File Reference
#include "Integral.h"
#include <climits>
#include <cstddef>
#include <cstdint>
Include dependency graph for PrimType.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  clang::interp::PrimConv< PT_Sint8 >
 
struct  clang::interp::PrimConv< PT_Uint8 >
 
struct  clang::interp::PrimConv< PT_Sint16 >
 
struct  clang::interp::PrimConv< PT_Uint16 >
 
struct  clang::interp::PrimConv< PT_Sint32 >
 
struct  clang::interp::PrimConv< PT_Uint32 >
 
struct  clang::interp::PrimConv< PT_Sint64 >
 
struct  clang::interp::PrimConv< PT_Uint64 >
 
struct  clang::interp::PrimConv< PT_Float >
 
struct  clang::interp::PrimConv< PT_Bool >
 
struct  clang::interp::PrimConv< PT_Ptr >
 

Namespaces

namespace  clang
 
namespace  clang::interp
 

Macros

#define TYPE_SWITCH_CASE(Name, B)    case Name: { using T = PrimConv<Name>::T; B; break; }
 Helper macro to simplify type switches.
 
#define TYPE_SWITCH(Expr, B)
 
#define COMPOSITE_TYPE_SWITCH(Expr, B, D)
 

Enumerations

enum  clang::interp::PrimType : unsigned {
  clang::interp::PT_Sint8 , clang::interp::PT_Uint8 , clang::interp::PT_Sint16 , clang::interp::PT_Uint16 ,
  clang::interp::PT_Sint32 , clang::interp::PT_Uint32 , clang::interp::PT_Sint64 , clang::interp::PT_Uint64 ,
  clang::interp::PT_Bool , clang::interp::PT_Float , clang::interp::PT_Ptr
}
 Enumeration of the primitive types of the VM. More...
 

Functions

size_t clang::interp::primSize (PrimType Type)
 Returns the size of a primitive type in bytes.
 
constexpr size_t clang::interp::align (size_t Size)
 Aligns a size to the pointer alignment.
 
constexpr bool clang::interp::aligned (uintptr_t Value)
 
static bool clang::interp::aligned (const void *P)
 

Macro Definition Documentation

◆ COMPOSITE_TYPE_SWITCH

#define COMPOSITE_TYPE_SWITCH (   Expr,
  B,
 
)
Value:
do { \
switch (Expr) { \
TYPE_SWITCH_CASE(PT_Ptr, B) \
default: { D; break; } \
} \
} while (0)

Definition at line 95 of file PrimType.h.

◆ TYPE_SWITCH

#define TYPE_SWITCH (   Expr,
 
)
Value:
do { \
switch (Expr) { \
TYPE_SWITCH_CASE(PT_Sint8, B) \
TYPE_SWITCH_CASE(PT_Uint8, B) \
TYPE_SWITCH_CASE(PT_Sint16, B) \
TYPE_SWITCH_CASE(PT_Uint16, B) \
TYPE_SWITCH_CASE(PT_Sint32, B) \
TYPE_SWITCH_CASE(PT_Uint32, B) \
TYPE_SWITCH_CASE(PT_Sint64, B) \
TYPE_SWITCH_CASE(PT_Uint64, B) \
TYPE_SWITCH_CASE(PT_Float, B) \
TYPE_SWITCH_CASE(PT_Bool, B) \
TYPE_SWITCH_CASE(PT_Ptr, B) \
} \
} while (0)

Definition at line 79 of file PrimType.h.

◆ TYPE_SWITCH_CASE

#define TYPE_SWITCH_CASE (   Name,
 
)     case Name: { using T = PrimConv<Name>::T; B; break; }

Helper macro to simplify type switches.

The macro implicitly exposes a type T in the scope of the inner block.

Definition at line 77 of file PrimType.h.