Skip to content

Commit 4b5ad7f

Browse files
committed
Add GEPSourceElementType and AllocatedType
These two are necessary to avoid ElementType calls.
1 parent dabbe3f commit 4b5ad7f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ir.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,12 @@ func (v Value) Indices() []uint32 {
13701370
func (v Value) IntPredicate() IntPredicate { return IntPredicate(C.LLVMGetICmpPredicate(v.C)) }
13711371
func (v Value) FloatPredicate() FloatPredicate { return FloatPredicate(C.LLVMGetFCmpPredicate(v.C)) }
13721372

1373+
// Operations on GEPs
1374+
func (v Value) GEPSourceElementType() (t Type) { t.C = C.LLVMGetGEPSourceElementType(v.C); return }
1375+
1376+
// Operations on allocas
1377+
func (v Value) AllocatedType() (t Type) { t.C = C.LLVMGetAllocatedType(v.C); return }
1378+
13731379
//-------------------------------------------------------------------------
13741380
// llvm.Builder
13751381
//-------------------------------------------------------------------------

0 commit comments

Comments
 (0)