Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Main Page
Namespaces
Classes
Files
File List
File Members
Loading...
Searching...
No Matches
src
pass
Types.h
Go to the documentation of this file.
1
#ifndef PROTEUS_PASS_TYPES_H
2
#define PROTEUS_PASS_TYPES_H
3
4
#include <llvm/IR/DerivedTypes.h>
5
#include <llvm/IR/Module.h>
6
#include <llvm/IR/Type.h>
7
8
#include "
Helpers.h
"
9
10
namespace
proteus
{
11
12
using namespace
llvm
;
13
14
struct
ProteusTypes
{
15
ProteusTypes
(
Module
&M)
16
:
PtrTy
(
PointerType
::
getUnqual
(M.
getContext
())),
17
VoidTy
(Type::
getVoidTy
(M.
getContext
())),
18
Int1Ty
(Type::
getInt1Ty
(M.
getContext
())),
19
Int8Ty
(Type::
getInt8Ty
(M.
getContext
())),
20
Int32Ty
(Type::
getInt32Ty
(M.
getContext
())),
21
Int64Ty
(Type::
getInt64Ty
(M.
getContext
())),
22
Int128Ty
(Type::
getInt128Ty
(M.
getContext
())) {
23
// llvm.global.annotations entry format:
24
// ptr: (addrspace 1) Function pointer
25
// ptr: (addrspace 4) Annotations string
26
// ptr: (addrspace 4) Source file string
27
// i32: Line number,
28
// ptr: (addrspace 1) Arguments pointer
29
if
(
isDeviceCompilation
(M)) {
30
constexpr
unsigned
GlobalAddressSpace
= 1;
31
constexpr
unsigned
ConstAddressSpace
= 4;
32
GlobalAnnotationEltTy
= StructType::get(
33
PointerType::get(M.getContext(),
GlobalAddressSpace
),
34
PointerType::get(M.getContext(),
ConstAddressSpace
),
35
PointerType::get(M.getContext(),
ConstAddressSpace
),
Int32Ty
,
36
PointerType::get(M.getContext(),
GlobalAddressSpace
));
37
}
else
38
GlobalAnnotationEltTy
=
39
StructType::get(
PtrTy
,
PtrTy
,
PtrTy
,
Int32Ty
,
PtrTy
);
40
}
41
42
Type *
PtrTy
=
nullptr
;
43
Type *
VoidTy
=
nullptr
;
44
Type *
Int1Ty
=
nullptr
;
45
Type *
Int8Ty
=
nullptr
;
46
Type *
Int32Ty
=
nullptr
;
47
Type *
Int64Ty
=
nullptr
;
48
Type *
Int128Ty
=
nullptr
;
49
StructType
*
GlobalAnnotationEltTy
=
nullptr
;
50
};
51
52
}
// namespace proteus
53
54
#endif
Helpers.h
llvm
Definition
Helpers.h:138
proteus
Definition
BuiltinsCUDA.cpp:4
proteus::getRuntimeConstantValue
T getRuntimeConstantValue(void *Arg)
Definition
CompilerInterfaceRuntimeConstantInfo.h:114
proteus::isDeviceCompilation
bool isDeviceCompilation(Module &M)
Definition
Helpers.h:62
proteus::ProteusTypes
Definition
Types.h:14
proteus::ProteusTypes::ProteusTypes
ProteusTypes(Module &M)
Definition
Types.h:15
proteus::ProteusTypes::Int1Ty
Type * Int1Ty
Definition
Types.h:44
proteus::ProteusTypes::Int64Ty
Type * Int64Ty
Definition
Types.h:47
proteus::ProteusTypes::VoidTy
Type * VoidTy
Definition
Types.h:43
proteus::ProteusTypes::Int128Ty
Type * Int128Ty
Definition
Types.h:48
proteus::ProteusTypes::Int32Ty
Type * Int32Ty
Definition
Types.h:46
proteus::ProteusTypes::PtrTy
Type * PtrTy
Definition
Types.h:42
proteus::ProteusTypes::Int8Ty
Type * Int8Ty
Definition
Types.h:45
proteus::ProteusTypes::GlobalAnnotationEltTy
StructType * GlobalAnnotationEltTy
Definition
Types.h:49
Generated by
1.9.8