clang 20.0.0git
Classes | Namespaces | Macros | Enumerations | Functions
PrimType.h File Reference
#include "llvm/Support/raw_ostream.h"
#include <climits>
#include <cstddef>
#include <cstdint>

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_IntAP >
 
struct  clang::interp::PrimConv< PT_IntAPS >
 
struct  clang::interp::PrimConv< PT_Float >
 
struct  clang::interp::PrimConv< PT_Bool >
 
struct  clang::interp::PrimConv< PT_Ptr >
 
struct  clang::interp::PrimConv< PT_FnPtr >
 
struct  clang::interp::PrimConv< PT_MemberPtr >
 

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::interp
 

Macros

#define TYPE_SWITCH_CASE(Name, B)
 Helper macro to simplify type switches.
 
#define TYPE_SWITCH(Expr, B)
 
#define INT_TYPE_SWITCH(Expr, B)
 
#define INT_TYPE_SWITCH_NO_BOOL(Expr, B)
 
#define COMPOSITE_TYPE_SWITCH(Expr, B, D)
 

Enumerations

enum  clang::interp::PrimType : unsigned {
  clang::interp::PT_Sint8 = 0 , clang::interp::PT_Uint8 = 1 , clang::interp::PT_Sint16 = 2 , clang::interp::PT_Uint16 = 3 ,
  clang::interp::PT_Sint32 = 4 , clang::interp::PT_Uint32 = 5 , clang::interp::PT_Sint64 = 6 , clang::interp::PT_Uint64 = 7 ,
  clang::interp::PT_IntAP = 8 , clang::interp::PT_IntAPS = 9 , clang::interp::PT_Bool = 10 , clang::interp::PT_Float = 11 ,
  clang::interp::PT_Ptr = 12 , clang::interp::PT_FnPtr = 13 , clang::interp::PT_MemberPtr = 14
}
 Enumeration of the primitive types of the VM. More...
 
enum class  clang::interp::CastKind : uint8_t { clang::interp::Reinterpret , clang::interp::Atomic }
 

Functions

constexpr bool clang::interp::isPtrType (PrimType T)
 
llvm::raw_ostream & clang::interp::operator<< (llvm::raw_ostream &OS, interp::CastKind CK)
 
constexpr bool clang::interp::isIntegralType (PrimType T)
 
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,
  D 
)
Value:
do { \
switch (Expr) { \
TYPE_SWITCH_CASE(PT_Ptr, B) \
default: { \
D; \
break; \
} \
} \
} while (0)
const Decl * D

Definition at line 206 of file PrimType.h.

◆ INT_TYPE_SWITCH

#define INT_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_IntAP, B) \
TYPE_SWITCH_CASE(PT_IntAPS, B) \
TYPE_SWITCH_CASE(PT_Bool, B) \
default: \
llvm_unreachable("Not an integer value"); \
} \
} while (0)

Definition at line 169 of file PrimType.h.

◆ INT_TYPE_SWITCH_NO_BOOL

#define INT_TYPE_SWITCH_NO_BOOL (   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_IntAP, B) \
TYPE_SWITCH_CASE(PT_IntAPS, B) \
default: \
llvm_unreachable("Not an integer value"); \
} \
} while (0)

Definition at line 188 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_IntAP, B) \
TYPE_SWITCH_CASE(PT_IntAPS, B) \
TYPE_SWITCH_CASE(PT_Float, B) \
TYPE_SWITCH_CASE(PT_Bool, B) \
TYPE_SWITCH_CASE(PT_Ptr, B) \
TYPE_SWITCH_CASE(PT_FnPtr, B) \
TYPE_SWITCH_CASE(PT_MemberPtr, B) \
} \
} while (0)

Definition at line 148 of file PrimType.h.

◆ TYPE_SWITCH_CASE

#define TYPE_SWITCH_CASE (   Name,
 
)
Value:
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 142 of file PrimType.h.