-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathLLVM.Imports.Types.pas
112 lines (82 loc) · 2.25 KB
/
LLVM.Imports.Types.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
unit LLVM.Imports.Types;
interface
//based on Types.h
uses
LLVM.Imports;
type
TLLVMBool = packed record
ResultCode: Integer;
class operator Implicit(const AValue: TLLVMBool): Boolean;
class operator Implicit(const AValue: Boolean): TLLVMBool;
class operator LogicalNot(const AValue: TLLVMBool): TLLVMBool;
end;
TLLVMMemoryBufferRef = type TLLVMRef;
TLLVMContextRef = type TLLVMRef;
TLLVMModuleRef = type TLLVMRef;
PLLVMModuleRef = ^TLLVMModuleRef;
TLLVMTypeRef = type TLLVMRef;
PLLVMTypeRef = ^TLLVMTypeRef;
TLLVMValueRef = type TLLVMRef;
PLLVMValueRef = ^TLLVMValueRef;
TLLVMBasicBlockRef = type TLLVMRef;
PLLVMBasicBlockRef = ^TLLVMBasicBlockRef;
TLLVMMetadataRef = type TLLVMRef;
(**
* Represents an LLVM Named Metadata Node.
*
* This models llvm::NamedMDNode.
*)
TLLVMNamedMDNodeRef = type TLLVMRef;
(**
* Represents an entry in a Global Object's metadata attachments.
*
* This models std::pair<unsigned, MDNode *>
*)
TLLVMValueMetadataEntry = type TLLVMRef;
PLLVMValueMetadataEntry = ^TLLVMValueMetadataEntry;
TLLVMBuilderRef = type TLLVMRef;
TLLVMDIBuilderRef = type TLLVMRef;
TLLVMModuleProviderRef = type TLLVMRef;
TLLVMPassManagerRef = type TLLVMRef;
TLLVMPassRegistryRef = type TLLVMRef;
TLLVMUseRef = type TLLVMRef;
TLLVMAttributeRef = type TLLVMRef;
PLLVMAttributeRef = ^TLLVMAttributeRef;
TLLVMDiagnosticInfoRef = type TLLVMRef;
(**
* @see llvm::Comdat
*)
TLLVMComdatRef = type TLLVMRef;
(**
* @see llvm::Module::ModuleFlagEntry
*)
TLLVMModuleFlagEntry = type TLLVMRef;
PLLVMModuleFlagEntry = ^TLLVMModuleFlagEntry;
(**
* @see llvm::JITEventListener
*)
TLLVMJITEventListenerRef = type TLLVMRef;
(**
* @see llvm::object::Binary
*)
TLLVMBinaryRef = type TLLVMRef;
implementation
class operator TLLVMBool.Implicit(const AValue: TLLVMBool): Boolean;
begin
Result := AValue.ResultCode = 0;
end;
class operator TLLVMBool.Implicit(const AValue: Boolean): TLLVMBool;
begin
if AValue then
Result.ResultCode := 0
else
Result.ResultCode := 1;
end;
class operator TLLVMBool.LogicalNot(const AValue: TLLVMBool): TLLVMBool;
begin
if AValue.ResultCode <> 0 then
Result.ResultCode := 0
else
Result.ResultCode := 1;
end;
end.