1#ifndef PROTEUS_RUNTIME_CONSTANT_TYPE_HELPERS_H
2#define PROTEUS_RUNTIME_CONSTANT_TYPE_HELPERS_H
6#include <llvm/IR/DerivedTypes.h>
7#include <llvm/IR/Type.h>
22 if (Ty->isIntegerTy(1))
24 if (Ty->isIntegerTy(8))
26 if (Ty->isIntegerTy(32))
28 if (Ty->isIntegerTy(64))
34 if (Ty->isFP128Ty() || Ty->isPPC_FP128Ty() || Ty->isX86_FP80Ty())
36 if (Ty->isPointerTy())
43 std::string TypeString;
44 raw_string_ostream TypeOstream(TypeString);
45 Ty->print(TypeOstream);
53 return Type::getInt1Ty(Ctx);
55 return Type::getInt8Ty(Ctx);
57 return Type::getInt32Ty(Ctx);
59 return Type::getInt64Ty(Ctx);
61 return Type::getFloatTy(Ctx);
63 return Type::getDoubleTy(Ctx);
67 return PointerType::getUnqual(Ctx);
78 return sizeof(int8_t);
80 return sizeof(int32_t);
82 return sizeof(int64_t);
86 return sizeof(double);
88 return sizeof(
long double);
132 return "LONG_DOUBLE";
136 return "STATIC_ARRAY";
#define PROTEUS_FATAL_ERROR(x)
Definition Error.h:7
Definition CppJitModule.cpp:21
Type * convertRuntimeConstantTypeToLLVMType(RuntimeConstantType RCType, LLVMContext &Ctx)
Definition RuntimeConstantTypeHelpers.h:49
RuntimeConstantType
Definition CompilerInterfaceTypes.h:20
@ ARRAY
Definition CompilerInterfaceTypes.h:33
@ VECTOR
Definition CompilerInterfaceTypes.h:32
@ INT32
Definition CompilerInterfaceTypes.h:25
@ INT64
Definition CompilerInterfaceTypes.h:26
@ FLOAT
Definition CompilerInterfaceTypes.h:27
@ STATIC_ARRAY
Definition CompilerInterfaceTypes.h:31
@ LONG_DOUBLE
Definition CompilerInterfaceTypes.h:29
@ INT8
Definition CompilerInterfaceTypes.h:24
@ BOOL
Definition CompilerInterfaceTypes.h:23
@ OBJECT
Definition CompilerInterfaceTypes.h:34
@ PTR
Definition CompilerInterfaceTypes.h:30
@ DOUBLE
Definition CompilerInterfaceTypes.h:28
T getValue(const RuntimeConstant &RC)
Definition RuntimeConstantTypeHelpers.h:95
RuntimeConstantType convertTypeToRuntimeConstantType(Type *Ty)
Definition RuntimeConstantTypeHelpers.h:21
std::string toString(CodegenOption Option)
Definition Config.hpp:23
bool isScalarRuntimeConstantType(RuntimeConstantType RCType)
Definition RuntimeConstantTypeHelpers.h:148
size_t getSizeInBytes(RuntimeConstantType RCType)
Definition RuntimeConstantTypeHelpers.h:73
Definition CompilerInterfaceTypes.h:72
RuntimeConstantValue Value
Definition CompilerInterfaceTypes.h:73
RuntimeConstantType Type
Definition CompilerInterfaceTypes.h:74
double DoubleVal
Definition CompilerInterfaceTypes.h:65
int64_t Int64Val
Definition CompilerInterfaceTypes.h:63
bool BoolVal
Definition CompilerInterfaceTypes.h:60
int8_t Int8Val
Definition CompilerInterfaceTypes.h:61
int32_t Int32Val
Definition CompilerInterfaceTypes.h:62
float FloatVal
Definition CompilerInterfaceTypes.h:64
long double LongDoubleVal
Definition CompilerInterfaceTypes.h:66