Skip to content

Commit

Permalink
Merge pull request #11 from xushiwei/q
Browse files Browse the repository at this point in the history
CreateArrayAlloca
  • Loading branch information
xushiwei authored Apr 29, 2024
2 parents 4d6268b + 0c9c57f commit 83f0ad1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions z_llvmext.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ func CreateAlloca(b Builder, t Type) (v Value) {
return
}

func CreateArrayAlloca(b Builder, t Type, n Value) (v Value) {
v.C = C.LLVMBuildArrayAlloca(b.C, t.C, n.C, &emptyCStr[0])
return
}

func CreateGEP(b Builder, t Type, p Value, indices []Value) (v Value) {
ptr, nvals := llvmValueRefs(indices)
v.C = C.LLVMBuildGEP2(b.C, t.C, p.C, ptr, nvals, &emptyCStr[0])
Expand Down

0 comments on commit 83f0ad1

Please sign in to comment.