ir

package
v0.0.0-...-c756be7 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Unlicense Imports: 8 Imported by: 0

Documentation

Overview

Package ir declares the types used to represent LLVM IR modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment struct {
	Align int64
}

Alignment specifies an alignment attribute,

func (*Alignment) IsFuncAttribute

func (*Alignment) IsFuncAttribute()

func (*AttrGroupID) IsFuncAttribute() {}

func (*Alignment) IsGlobalAttribute

func (*Alignment) IsGlobalAttribute()

func (*Alignment) String

func (a *Alignment) String() string

String returns the string representation of the alignment attribute.

type AllocSize

type AllocSize struct {
	BaseSize int64
	N        int64
}

AllocSize specifies an allocation size attribute.

func (*AllocSize) IsFuncAttribute

func (*AllocSize) IsFuncAttribute()

func (*AllocSize) String

func (a *AllocSize) String() string

String returns the string representation of the allocation size attribute.

type Arg

type Arg struct {
	X          value.Value
	ParamAttrs []ParamAttribute
}

Arg is a function call argument.

func (*Arg) IsArgument

func (*Arg) IsArgument()

IsArgument ensures that only function call arguments can be assigned to the ast.Argument interface.

func (*Arg) String

func (a *Arg) String() string

String returns a string representation of the function call argument.

type Argument

type Argument interface {
	fmt.Stringer
	// IsArgument ensures that only function call arguments can be assigned to
	// the ast.Argument interface.
	IsArgument()
}

Argument is a function call argument.

type AtomicOrdering

type AtomicOrdering uint8

AtomicOrdering is an atomic ordering attribute.

const (
	AtomicOrderingNone      AtomicOrdering = iota // none
	AtomicOrderingAcqRel                          // acq_rel
	AtomicOrderingAcquire                         // acquire
	AtomicOrderingMonotonic                       // monotonic
	AtomicOrderingRelease                         // release
	AtomicOrderingSeqCst                          // seq_cst
	AtomicOrderingUnordered                       // unordered
)

Atomic ordering attributes.

func (AtomicOrdering) String

func (i AtomicOrdering) String() string

type AttrGroupDef

type AttrGroupDef struct {
	ID        string // AttrGroupID
	FuncAttrs []FuncAttribute
}

AttrGroupDef is a attribute group definition.

func (*AttrGroupDef) Def

func (a *AttrGroupDef) Def() string

Def returns the LLVM syntax representation of the attribute group definition.

func (*AttrGroupDef) IsFuncAttribute

func (*AttrGroupDef) IsFuncAttribute()

IsFuncAttribute ensures that only function attributes can be assigned to the ast.FuncAttribute interface.

func (*AttrGroupDef) IsTopLevelEntity

func (*AttrGroupDef) IsTopLevelEntity()

func (*AttrGroupDef) String

func (a *AttrGroupDef) String() string

String returns the string representation of the attribute group definition.

type AttrPair

type AttrPair struct {
	Key   string
	Value string
}

AttrPair is a attribute key-value pair of a function, parameter or return argument attribute.

func (*AttrPair) IsFuncAttribute

func (*AttrPair) IsFuncAttribute()

func (*AttrPair) String

func (a *AttrPair) String() string

String returns the string representation of the attribute key-value pair.

type AttrString

type AttrString struct {
	Value string
}

AttrString is a attribute string of a function, parameter or return argument attribute.

func (*AttrString) IsFuncAttribute

func (*AttrString) IsFuncAttribute()

func (*AttrString) String

func (a *AttrString) String() string

String returns the string representation of the attribute string.

type BasicBlock

type BasicBlock struct {
	// Basic block name (LabelIdent); empty if unnamed.
	Name string
	// Instructions of the basic block.
	Insts []Instruction
	// Terminating instruction of the basic block.
	Term Terminator
}

A BasicBlock is a sequence of non-branching instructions terminated by a branching instruction.

func (*BasicBlock) Def

func (block *BasicBlock) Def() string

Def returns the LLVM syntax representation of the basic block definition.

func (*BasicBlock) GetName

func (block *BasicBlock) GetName() string

Name returns the name of the basic block.

func (*BasicBlock) Ident

func (block *BasicBlock) Ident() string

Ident returns the identifier associated with the basic block.

func (*BasicBlock) IsExceptionScope

func (*BasicBlock) IsExceptionScope()

IsExceptionScope ensures that only exception scopes can be assigned to the ast.ExceptionScope interface.

func (*BasicBlock) IsUnwindTarget

func (*BasicBlock) IsUnwindTarget()

func (*BasicBlock) SetName

func (block *BasicBlock) SetName(name string)

SetName sets the name of the basic block.

func (*BasicBlock) String

func (block *BasicBlock) String() string

String returns the string representation of the basic block as a type-value pair.

func (*BasicBlock) Type

func (block *BasicBlock) Type() types.Type

Type returns the type of the basic block.

type BinOp

type BinOp uint8

BinOp is an AtomicRMW binary operation.

const (
	BinOpAdd  BinOp = iota // add
	BinOpAnd               // and
	BinOpMax               // max
	BinOpMin               // min
	BinOpNAnd              // nand
	BinOpOr                // or
	BinOpSub               // sub
	BinOpUMax              // umax
	BinOpUMin              // umin
	BinOpXChg              // xchg
	BinOpXor               // xor
)

AtomicRMW binary operations.

func (BinOp) String

func (i BinOp) String() string

type CallingConv

type CallingConv uint8

CallingConv is a calling convention.

const (
	CallingConvNone          CallingConv = iota // none
	CallingConvAmdGPUCS                         // amdgpu_cs
	CallingConvAmdGPUES                         // amdgpu_es
	CallingConvAmdGPUGS                         // amdgpu_gs
	CallingConvAmdGPUHS                         // amdgpu_hs
	CallingConvAmdGPUKernel                     // amdgpu_kernel
	CallingConvAmdGPULS                         // amdgpu_ls
	CallingConvAmdGPUPS                         // amdgpu_ps
	CallingConvAmdGPUVS                         // amdgpu_vs
	CallingConvAnyReg                           // anyregcc
	CallingConvARMAAPCSVFP                      // arm_aapcs_vfpcc
	CallingConvARMAAPCS                         // arm_aapcscc
	CallingConvARMAPCS                          // arm_apcscc
	CallingConvAVRIntr                          // avr_intrcc
	CallingConvAVRSignal                        // avr_signalcc
	CallingConvC                                // ccc
	CallingConvCold                             // coldcc
	CallingConvCXXFastTLS                       // cxx_fast_tlscc
	CallingConvFast                             // fastcc
	CallingConvGHC                              // ghccc
	CallingConvHHVMC                            // hhvm_ccc
	CallingConvHHVM                             // hhvmcc
	CallingConvIntelOCLBI                       // intel_ocl_bicc
	CallingConvMSP430Intr                       // msp430_intrcc
	CallingConvPreserveAll                      // preserve_allcc
	CallingConvPreserveMost                     // preserve_mostcc
	CallingConvPTXDevice                        // ptx_device
	CallingConvPTXKernel                        // ptx_kernel
	CallingConvSPIRFunc                         // spir_func
	CallingConvSPIRKernel                       // spir_kernel
	CallingConvSwift                            // swiftcc
	CallingConvWebKitJS                         // webkit_jscc
	CallingConvWin64                            // win64cc
	CallingConvX86_64SysV                       // x86_64_sysvcc
	CallingConvX86FastCall                      // x86_fastcallcc
	CallingConvX86Intr                          // x86_intrcc
	CallingConvX86RegCall                       // x86_regcallcc
	CallingConvX86StdCall                       // x86_stdcallcc
	CallingConvX86ThisCall                      // x86_thiscallcc
	CallingConvX86VectorCall                    // x86_vectorcallcc
	// Calling conventions defined through cc NNN.
	CallingConvHiPE          // cc 11
	CallingConvAVRBuiltin    // cc 86
	CallingConvAMDGPUVS      // cc 87
	CallingConvAMDGPUGS      // cc 88
	CallingConvAMDGPUPS      // cc 89
	CallingConvAMDGPUCS      // cc 90
	CallingConvAMDGPUKernel  // cc 91
	CallingConvAMDGPUHS      // cc 93
	CallingConvMSP430Builtin // cc 94
	CallingConvAMDGPULS      // cc 95
	CallingConvAMDGPUES      // cc 96
)

Calling conventions.

func (CallingConv) String

func (i CallingConv) String() string

type Case

type Case struct {
	X Constant

	Target *BasicBlock
}

Case is a case of a switch terminator.

func (*Case) String

func (c *Case) String() string

String returns a string representation of the case.

type Clause

type Clause struct {
	Catch bool // catch if true, filter otherwise
	X     value.Value
}

Clause is an exception clause.

func (*Clause) String

func (clause *Clause) String() string

String returns the string representation of the exception clause.

type Comdat

type Comdat struct {
	Name string // ComdatName; empty if not present
}

Comdat specifies a comdat attribute.

func (*Comdat) IsGlobalAttribute

func (*Comdat) IsGlobalAttribute()

func (*Comdat) String

func (c *Comdat) String() string

String returns the string representation of the comdat.

type ComdatDef

type ComdatDef struct {
	Name string // ComdatName
	Kind SelectionKind
}

ComdatDef is a comdat definition top-level entity.

func (*ComdatDef) Def

func (c *ComdatDef) Def() string

Def returns the LLVM syntax representation of the attribute group definition.

func (*ComdatDef) IsTopLevelEntity

func (*ComdatDef) IsTopLevelEntity()

func (*ast.TypeDef) IsTopLevelEntity() {}

func (*ComdatDef) String

func (c *ComdatDef) String() string

String returns the string representation of the comdat definition.

type Constant

type Constant interface {
	value.Value
	// IsConstant ensures that only constants can be assigned to the
	// constant.Constant interface.
	IsConstant()
}

A Constant is an LLVM IR constant.

type DLLStorageClass

type DLLStorageClass uint8

DLLStorageClass specifies the DLL storage class of a global identifier.

const (
	DLLStorageClassNone      DLLStorageClass = iota // none
	DLLStorageClassDLLExport                        // dllexport
	DLLStorageClassDLLImport                        // dllimport
)

DLL storage classes.

func (DLLStorageClass) String

func (i DLLStorageClass) String() string

type DataLayout

type DataLayout struct {
	DataLayout string
}

DataLayout is a data layout top-level entity.

func (*DataLayout) Def

func (t *DataLayout) Def() string

Def returns the LLVM syntax representation of the data layout top-level entity definition.

func (*DataLayout) IsTopLevelEntity

func (*DataLayout) IsTopLevelEntity()

type Dereferenceable

type Dereferenceable struct {
	N    int64
	Null bool
}

Dereferenceable specifies a dereferenceable attribute.

func (*Dereferenceable) String

func (d *Dereferenceable) String() string

String returns the string representation of the dereferenceable attribute.

type ExceptionScope

type ExceptionScope interface {
	fmt.Stringer
	// IsExceptionScope ensures that only exception scopes can be assigned to the
	// ast.ExceptionScope interface.
	IsExceptionScope()
}

ExceptionScope is an exception scope.

type FPred

type FPred uint8

FPred is a floating-point comparison predicate.

const (
	FPredFalse FPred = iota // false
	FPredOEQ                // oeq
	FPredOGE                // oge
	FPredOGT                // ogt
	FPredOLE                // ole
	FPredOLT                // olt
	FPredONE                // one
	FPredORD                // ord
	FPredTrue               // true
	FPredUEQ                // ueq
	FPredUGE                // uge
	FPredUGT                // ugt
	FPredULE                // ule
	FPredULT                // ult
	FPredUNE                // une
	FPredUNO                // uno
)

Floating-point predicates.

func (FPred) String

func (i FPred) String() string

type FastMathFlag

type FastMathFlag uint8

FastMathFlag is a fast-math flag.

const (
	FastMathFlagAFn      FastMathFlag = iota // afn
	FastMathFlagARcp                         // arcp
	FastMathFlagContract                     // contract
	FastMathFlagFast                         // fast
	FastMathFlagNInf                         // ninf
	FastMathFlagNNaN                         // nnan
	FastMathFlagNSZ                          // nsz
	FastMathFlagReassoc                      // reassoc
)

Fast-math flags.

func (FastMathFlag) String

func (i FastMathFlag) String() string

type FuncAttr

type FuncAttr uint8

FuncAttr is a function attribute.

const (
	FuncAttrAlwaysInline                FuncAttr = iota // alwaysinline
	FuncAttrArgMemOnly                                  // argmemonly
	FuncAttrBuiltin                                     // builtin
	FuncAttrCold                                        // cold
	FuncAttrConvergent                                  // convergent
	FuncAttrInaccessibleMemOrArgMemOnly                 // inaccessiblemem_or_argmemonly
	FuncAttrInaccessibleMemOnly                         // inaccessiblememonly
	FuncAttrInlineHint                                  // inlinehint
	FuncAttrJumpTable                                   // jumptable
	FuncAttrMinSize                                     // minsize
	FuncAttrNaked                                       // naked
	FuncAttrNoBuiltin                                   // nobuiltin
	FuncAttrNoDuplicate                                 // noduplicate
	FuncAttrNoImplicitFloat                             // noimplicitfloat
	FuncAttrNoInline                                    // noinline
	FuncAttrNonLazyBind                                 // nonlazybind
	FuncAttrNoRecurse                                   // norecurse
	FuncAttrNoRedZone                                   // noredzone
	FuncAttrNoReturn                                    // noreturn
	FuncAttrNoUnwind                                    // nounwind
	FuncAttrOptNone                                     // optnone
	FuncAttrOptSize                                     // optsize
	FuncAttrReadNone                                    // readnone
	FuncAttrReadOnly                                    // readonly
	FuncAttrReturnsTwice                                // returns_twice
	FuncAttrSafeStack                                   // safestack
	FuncAttrSanitizeAddress                             // sanitize_address
	FuncAttrSanitizeHWAddress                           // sanitize_hwaddress
	FuncAttrSanitizeMemory                              // sanitize_memory
	FuncAttrSanitizeThread                              // sanitize_thread
	FuncAttrSpeculatable                                // speculatable
	FuncAttrSSP                                         // ssp
	FuncAttrSSPReq                                      // sspreq
	FuncAttrSSPStrong                                   // sspstrong
	FuncAttrStrictFP                                    // strictfp
	FuncAttrUwtable                                     // uwtable
	FuncAttrWriteOnly                                   // writeonly
)

Function attributes.

func (FuncAttr) IsFuncAttribute

func (FuncAttr) IsFuncAttribute()

func (FuncAttr) String

func (i FuncAttr) String() string

type FuncAttribute

type FuncAttribute interface {
	fmt.Stringer
	// IsFuncAttribute ensures that only function attributes can be assigned to
	// the ast.FuncAttribute interface.
	IsFuncAttribute()
}

FuncAttribute is a function attribute.

type Function

type Function struct {
	Linkage Linkage

	Preemption      Preemption      // zero value if not present
	Visibility      Visibility      // zero value if not present
	DLLStorageClass DLLStorageClass // zero value if not present
	CallingConv     CallingConv     // zero value if not present
	ReturnAttrs     []ReturnAttribute
	RetType         types.Type
	Name            string // *GlobalIdent
	Params          []*Param
	Variadic        bool
	UnnamedAddr     UnnamedAddr
	FuncAttrs       []FuncAttribute
	Section         *Section // nil if not present
	Comdat          *Comdat  // nil if not present
	GC              string   // empty if not present
	Prefix          Constant // *TypeConst; nil if not present
	Prologue        Constant // *TypeConst; nil if not present
	Personality     Constant // *TypeConst; nil if not present

	Blocks        []*BasicBlock // nil if declaration
	UseListOrders []*UseListOrder

	// Function signature.
	Sig      *types.FuncType
	Typ      *types.PointerType // pointer to Sig.
	Metadata []*metadata.MetadataAttachment
}

A Function is an LLVM IR function.

func (*Function) AssignLocalIDs

func (f *Function) AssignLocalIDs()

AssignLocalIDs assigns IDs to unnamed local variables.

func (*Function) Def

func (f *Function) Def() string

Def returns the LLVM syntax representation of the global variable definition.

func (*Function) Ident

func (f *Function) Ident() string

Ident returns the identifier associated with the function.

func (*Function) IsConstant

func (*Function) IsConstant()

func (*Function) IsTopLevelEntity

func (*Function) IsTopLevelEntity()

func (*Function) String

func (f *Function) String() string

String returns the string representation of the function as a type-value pair.

func (*Function) Type

func (f *Function) Type() types.Type

Type returns the type of the function.

type Global

type Global struct {
	// Global variable name (*GlobalIdent).
	Name                  string
	Linkage               Linkage         // zero value if not present
	Preemption            Preemption      // zero value if not present
	Visibility            Visibility      // zero value if not present
	DLLStorageClass       DLLStorageClass // zero value if not present
	ThreadLocal           *ThreadLocal    // nil if not present
	UnnamedAddr           UnnamedAddr     // zero value if not present
	AddrSpace             types.AddrSpace // zero value if not present
	ExternallyInitialized bool
	Immutable             bool
	Typ                   *types.PointerType // pointer to ContentType.
	ContentType           types.Type
	Init                  Constant   // nil if declaration
	Section               *Section   // nil if not present
	Comdat                *Comdat    // nil if not present
	Align                 *Alignment // nil if not present
	Metadata              []*metadata.MetadataAttachment
	FuncAttrs             []FuncAttribute
}

Global is a global variable declaration or a global variable definition.

func (*Global) Def

func (g *Global) Def() string

Def returns the LLVM syntax representation of the global variable definition.

func (*Global) Ident

func (g *Global) Ident() string

Ident returns the identifier associated with the global variable.

func (*Global) IsConstant

func (*Global) IsConstant()

IsConstant ensures that only constants can be assigned to the ir.Constant interface.

func (*Global) IsTopLevelEntity

func (*Global) IsTopLevelEntity()

func (*Global) String

func (g *Global) String() string

String returns the string representation of the global variable as a type- value pair.

func (*Global) Type

func (g *Global) Type() types.Type

Type returns the type of the global variable.

type IPred

type IPred uint8

IPred is an integer comparison predicate.

const (
	IPredEQ  IPred = iota // eq
	IPredNE               // ne
	IPredSGE              // sge
	IPredSGT              // sgt
	IPredSLE              // sle
	IPredSLT              // slt
	IPredUGE              // uge
	IPredUGT              // ugt
	IPredULE              // ule
	IPredULT              // ult
)

Integer predicates.

func (IPred) String

func (i IPred) String() string

type Incoming

type Incoming struct {

	// Incoming value.
	X value.Value

	// Predecessor basic block.
	Pred *BasicBlock
}

Incoming is an incoming value of a phi instruction.

func (*Incoming) String

func (inc *Incoming) String() string

String returns the string representation of the incoming value.

type IndirectSymbol

type IndirectSymbol struct {
	// Alias or IFunc name (*GlobalIdent).
	Name            string
	Linkage         Linkage
	Preemption      Preemption
	Visibility      Visibility
	DLLStorageClass DLLStorageClass
	ThreadLocal     *ThreadLocal
	UnnamedAddr     UnnamedAddr
	Alias           bool // alias if true, ifunc otherwise.
	Typ             types.Type
	Const           Constant // aliasee or resolver
}

An IndirectSymbol is an alias or an ifunc.

func (*IndirectSymbol) Def

func (s *IndirectSymbol) Def() string

Def returns the LLVM syntax representation of the indirect symbol definition.

func (*IndirectSymbol) Ident

func (s *IndirectSymbol) Ident() string

Ident returns the identifier associated with the indirect symbol.

func (*IndirectSymbol) IsConstant

func (*IndirectSymbol) IsConstant()

func (*IndirectSymbol) IsTopLevelEntity

func (*IndirectSymbol) IsTopLevelEntity()

func (*IndirectSymbol) String

func (s *IndirectSymbol) String() string

String returns the string representation of the indirect symbol as a type- value pair.

func (*IndirectSymbol) Type

func (s *IndirectSymbol) Type() types.Type

Type returns the type of the indirect symbol variable.

type InlineAsm

type InlineAsm struct {
	SideEffect   bool
	AlignStack   bool
	IntelDialect bool
	Asm          string
	Constraint   string
}

InlineAsm is an inline assembly expression.

func (*InlineAsm) Ident

func (i *InlineAsm) Ident() string

Ident returns the identifier associated with the inline assembly expression.

func (*InlineAsm) String

func (i *InlineAsm) String() string

String returns the string representation of the inline assembly expression as a type-value pair.

func (*InlineAsm) Type

func (i *InlineAsm) Type() types.Type

Type returns the type of the inline assembly expression.

type InstAShr

type InstAShr struct {
	Exact    bool
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstAShr is an LLVM IR ashr instruction.

func (*InstAShr) Def

func (inst *InstAShr) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstAShr) IsValueInstruction

func (*InstAShr) IsValueInstruction()

func (*InstAShr) Type

func (inst *InstAShr) Type() types.Type

Type returns the type of the ashr instruction.

type InstAdd

type InstAdd struct {
	OverflowFlags []OverflowFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstAdd is an LLVM IR add instruction.

func (*InstAdd) Def

func (inst *InstAdd) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstAdd) IsValueInstruction

func (*InstAdd) IsValueInstruction()

IsValueInstruction ensures that only value instructions can be assigned to the ir.ValueInstruction interface.

func (*InstAdd) Type

func (inst *InstAdd) Type() types.Type

Type returns the type of the add instruction.

type InstAddrSpaceCast

type InstAddrSpaceCast struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstAddrSpaceCast is an LLVM IR addrspacecast instruction.

func (*InstAddrSpaceCast) Def

func (inst *InstAddrSpaceCast) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstAddrSpaceCast) IsValueInstruction

func (*InstAddrSpaceCast) IsValueInstruction()

func (*InstAddrSpaceCast) Type

func (inst *InstAddrSpaceCast) Type() types.Type

Type returns the type of the addrspacecast instruction.

type InstAlloca

type InstAlloca struct {
	InAlloca   bool
	SwiftError bool
	Typ        *types.PointerType
	ElemType   types.Type
	NElems     value.Value     // nil if not present
	Alignment  *Alignment      // nil if not present
	AddrSpace  types.AddrSpace // zero if not present
	Metadata   []*metadata.MetadataAttachment
}

InstAlloca is an LLVM IR alloca instruction.

func (*InstAlloca) Def

func (inst *InstAlloca) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstAlloca) IsValueInstruction

func (*InstAlloca) IsValueInstruction()

func (*InstAlloca) Type

func (inst *InstAlloca) Type() types.Type

Type returns the type of the alloca instruction.

type InstAnd

type InstAnd struct {
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstAnd is an LLVM IR and instruction.

func (*InstAnd) Def

func (inst *InstAnd) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstAnd) IsValueInstruction

func (*InstAnd) IsValueInstruction()

func (*InstAnd) Type

func (inst *InstAnd) Type() types.Type

Type returns the type of the and instruction.

type InstAtomicRMW

type InstAtomicRMW struct {
	Volatile       bool
	Op             BinOp
	Ptr            value.Value
	X              value.Value
	SyncScope      *SyncScope // nil if not present
	AtomicOrdering AtomicOrdering
	Metadata       []*metadata.MetadataAttachment
}

InstAtomicRMW is an LLVM IR atomicrmw instruction.

func (*InstAtomicRMW) Def

func (inst *InstAtomicRMW) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstAtomicRMW) IsInstruction

func (*InstAtomicRMW) IsInstruction()

type InstBitCast

type InstBitCast struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstBitCast is an LLVM IR bitcast instruction.

func (*InstBitCast) Def

func (inst *InstBitCast) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstBitCast) IsValueInstruction

func (*InstBitCast) IsValueInstruction()

func (*InstBitCast) Type

func (inst *InstBitCast) Type() types.Type

Type returns the type of the bitcast instruction.

type InstCall

type InstCall struct {
	Tail          Tail
	FastMathFlags []FastMathFlag
	CallingConv   CallingConv
	ReturnAttrs   []ReturnAttribute

	RetType types.Type

	Callee         value.Value
	Args           []Argument
	FuncAttrs      []FuncAttribute
	OperandBundles []*OperandBundle
	Metadata       []*metadata.MetadataAttachment
}

InstCall is an LLVM IR call instruction.

func (*InstCall) Def

func (inst *InstCall) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstCall) IsValueInstruction

func (*InstCall) IsValueInstruction()

func (*InstCall) Type

func (inst *InstCall) Type() types.Type

Type returns the type of the call instruction.

type InstCatchPad

type InstCatchPad struct {

	// Exception scope.
	Scope value.Value
	// Exception arguments.
	Args []Argument
	// Metadata attachments.
	Metadata []*metadata.MetadataAttachment
}

InstCatchPad is an LLVM IR catchpad instruction.

func (*InstCatchPad) Def

func (inst *InstCatchPad) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstCatchPad) IsValueInstruction

func (*InstCatchPad) IsValueInstruction()

func (*InstCatchPad) Type

func (inst *InstCatchPad) Type() types.Type

Type returns the type of the catchpad instruction.

type InstCleanupPad

type InstCleanupPad struct {
	Scope    ExceptionScope
	Args     []Argument
	Metadata []*metadata.MetadataAttachment
}

InstCleanupPad is an LLVM IR cleanuppad instruction.

func (*InstCleanupPad) Def

func (inst *InstCleanupPad) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstCleanupPad) IsValueInstruction

func (*InstCleanupPad) IsValueInstruction()

func (*InstCleanupPad) Type

func (inst *InstCleanupPad) Type() types.Type

Type returns the type of the cleanuppad instruction.

type InstCmpXchg

type InstCmpXchg struct {
	Weak      bool
	Volatile  bool
	Ptr       value.Value
	Cmp       value.Value
	New       value.Value
	SyncScope *SyncScope // nil if not present
	Success   AtomicOrdering
	Failure   AtomicOrdering
	Metadata  []*metadata.MetadataAttachment
}

InstCmpXchg is an LLVM IR cmpxchg instruction.

func (*InstCmpXchg) Def

func (inst *InstCmpXchg) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstCmpXchg) IsInstruction

func (*InstCmpXchg) IsInstruction()

type InstExtractElement

type InstExtractElement struct {
	X        value.Value
	Index    value.Value
	Metadata []*metadata.MetadataAttachment
}

InstExtractElement is an LLVM IR extractelement instruction.

func (*InstExtractElement) Def

func (inst *InstExtractElement) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstExtractElement) IsValueInstruction

func (*InstExtractElement) IsValueInstruction()

func (*InstExtractElement) Type

func (inst *InstExtractElement) Type() types.Type

Type returns the type of the extractelement instruction.

type InstExtractValue

type InstExtractValue struct {
	Typ      types.Type
	X        value.Value
	Indices  []int64
	Metadata []*metadata.MetadataAttachment
}

InstExtractValue is an LLVM IR extractvalue instruction.

func (*InstExtractValue) Def

func (inst *InstExtractValue) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstExtractValue) IsValueInstruction

func (*InstExtractValue) IsValueInstruction()

func (*InstExtractValue) Type

func (inst *InstExtractValue) Type() types.Type

Type returns the type of the extractvalue instruction.

type InstFAdd

type InstFAdd struct {
	FastMathFlags []FastMathFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstFAdd is an LLVM IR fadd instruction.

func (*InstFAdd) Def

func (inst *InstFAdd) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFAdd) IsValueInstruction

func (*InstFAdd) IsValueInstruction()

func (*InstFAdd) Type

func (inst *InstFAdd) Type() types.Type

Type returns the type of the fadd instruction.

type InstFCmp

type InstFCmp struct {
	FastMathFlags []FastMathFlag
	Pred          FPred
	Typ           types.Type
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstFCmp is an LLVM IR fcmp instruction.

func (*InstFCmp) Def

func (inst *InstFCmp) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFCmp) IsValueInstruction

func (*InstFCmp) IsValueInstruction()

func (*InstFCmp) Type

func (inst *InstFCmp) Type() types.Type

Type returns the type of the fcmp instruction.

type InstFDiv

type InstFDiv struct {
	FastMathFlags []FastMathFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstFDiv is an LLVM IR fdiv instruction.

func (*InstFDiv) Def

func (inst *InstFDiv) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFDiv) IsValueInstruction

func (*InstFDiv) IsValueInstruction()

func (*InstFDiv) Type

func (inst *InstFDiv) Type() types.Type

Type returns the type of the fdiv instruction.

type InstFMul

type InstFMul struct {
	FastMathFlags []FastMathFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstFMul is an LLVM IR fmul instruction.

func (*InstFMul) Def

func (inst *InstFMul) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFMul) IsValueInstruction

func (*InstFMul) IsValueInstruction()

func (*InstFMul) Type

func (inst *InstFMul) Type() types.Type

Type returns the type of the fmul instruction.

type InstFPExt

type InstFPExt struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstFPExt is an LLVM IR fpext instruction.

func (*InstFPExt) Def

func (inst *InstFPExt) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFPExt) IsValueInstruction

func (*InstFPExt) IsValueInstruction()

func (*InstFPExt) Type

func (inst *InstFPExt) Type() types.Type

Type returns the type of the fpext instruction.

type InstFPToSI

type InstFPToSI struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstFPToSI is an LLVM IR fptosi instruction.

func (*InstFPToSI) Def

func (inst *InstFPToSI) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFPToSI) IsValueInstruction

func (*InstFPToSI) IsValueInstruction()

func (*InstFPToSI) Type

func (inst *InstFPToSI) Type() types.Type

Type returns the type of the fptosi instruction.

type InstFPToUI

type InstFPToUI struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstFPToUI is an LLVM IR fptoui instruction.

func (*InstFPToUI) Def

func (inst *InstFPToUI) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFPToUI) IsValueInstruction

func (*InstFPToUI) IsValueInstruction()

func (*InstFPToUI) Type

func (inst *InstFPToUI) Type() types.Type

Type returns the type of the fptoui instruction.

type InstFPTrunc

type InstFPTrunc struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstFPTrunc is an LLVM IR fptrunc instruction.

func (*InstFPTrunc) Def

func (inst *InstFPTrunc) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFPTrunc) IsValueInstruction

func (*InstFPTrunc) IsValueInstruction()

func (*InstFPTrunc) Type

func (inst *InstFPTrunc) Type() types.Type

Type returns the type of the fptrunc instruction.

type InstFRem

type InstFRem struct {
	FastMathFlags []FastMathFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstFRem is an LLVM IR frem instruction.

func (*InstFRem) Def

func (inst *InstFRem) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFRem) IsValueInstruction

func (*InstFRem) IsValueInstruction()

func (*InstFRem) Type

func (inst *InstFRem) Type() types.Type

Type returns the type of the frem instruction.

type InstFSub

type InstFSub struct {
	FastMathFlags []FastMathFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstFSub is an LLVM IR fsub instruction.

func (*InstFSub) Def

func (inst *InstFSub) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFSub) IsValueInstruction

func (*InstFSub) IsValueInstruction()

func (*InstFSub) Type

func (inst *InstFSub) Type() types.Type

Type returns the type of the fsub instruction.

type InstFence

type InstFence struct {
	SyncScope      *SyncScope // nil if not present
	AtomicOrdering AtomicOrdering
	Metadata       []*metadata.MetadataAttachment
}

InstFence is an LLVM IR fence instruction.

func (*InstFence) Def

func (inst *InstFence) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstFence) IsInstruction

func (*InstFence) IsInstruction()

type InstGetElementPtr

type InstGetElementPtr struct {
	InBounds bool
	Typ      *types.PointerType
	ElemType types.Type
	Src      value.Value
	Indices  []value.Value
	Metadata []*metadata.MetadataAttachment
}

InstGetElementPtr is an LLVM IR getelementptr instruction.

func (*InstGetElementPtr) Def

func (inst *InstGetElementPtr) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstGetElementPtr) IsValueInstruction

func (*InstGetElementPtr) IsValueInstruction()

func (*InstGetElementPtr) Type

func (inst *InstGetElementPtr) Type() types.Type

Type returns the type of the getelementptr instruction.

type InstICmp

type InstICmp struct {
	Pred     IPred
	Typ      types.Type
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstICmp is an LLVM IR icmp instruction.

func (*InstICmp) Def

func (inst *InstICmp) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstICmp) IsValueInstruction

func (*InstICmp) IsValueInstruction()

func (*InstICmp) Type

func (inst *InstICmp) Type() types.Type

Type returns the type of the icmp instruction.

type InstInsertElement

type InstInsertElement struct {
	X        value.Value
	Elem     value.Value
	Index    value.Value
	Metadata []*metadata.MetadataAttachment
}

InstInsertElement is an LLVM IR insertelement instruction.

func (*InstInsertElement) Def

func (inst *InstInsertElement) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstInsertElement) IsValueInstruction

func (*InstInsertElement) IsValueInstruction()

func (*InstInsertElement) Type

func (inst *InstInsertElement) Type() types.Type

Type returns the type of the insertelement instruction.

type InstInsertValue

type InstInsertValue struct {
	X        value.Value
	Elem     value.Value
	Indices  []int64
	Metadata []*metadata.MetadataAttachment
}

InstInsertValue is an LLVM IR insertvalue instruction.

func (*InstInsertValue) Def

func (inst *InstInsertValue) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstInsertValue) IsValueInstruction

func (*InstInsertValue) IsValueInstruction()

func (*InstInsertValue) Type

func (inst *InstInsertValue) Type() types.Type

Type returns the type of the insertvalue instruction.

type InstIntToPtr

type InstIntToPtr struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstIntToPtr is an LLVM IR inttoptr instruction.

func (*InstIntToPtr) Def

func (inst *InstIntToPtr) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstIntToPtr) IsValueInstruction

func (*InstIntToPtr) IsValueInstruction()

func (*InstIntToPtr) Type

func (inst *InstIntToPtr) Type() types.Type

Type returns the type of the inttoptr instruction.

type InstLShr

type InstLShr struct {
	Exact    bool
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstLShr is an LLVM IR lshr instruction.

func (*InstLShr) Def

func (inst *InstLShr) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstLShr) IsValueInstruction

func (*InstLShr) IsValueInstruction()

func (*InstLShr) Type

func (inst *InstLShr) Type() types.Type

Type returns the type of the lshr instruction.

type InstLandingPad

type InstLandingPad struct {
	Typ      types.Type
	Cleanup  bool
	Clauses  []*Clause
	Metadata []*metadata.MetadataAttachment
}

InstLandingPad is an LLVM IR landingpad instruction.

func (*InstLandingPad) Def

func (inst *InstLandingPad) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstLandingPad) IsValueInstruction

func (*InstLandingPad) IsValueInstruction()

func (*InstLandingPad) Type

func (inst *InstLandingPad) Type() types.Type

Type returns the type of the landingpad instruction.

type InstLoad

type InstLoad struct {
	Atomic         bool
	Volatile       bool
	ElemType       types.Type // TODO: Remove ElemType as alreaedy part of Src?
	Src            value.Value
	SyncScope      *SyncScope     // nil if not present
	AtomicOrdering AtomicOrdering // zero value if not present
	Alignment      *Alignment     // nil if not present
	Metadata       []*metadata.MetadataAttachment
}

InstLoad is an LLVM IR load instruction.

func (*InstLoad) Def

func (inst *InstLoad) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstLoad) IsValueInstruction

func (*InstLoad) IsValueInstruction()

func (*InstLoad) Type

func (inst *InstLoad) Type() types.Type

Type returns the type of the load instruction.

type InstMul

type InstMul struct {
	OverflowFlags []OverflowFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstMul is an LLVM IR mul instruction.

func (*InstMul) Def

func (inst *InstMul) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstMul) IsValueInstruction

func (*InstMul) IsValueInstruction()

func (*InstMul) Type

func (inst *InstMul) Type() types.Type

Type returns the type of the mul instruction.

type InstOr

type InstOr struct {
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstOr is an LLVM IR or instruction.

func (*InstOr) Def

func (inst *InstOr) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstOr) IsValueInstruction

func (*InstOr) IsValueInstruction()

func (*InstOr) Type

func (inst *InstOr) Type() types.Type

Type returns the type of the or instruction.

type InstPhi

type InstPhi struct {
	Typ      types.Type
	Incs     []*Incoming
	Metadata []*metadata.MetadataAttachment
}

InstPhi is an LLVM IR phi instruction.

func (*InstPhi) Def

func (inst *InstPhi) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstPhi) IsValueInstruction

func (*InstPhi) IsValueInstruction()

func (*InstPhi) Type

func (inst *InstPhi) Type() types.Type

Type returns the type of the phi instruction.

type InstPtrToInt

type InstPtrToInt struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstPtrToInt is an LLVM IR ptrtoint instruction.

func (*InstPtrToInt) Def

func (inst *InstPtrToInt) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstPtrToInt) IsValueInstruction

func (*InstPtrToInt) IsValueInstruction()

func (*InstPtrToInt) Type

func (inst *InstPtrToInt) Type() types.Type

Type returns the type of the ptrtoint instruction.

type InstSDiv

type InstSDiv struct {
	Exact    bool
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstSDiv is an LLVM IR sdiv instruction.

func (*InstSDiv) Def

func (inst *InstSDiv) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstSDiv) IsValueInstruction

func (*InstSDiv) IsValueInstruction()

func (*InstSDiv) Type

func (inst *InstSDiv) Type() types.Type

Type returns the type of the sdiv instruction.

type InstSExt

type InstSExt struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstSExt is an LLVM IR sext instruction.

func (*InstSExt) Def

func (inst *InstSExt) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstSExt) IsValueInstruction

func (*InstSExt) IsValueInstruction()

func (*InstSExt) Type

func (inst *InstSExt) Type() types.Type

Type returns the type of the sext instruction.

type InstSIToFP

type InstSIToFP struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstSIToFP is an LLVM IR sitofp instruction.

func (*InstSIToFP) Def

func (inst *InstSIToFP) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstSIToFP) IsValueInstruction

func (*InstSIToFP) IsValueInstruction()

func (*InstSIToFP) Type

func (inst *InstSIToFP) Type() types.Type

Type returns the type of the sitofp instruction.

type InstSRem

type InstSRem struct {
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstSRem is an LLVM IR srem instruction.

func (*InstSRem) Def

func (inst *InstSRem) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstSRem) IsValueInstruction

func (*InstSRem) IsValueInstruction()

func (*InstSRem) Type

func (inst *InstSRem) Type() types.Type

Type returns the type of the srem instruction.

type InstSelect

type InstSelect struct {
	Cond     value.Value
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstSelect is an LLVM IR select instruction.

func (*InstSelect) Def

func (inst *InstSelect) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstSelect) IsValueInstruction

func (*InstSelect) IsValueInstruction()

func (*InstSelect) Type

func (inst *InstSelect) Type() types.Type

Type returns the type of the select instruction.

type InstShl

type InstShl struct {
	OverflowFlags []OverflowFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstShl is an LLVM IR shl instruction.

func (*InstShl) Def

func (inst *InstShl) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstShl) IsValueInstruction

func (*InstShl) IsValueInstruction()

func (*InstShl) Type

func (inst *InstShl) Type() types.Type

Type returns the type of the shl instruction.

type InstShuffleVector

type InstShuffleVector struct {
	X, Y     value.Value
	Mask     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstShuffleVector is an LLVM IR shufflevector instruction.

func (*InstShuffleVector) Def

func (inst *InstShuffleVector) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstShuffleVector) IsValueInstruction

func (*InstShuffleVector) IsValueInstruction()

func (*InstShuffleVector) Type

func (inst *InstShuffleVector) Type() types.Type

Type returns the type of the shufflevector instruction.

type InstStore

type InstStore struct {
	Atomic         bool
	Volatile       bool
	Src            value.Value
	Dst            value.Value
	SyncScope      *SyncScope     // nil if not present
	AtomicOrdering AtomicOrdering // zero value if not present
	Alignment      *Alignment     // nil if not present
	Metadata       []*metadata.MetadataAttachment
}

InstStore is an LLVM IR store instruction.

func (*InstStore) Def

func (inst *InstStore) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstStore) IsInstruction

func (*InstStore) IsInstruction()

IsInstruction ensures that only instructions can be assigned to the ast.Instruction interface.

type InstSub

type InstSub struct {
	OverflowFlags []OverflowFlag
	X, Y          value.Value
	Metadata      []*metadata.MetadataAttachment
}

InstSub is an LLVM IR sub instruction.

func (*InstSub) Def

func (inst *InstSub) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstSub) IsValueInstruction

func (*InstSub) IsValueInstruction()

func (*InstSub) Type

func (inst *InstSub) Type() types.Type

Type returns the type of the sub instruction.

type InstTrunc

type InstTrunc struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstTrunc is an LLVM IR trunc instruction.

func (*InstTrunc) Def

func (inst *InstTrunc) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstTrunc) IsValueInstruction

func (*InstTrunc) IsValueInstruction()

func (*InstTrunc) Type

func (inst *InstTrunc) Type() types.Type

Type returns the type of the trunc instruction.

type InstUDiv

type InstUDiv struct {
	Exact    bool
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstUDiv is an LLVM IR udiv instruction.

func (*InstUDiv) Def

func (inst *InstUDiv) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstUDiv) IsValueInstruction

func (*InstUDiv) IsValueInstruction()

func (*InstUDiv) Type

func (inst *InstUDiv) Type() types.Type

Type returns the type of the udiv instruction.

type InstUIToFP

type InstUIToFP struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstUIToFP is an LLVM IR uitofp instruction.

func (*InstUIToFP) Def

func (inst *InstUIToFP) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstUIToFP) IsValueInstruction

func (*InstUIToFP) IsValueInstruction()

func (*InstUIToFP) Type

func (inst *InstUIToFP) Type() types.Type

Type returns the type of the uitofp instruction.

type InstURem

type InstURem struct {
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstURem is an LLVM IR urem instruction.

func (*InstURem) Def

func (inst *InstURem) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstURem) IsValueInstruction

func (*InstURem) IsValueInstruction()

func (*InstURem) Type

func (inst *InstURem) Type() types.Type

Type returns the type of the urem instruction.

type InstVAArg

type InstVAArg struct {
	ArgList  value.Value
	ArgType  types.Type
	Metadata []*metadata.MetadataAttachment
}

InstVAArg is an LLVM IR vaarg instruction.

func (*InstVAArg) Def

func (inst *InstVAArg) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstVAArg) IsValueInstruction

func (*InstVAArg) IsValueInstruction()

func (*InstVAArg) Type

func (inst *InstVAArg) Type() types.Type

Type returns the type of the vaarg instruction.

type InstXor

type InstXor struct {
	X, Y     value.Value
	Metadata []*metadata.MetadataAttachment
}

InstXor is an LLVM IR xor instruction.

func (*InstXor) Def

func (inst *InstXor) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstXor) IsValueInstruction

func (*InstXor) IsValueInstruction()

func (*InstXor) Type

func (inst *InstXor) Type() types.Type

Type returns the type of the xor instruction.

type InstZExt

type InstZExt struct {
	From     value.Value
	To       types.Type
	Metadata []*metadata.MetadataAttachment
}

InstZExt is an LLVM IR zext instruction.

func (*InstZExt) Def

func (inst *InstZExt) Def() string

Def returns the LLVM syntax representation of the instruction.

func (*InstZExt) IsValueInstruction

func (*InstZExt) IsValueInstruction()

func (*InstZExt) Type

func (inst *InstZExt) Type() types.Type

Type returns the type of the zext instruction.

type Instruction

type Instruction interface {
	// Def returns the LLVM syntax representation of the instruction.
	Def() string
	// IsInstruction ensures that only instructions can be assigned to the
	// ast.Instruction interface.
	IsInstruction()
}

An Instruction is an LLVM IR instruction.

type Linkage

type Linkage uint8

Linkage specifies the linkage of a global identifier.

const (
	LinkageNone                Linkage = iota // none
	LinkageAppending                          // appending
	LinkageAvailableExternally                // available_externally
	LinkageCommon                             // common
	LinkageInternal                           // internal
	LinkageLinkOnce                           // linkonce
	LinkageLinkOnceODR                        // linkonce_odr
	LinkagePrivate                            // private
	LinkageWeak                               // weak
	LinkageWeakODR                            // weak_odr
	// External linkage.
	LinkageExternal   // external
	LinkageExternWeak // extern_weak
)

Linkage kinds.

func (Linkage) String

func (i Linkage) String() string

type LocalDef

type LocalDef struct {
	// Result name (LocalIdent); or empty if unnamed.
	Name string
	Inst ValueInstruction
}

A LocalDef is a local definition which assigns the result of an LLVM IR instruction to a name.

func (*LocalDef) Def

func (v *LocalDef) Def() string

Def returns the LLVM syntax representation of the local definition.

func (*LocalDef) GetName

func (v *LocalDef) GetName() string

Name returns the name of the local definition.

func (*LocalDef) Ident

func (v *LocalDef) Ident() string

Ident returns the identifier associated with the local definition.

func (*LocalDef) IsInstruction

func (*LocalDef) IsInstruction()

func (*LocalDef) SetName

func (v *LocalDef) SetName(name string)

SetName sets the name of the local definition.

func (*LocalDef) String

func (v *LocalDef) String() string

String returns the string representation of the local definition as a type- value pair.

func (*LocalDef) Type

func (v *LocalDef) Type() types.Type

Type returns the type of the local definition.

type Module

type Module struct {
	// Source filename; or nil if not present.
	SourceFilename *SourceFilename
	// Data layout; or nil if not present.
	DataLayout *DataLayout
	// Target triple; or nil if not present.
	TargetTriple *TargetTriple
	// Module-level inline assembly.
	ModuleAsms []*ModuleAsm
	// Type definitions.
	TypeDefs []types.Type
	// Comdat definitions.
	ComdatDefs []*ComdatDef
	// Global declarations and definitions.
	Globals []*Global
	// Indirect symbol definitions (aliases and IFuncs).
	IndirectSymbols []*IndirectSymbol
	// Function declarations and definitions.
	Funcs []*Function
	// Attribute group definitions.
	AttrGroupDefs []*AttrGroupDef
	// Named metadata definitions.
	NamedMetadataDefs []*metadata.NamedMetadataDef
	// Metadata definitions.
	MetadataDefs []*metadata.MetadataDef
	// Use-list order directives.
	UseListOrders []*UseListOrder
	// Basic block specific use-list order directives.
	UseListOrderBBs []*UseListOrderBB
}

A Module is an LLVM IR module.

func (*Module) String

func (m *Module) String() string

String returns the string representation of the module.

type ModuleAsm

type ModuleAsm struct {
	Asm string
}

ModuleAsm is a module-level inline assembly top-level entity.

func (*ModuleAsm) Def

func (a *ModuleAsm) Def() string

Def returns the LLVM syntax representation of the module-level inline assembly definition.

func (*ModuleAsm) IsTopLevelEntity

func (*ModuleAsm) IsTopLevelEntity()

type OperandBundle

type OperandBundle struct {
	Tag    string
	Inputs []value.Value
}

OperandBundle is a tagged set of SSA values.

func (*OperandBundle) String

func (o *OperandBundle) String() string

String returns a string representation of the operand bundle.

type OverflowFlag

type OverflowFlag uint8

OverflowFlag is an integer overflow flag.

const (
	OverflowFlagNSW OverflowFlag = iota // nsw
	OverflowFlagNUW                     // nuw
)

Overflow flags.

func (OverflowFlag) String

func (i OverflowFlag) String() string

type Param

type Param struct {
	// Parameter type.
	Typ types.Type
	// Parameter attributes.
	Attrs []ParamAttribute
	// Parameter name (LocalIdent); or empty if unnamed.
	Name string
}

A Param is an LLVM IR function parameter.

func (*Param) Def

func (p *Param) Def() string

Def returns the LLVM syntax representation of the function parameter.

func (*Param) GetName

func (p *Param) GetName() string

Name returns the name of the function parameter.

func (*Param) Ident

func (p *Param) Ident() string

Ident returns the identifier associated with the function parameter.

func (*Param) SetName

func (p *Param) SetName(name string)

SetName sets the name of the function parameter.

func (*Param) String

func (p *Param) String() string

String returns the string representation of the function parameter as a type- value pair.

func (*Param) Type

func (p *Param) Type() types.Type

Type returns the type of the function parameter.

type ParamAttr

type ParamAttr uint8

ParamAttr is a parameter attribute.

const (
	ParamAttrByval      ParamAttr = iota // byval
	ParamAttrInAlloca                    // inalloca
	ParamAttrInReg                       // inreg
	ParamAttrNest                        // nest
	ParamAttrNoAlias                     // noalias
	ParamAttrNoCapture                   // nocapture
	ParamAttrNonNull                     // nonnull
	ParamAttrReadNone                    // readnone
	ParamAttrReadOnly                    // readonly
	ParamAttrReturned                    // returned
	ParamAttrSignExt                     // signext
	ParamAttrSRet                        // sret
	ParamAttrSwiftError                  // swifterror
	ParamAttrSwiftSelf                   // swiftself
	ParamAttrWriteOnly                   // writeonly
	ParamAttrZeroExt                     // zeroext
)

Parameter attributes.

func (ParamAttr) String

func (i ParamAttr) String() string

type ParamAttribute

type ParamAttribute interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

ParamAttribute is a parameter attribute.

type Preemption

type Preemption uint8

Preemption specifies the preemtion of a global identifier.

const (
	PreemptionNone           Preemption = iota // none
	PreemptionDSOLocal                         // dso_local
	PreemptionDSOPreemptable                   // dso_preemptable
)

Preemption kinds.

func (Preemption) String

func (i Preemption) String() string

type ReturnAttr

type ReturnAttr uint8

ReturnAttr is a return argument attribute.

const (
	ReturnAttrInReg   ReturnAttr = iota // inreg
	ReturnAttrNoAlias                   // noalias
	ReturnAttrNonNull                   // nonnull
	ReturnAttrSignExt                   // signext
	ReturnAttrZeroExt                   // zeroext
)

Return argument attributes.

func (ReturnAttr) String

func (i ReturnAttr) String() string

type ReturnAttribute

type ReturnAttribute interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

ReturnAttribute is a return argument attribute.

type Section

type Section struct {
	Name string
}

Section specifies a section attribute.

func (*Section) IsGlobalAttribute

func (*Section) IsGlobalAttribute()

IsGlobalAttribute ensures that only global attributes can be assigned to the astx.GlobalAttribute interface.

func (*Section) String

func (s *Section) String() string

String returns the string representation of the section name.

type SelectionKind

type SelectionKind uint8

SelectionKind is a comdat selection kind.

const (
	SelectionKindAny          SelectionKind = iota // any
	SelectionKindExactMatch                        // exactmatch
	SelectionKindLargest                           // largest
	SelectionKindNoDuplicates                      // noduplicates
	SelectionKindSameSize                          // samesize
)

Comdat selection kinds.

func (SelectionKind) String

func (i SelectionKind) String() string

type SourceFilename

type SourceFilename struct {
	Name string
}

SourceFilename is a source filename top-level entity.

func (*SourceFilename) Def

func (s *SourceFilename) Def() string

Def returns the LLVM syntax representation of the source filename top-level entity definition.

func (*SourceFilename) IsTopLevelEntity

func (*SourceFilename) IsTopLevelEntity()

IsTopLevelEntity ensures that only top-level entities can be assigned to the ast.TopLevelEntity interface.

type StackAlignment

type StackAlignment struct {
	Align int64
}

StackAlignment specifies an stack alignment attribute.

func (*StackAlignment) IsFuncAttribute

func (*StackAlignment) IsFuncAttribute()

func (*StackAlignment) String

func (a *StackAlignment) String() string

String returns the string representation of the stack alignment attribute.

type SyncScope

type SyncScope struct {
	Scope string
}

SyncScope is a synchronization scope attribute.

func (*SyncScope) String

func (s *SyncScope) String() string

String returns a string representation of the synchronization scope attribute.

type TLSModel

type TLSModel uint8

TLSModel is a thread local storage model.

const (
	TLSModelNone         TLSModel = iota // none
	TLSModelInitialExec                  // initialexec
	TLSModelLocalDynamic                 // localdynamic
	TLSModelLocalExec                    // localexec
)

Thread local storage models.

func (TLSModel) String

func (i TLSModel) String() string

type Tail

type Tail uint8

Tail is a tail call attribute.

const (
	TailNone     Tail = iota // none
	TailMustTail             // musttail
	TailNoTail               // notail
	TailTail                 // tail
)

Tail call attributes.

func (Tail) String

func (i Tail) String() string

type TargetTriple

type TargetTriple struct {
	TargetTriple string
}

TargetTriple is a target triple top-level entity.

func (*TargetTriple) Def

func (t *TargetTriple) Def() string

Def returns the LLVM syntax representation of the target triple top-level entity definition.

func (*TargetTriple) IsTopLevelEntity

func (*TargetTriple) IsTopLevelEntity()

type TermBr

type TermBr struct {
	Target   *BasicBlock
	Metadata []*metadata.MetadataAttachment
}

TermBr is an unconditional LLVM IR br terminator.

func (*TermBr) Def

func (term *TermBr) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermBr) IsTerminator

func (*TermBr) IsTerminator()

type TermCatchRet

type TermCatchRet struct {
	From value.Value // catchpad

	To       *BasicBlock
	Metadata []*metadata.MetadataAttachment
}

TermCatchRet is an LLVM IR catchret terminator.

func (*TermCatchRet) Def

func (term *TermCatchRet) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermCatchRet) IsTerminator

func (*TermCatchRet) IsTerminator()

type TermCatchSwitch

type TermCatchSwitch struct {
	Scope ExceptionScope

	Handlers     []*BasicBlock
	UnwindTarget UnwindTarget
	Metadata     []*metadata.MetadataAttachment
}

TermCatchSwitch is an LLVM IR catchswitch terminator.

func (*TermCatchSwitch) Def

func (term *TermCatchSwitch) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermCatchSwitch) IsTerminator

func (*TermCatchSwitch) IsTerminator()

type TermCleanupRet

type TermCleanupRet struct {
	From         value.Value // cleanuppad
	UnwindTarget UnwindTarget
	Metadata     []*metadata.MetadataAttachment
}

TermCleanupRet is an LLVM IR cleanupret terminator.

func (*TermCleanupRet) Def

func (term *TermCleanupRet) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermCleanupRet) IsTerminator

func (*TermCleanupRet) IsTerminator()

type TermCondBr

type TermCondBr struct {
	Cond value.Value

	TargetTrue *BasicBlock

	TargetFalse *BasicBlock
	Metadata    []*metadata.MetadataAttachment
}

TermCondBr is a conditional LLVM IR br terminator.

func (*TermCondBr) Def

func (term *TermCondBr) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermCondBr) IsTerminator

func (*TermCondBr) IsTerminator()

type TermIndirectBr

type TermIndirectBr struct {
	Addr value.Value

	Targets  []*BasicBlock
	Metadata []*metadata.MetadataAttachment
}

TermIndirectBr is an LLVM IR indirectbr terminator.

func (*TermIndirectBr) Def

func (term *TermIndirectBr) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermIndirectBr) IsTerminator

func (*TermIndirectBr) IsTerminator()

type TermInvoke

type TermInvoke struct {
	CallingConv CallingConv
	ReturnAttrs []ReturnAttribute
	RetType     types.Type

	Callee         value.Value
	Args           []Argument
	FuncAttrs      []FuncAttribute
	OperandBundles []*OperandBundle

	Normal *BasicBlock

	Exception *BasicBlock
	Metadata  []*metadata.MetadataAttachment
}

TermInvoke is an LLVM IR invoke terminator.

func (*TermInvoke) Def

func (term *TermInvoke) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermInvoke) IsTerminator

func (*TermInvoke) IsTerminator()

type TermResume

type TermResume struct {
	X        value.Value
	Metadata []*metadata.MetadataAttachment
}

TermResume is an LLVM IR resume terminator.

func (*TermResume) Def

func (term *TermResume) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermResume) IsTerminator

func (*TermResume) IsTerminator()

type TermRet

type TermRet struct {
	X        value.Value // nil if void return
	Metadata []*metadata.MetadataAttachment
}

TermRet is an LLVM IR ret terminator.

func (*TermRet) Def

func (term *TermRet) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermRet) IsTerminator

func (*TermRet) IsTerminator()

IsTerminator ensures that only terminators can be assigned to the ast.Terminator interface.

type TermSwitch

type TermSwitch struct {
	X value.Value

	Default  *BasicBlock
	Cases    []*Case
	Metadata []*metadata.MetadataAttachment
}

TermSwitch is an LLVM IR switch terminator.

func (*TermSwitch) Def

func (term *TermSwitch) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermSwitch) IsTerminator

func (*TermSwitch) IsTerminator()

type TermUnreachable

type TermUnreachable struct {
	Metadata []*metadata.MetadataAttachment
}

TermUnreachable is an LLVM IR unreachable terminator.

func (*TermUnreachable) Def

func (term *TermUnreachable) Def() string

Def returns the LLVM syntax representation of the terminator.

func (*TermUnreachable) IsTerminator

func (*TermUnreachable) IsTerminator()

type Terminator

type Terminator interface {
	// Def returns the LLVM syntax representation of the terminator.
	Def() string
	// IsTerminator ensures that only terminators can be assigned to the
	// ast.Terminator interface.
	IsTerminator()
}

A Terminator is an LLVM IR terminator.

type ThreadLocal

type ThreadLocal struct {
	Model TLSModel // zero value if not present
}

ThreadLocal is a thread local storage specifier.

func (ThreadLocal) String

func (t ThreadLocal) String() string

String returns a string representation of the thread local storage.

type UnnamedAddr

type UnnamedAddr uint8

UnnamedAddr specifies whether the address is significant.

const (
	UnnamedAddrNone             UnnamedAddr = iota // none
	UnnamedAddrLocalUnnamedAddr                    // local_unnamed_addr
	UnnamedAddrUnnamedAddr                         // unnamed_addr
)

Unnamed address specifiers.

func (UnnamedAddr) String

func (i UnnamedAddr) String() string

type UnwindTarget

type UnwindTarget interface {
	fmt.Stringer
	// IsUnwindTarget ensures that only unwind targets can be assigned to the
	// ast.UnwindTarget interface.
	IsUnwindTarget()
}

UnwindTarget is an unwind target of a catchswitch or cleanupret terminator.

type UnwindToCaller

type UnwindToCaller struct{}

UnwindToCaller specifies the caller as an unwind target.

func (*UnwindToCaller) IsUnwindTarget

func (*UnwindToCaller) IsUnwindTarget()

IsUnwindTarget ensures that only unwind targets can be assigned to the ir.UnwindTarget interface.

func (*UnwindToCaller) String

func (*UnwindToCaller) String() string

String returns a string representation of the unwind target.

type UseListOrder

type UseListOrder struct {
	Value   value.Value
	Indices []int64
}

UseListOrder is a use-list order directive.

func (*UseListOrder) Def

func (u *UseListOrder) Def() string

Def returns the LLVM syntax representation of the use-list order directive definition.

func (*UseListOrder) IsTopLevelEntity

func (*UseListOrder) IsTopLevelEntity()

func (*metadata.NamedMetadataDef) IsTopLevelEntity() {} func (*metadata.MetadataDef) IsTopLevelEntity() {}

type UseListOrderBB

type UseListOrderBB struct {
	Func *Function

	Block   *BasicBlock
	Indices []int64
}

UseListOrderBB is a basic block specific use-list order directive.

func (*UseListOrderBB) Def

func (u *UseListOrderBB) Def() string

Def returns the LLVM syntax representation of the basic block specific use- list order directive definition.

func (*UseListOrderBB) IsTopLevelEntity

func (*UseListOrderBB) IsTopLevelEntity()

type ValueInstruction

type ValueInstruction interface {
	// Def returns the LLVM syntax representation of the instruction.
	Def() string
	// Type returns the type of the results computed by the instruction.
	Type() types.Type
	// IsValueInstruction ensures that only value instructions can be assigned to
	// the ir.ValueInstruction interface.
	IsValueInstruction()
}

A ValueInstruction is an instruction which produces a value.

type Visibility

type Visibility uint8

Visibility specifies the visibility of a global identifier.

const (
	VisibilityNone      Visibility = iota // none
	VisibilityDefault                     // default
	VisibilityHidden                      // hidden
	VisibilityProtected                   // protected
)

Visibility kinds.

func (Visibility) String

func (i Visibility) String() string

Directories

Path Synopsis
Package irutil provides LLVM IR utility functions.
Package irutil provides LLVM IR utility functions.
Package types declares the data types of LLVM IR.
Package types declares the data types of LLVM IR.
Package value provides a definition of LLVM IR values.
Package value provides a definition of LLVM IR values.

Jump to

Keyboard shortcuts

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