Skip to content

Commit cc074f2

Browse files
committed
cast api
1 parent 4615c39 commit cc074f2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

z_llvmext.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,31 @@ func CreateFCmp(b Builder, op FloatPredicate, lhs, rhs Value) (v Value) {
6161
return
6262
}
6363

64+
func CreateIntCast(b Builder, v Value, t Type) (r Value) {
65+
r.C = C.LLVMBuildIntCast(b.C, v.C, t.C, &emptyCStr[0])
66+
return
67+
}
68+
69+
func CreateTrunc(b Builder, v Value, t Type) (r Value) {
70+
r.C = C.LLVMBuildTrunc(b.C, v.C, t.C, &emptyCStr[0])
71+
return
72+
}
73+
74+
func CreatePtrToInt(b Builder, v Value, t Type) (r Value) {
75+
r.C = C.LLVMBuildPtrToInt(b.C, v.C, t.C, &emptyCStr[0])
76+
return
77+
}
78+
79+
func CreateIntToPtr(b Builder, v Value, t Type) (r Value) {
80+
r.C = C.LLVMBuildIntToPtr(b.C, v.C, t.C, &emptyCStr[0])
81+
return
82+
}
83+
84+
func CreatePointerCast(b Builder, v Value, t Type) (r Value) {
85+
r.C = C.LLVMBuildPointerCast(b.C, v.C, t.C, &emptyCStr[0])
86+
return
87+
}
88+
6489
func CreateAlloca(b Builder, t Type) (v Value) {
6590
v.C = C.LLVMBuildAlloca(b.C, t.C, &emptyCStr[0])
6691
return

0 commit comments

Comments
 (0)