Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
CompilerInterfaceTypes.h
Go to the documentation of this file.
1//===-- CompilerInterfaceTypes.cpp -- JIT compiler interface types --===//
2//
3// Part of the Proteus Project, under the Apache License v2.0 with LLVM
4// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef PROTEUS_COMPILERINTERFACETYPES_H
12#define PROTEUS_COMPILERINTERFACETYPES_H
13
14#include <cstring>
15#include <stdint.h>
16
17namespace proteus {
18
29
31 RuntimeConstant() { std::memset(&Value, 0, sizeof(RuntimeConstantType)); }
32 using RuntimeConstantType = union {
33 bool BoolVal;
34 int8_t Int8Val;
35 int32_t Int32Val;
36 int64_t Int64Val;
37 float FloatVal;
38 double DoubleVal;
39 long double LongDoubleVal;
40 // TODO: This allows pointer as runtime constant values. How useful is that?
41 void *PtrVal;
42 };
44 int32_t Slot{-1};
45};
46
47} // namespace proteus
48
49#endif
Definition JitEngine.cpp:20
RuntimeConstantTypes
Definition CompilerInterfaceTypes.h:19
@ INT32
Definition CompilerInterfaceTypes.h:22
@ INT64
Definition CompilerInterfaceTypes.h:23
@ FLOAT
Definition CompilerInterfaceTypes.h:24
@ LONG_DOUBLE
Definition CompilerInterfaceTypes.h:26
@ INT8
Definition CompilerInterfaceTypes.h:21
@ BOOL
Definition CompilerInterfaceTypes.h:20
@ PTR
Definition CompilerInterfaceTypes.h:27
@ DOUBLE
Definition CompilerInterfaceTypes.h:25
Definition CompilerInterfaceTypes.h:30
double DoubleVal
Definition CompilerInterfaceTypes.h:38
int32_t Int32Val
Definition CompilerInterfaceTypes.h:35
union { bool BoolVal RuntimeConstantType
Definition CompilerInterfaceTypes.h:33
int64_t Int64Val
Definition CompilerInterfaceTypes.h:36
RuntimeConstant()
Definition CompilerInterfaceTypes.h:31
RuntimeConstantType Value
Definition CompilerInterfaceTypes.h:43
int32_t Slot
Definition CompilerInterfaceTypes.h:44
float FloatVal
Definition CompilerInterfaceTypes.h:37
long double LongDoubleVal
Definition CompilerInterfaceTypes.h:39
int8_t Int8Val
Definition CompilerInterfaceTypes.h:34
void * PtrVal
Definition CompilerInterfaceTypes.h:41