clang  10.0.0svn
Classes | Namespaces | Macros | Enumerations | Functions
PrimType.h File Reference
#include <climits>
#include <cstddef>
#include <cstdint>
#include "Boolean.h"
#include "Integral.h"
#include "Pointer.h"
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< T >
 Mapping from primitive types to their representation. More...
 
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_Bool >
 
struct  clang::interp::PrimConv< PT_Ptr >
 

Namespaces

 clang
 Dataflow Directional Tag Classes.
 
 clang::interp
 

Macros

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

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_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. More...
 
constexpr size_t clang::interp::align (size_t Size)
 Aligns a size to the pointer alignment. More...
 
bool clang::interp::isPrimitiveIntegral (PrimType Type)
 

Macro Definition Documentation

◆ COMPOSITE_TYPE_SWITCH

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

Definition at line 98 of file PrimType.h.

Referenced by getCtorArrayPrim(), getCtorPrim(), getDtorArrayPrim(), getDtorPrim(), getMoveArrayPrim(), and getMovePrim().

◆ INT_TYPE_SWITCH

#define INT_TYPE_SWITCH (   Expr,
 
)
Value:
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) \
default: llvm_unreachable("not an integer"); \
}

Definition at line 103 of file PrimType.h.

◆ TYPE_SWITCH

#define TYPE_SWITCH (   Expr,
 
)
Value:
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_Bool, B) \
TYPE_SWITCH_CASE(PT_Ptr, B) \
}

Definition at line 85 of file PrimType.h.

Referenced by clang::interp::InterpFrame::describe(), clang::interp::EvalEmitter::fallthrough(), clang::interp::InterpFrame::getParamPointer(), clang::interp::InterpFrame::popArgs(), and clang::interp::primSize().

◆ TYPE_SWITCH_CASE

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

Helper macro to simplify type switches.

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

Definition at line 83 of file PrimType.h.