1
- export null, isnull, all_ones, UndefValue, PointerNull
1
+ export null, isnull, all_ones
2
2
3
3
null (typ:: LLVMType ) = Value (API. LLVMConstNull (typ))
4
4
18
18
abstract type Instruction <: User end
19
19
20
20
21
- @checked struct PointerNull <: Constant
21
+ # # data
22
+
23
+ export ConstantData, PointerNull, UndefValue, ConstantInt, ConstantFP
24
+
25
+ abstract type ConstantData <: Constant end
26
+
27
+
28
+ @checked struct PointerNull <: ConstantData
22
29
ref:: API.LLVMValueRef
23
30
end
24
31
register (PointerNull, API. LLVMConstantPointerNullValueKind)
25
32
26
33
PointerNull (typ:: PointerType ) = PointerNull (API. LLVMConstPointerNull (typ))
27
34
28
35
29
- @checked struct UndefValue <: Constant
36
+ @checked struct UndefValue <: ConstantData
30
37
ref:: API.LLVMValueRef
31
38
end
32
39
register (UndefValue, API. LLVMUndefValueValueKind)
33
40
34
41
UndefValue (typ:: LLVMType ) = UndefValue (API. LLVMGetUndef (typ))
35
42
36
43
37
- # # scalar
38
-
39
- export ConstantInt, ConstantFP
40
-
41
- @checked struct ConstantInt <: Constant
44
+ @checked struct ConstantInt <: ConstantData
42
45
ref:: API.LLVMValueRef
43
46
end
44
47
register (ConstantInt, API. LLVMConstantIntValueKind)
@@ -82,7 +85,7 @@ Base.convert(::Type{T}, val::ConstantInt) where {T<:Signed} =
82
85
Base. convert (:: Type{Core.Bool} , val:: ConstantInt ) = convert (Int, val) != 0
83
86
84
87
85
- @checked struct ConstantFP <: Constant
88
+ @checked struct ConstantFP <: ConstantData
86
89
ref:: API.LLVMValueRef
87
90
end
88
91
register (ConstantFP, API. LLVMConstantFPValueKind)
@@ -101,11 +104,28 @@ Base.convert(::Type{T}, val::ConstantFP) where {T<:AbstractFloat} =
101
104
convert (T, API. LLVMConstRealGetDouble (val, Ref {API.LLVMBool} ()))
102
105
103
106
104
- # # aggregate zero
107
+ # sequential
108
+
109
+ export ConstantDataSequential, ConstantDataArray, ConstantDataVector
110
+
111
+ abstract type ConstantDataSequential <: Constant end
112
+
113
+ @checked struct ConstantDataArray <: ConstantDataSequential
114
+ ref:: API.LLVMValueRef
115
+ end
116
+ register (ConstantDataArray, API. LLVMConstantDataArrayValueKind)
117
+
118
+ @checked struct ConstantDataVector <: ConstantDataSequential
119
+ ref:: API.LLVMValueRef
120
+ end
121
+ register (ConstantDataVector, API. LLVMConstantDataVectorValueKind)
122
+
123
+
124
+ # aggregate zero
105
125
106
126
export ConstantAggregateZero
107
127
108
- @checked struct ConstantAggregateZero <: Constant
128
+ @checked struct ConstantAggregateZero <: ConstantData
109
129
ref:: API.LLVMValueRef
110
130
end
111
131
register (ConstantAggregateZero, API. LLVMConstantAggregateZeroValueKind)
0 commit comments