gep

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: 0BSD, Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Package gep computes the result type of getelementptr instructions and constant expressions.

ref: https://llvm.org/docs/GetElementPtr.html ref: https://llvm.org/docs/LangRef.html#getelementptr-instruction

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResultType

func ResultType(elemType, src types.Type, indices []Index) types.Type

ResultType computes the result type of a getelementptr instruction or constant expression.

getelementptr (ElemType, Src, Indices)

Types

type Index

type Index struct {
	// HasVal specifies whether Val has a valid value. If index is a constant
	// integer or a constant integer vector of which all elements have the same
	// value, then HasVal is set. Note, this is a requirement to index into
	// structure types.
	HasVal bool
	// Index integer value. Val is only valid if HasVal is set.
	Val int64
	// Length of index vector; or 0 if index is scalar. VectorLen may be non-zero
	// even if HasVal is false.
	VectorLen uint64
}

Index is a gep index.

func NewIndex

func NewIndex(val int64) Index

NewIndex returns a new constant index with the given value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL