Documentation
¶
Overview ¶
Package llvm provides a way to build and write out LLVM modules.
This package was created for the express purpose of generating LLVM IR. A good portion of this code was taken from https://github.com/llir/llvm. As such, it does not contain features such as sanity checking and IR parsing. The main reason this package was created was to add support for opaque pointers and drop support for the legacy typed ones.
Index ¶
- Variables
- func EncodeFunctionName(name string) string
- func EncodeGlobalName(name string) string
- func EncodeLabelName(name string) string
- func EncodeRegisterName(name string) string
- func EncodeTypeName(name string) string
- func Escape(s []byte, valid func(b byte) bool) string
- func EscapeIdent(s string) string
- func EscapeQuoteString(s []byte) string
- func EscapeString(s []byte) string
- func TypesEqual(left, right Type) bool
- type AbstractInstructionBinary
- type AbstractInstructionBinaryExact
- type AbstractInstructionBinaryFP
- type AbstractInstructionCast
- type AbstractType
- type AddressSpace
- type Align
- type AtomicOp
- type AtomicOrdering
- type Block
- func (this *Block) AddInstruction(instruction Instruction)
- func (this *Block) Identifier() string
- func (this *Block) LLString() string
- func (this *Block) Name() string
- func (this *Block) NewAShr(x, y Value) *InstructionAShr
- func (this *Block) NewAdd(x, y Value) *InstructionAdd
- func (this *Block) NewAddrSpaceCast(from Value, to Type) *InstructionAddrSpaceCast
- func (this *Block) NewAlloca(element Type) *InstructionAlloca
- func (this *Block) NewAnd(x, y Value) *InstructionAnd
- func (this *Block) NewAtomicRMW(op AtomicOp, destination, x Value, ordering AtomicOrdering) *InstructionAtomicRMW
- func (this *Block) NewBitCast(from Value, to Type) *InstructionBitCast
- func (this *Block) NewBr(target Value) *TerminatorBr
- func (this *Block) NewCall(callee Value, signature *TypeFunction, args ...Value) *InstructionCall
- func (this *Block) NewCallBr(callee Value, signature *TypeFunction, args []Value, normalTarget Value, ...) *TerminatorCallBr
- func (this *Block) NewCatchPad(catchSwitch Value, args ...Value) *InstructionCatchPad
- func (this *Block) NewCatchRet(catchPad Value, target Value) *TerminatorCatchRet
- func (this *Block) NewCatchSwitch(parentPad Value, handlers []Value, defaultUnwindTarget Value) *TerminatorCatchSwitch
- func (this *Block) NewCleanupPad(parentPad Value, args ...Value) *InstructionCleanupPad
- func (this *Block) NewCleanupRet(cleanupPad, unwindTarget Value) *TerminatorCleanupRet
- func (this *Block) NewCmpXchg(source, against, neww Value, success, failure AtomicOrdering) *InstructionCmpXchg
- func (this *Block) NewCondBr(condition Value, tru, fals Value) *TerminatorCondBr
- func (this *Block) NewExtractElement(x, index Value) *InstructionExtractElement
- func (this *Block) NewExtractValue(x Value, indices ...uint64) *InstructionExtractValue
- func (this *Block) NewFAdd(x, y Value) *InstructionFAdd
- func (this *Block) NewFCmp(predicate FPredicate, x, y Value) *InstructionFCmp
- func (this *Block) NewFDiv(x, y Value) *InstructionFDiv
- func (this *Block) NewFMul(x, y Value) *InstructionFMul
- func (this *Block) NewFNeg(x Value) *InstructionFNeg
- func (this *Block) NewFPExt(from Value, to Type) *InstructionFPExt
- func (this *Block) NewFPToSI(from Value, to Type) *InstructionFPToSI
- func (this *Block) NewFPToUI(from Value, to Type) *InstructionFPToUI
- func (this *Block) NewFPTrunc(from Value, to Type) *InstructionFPTrunc
- func (this *Block) NewFRem(x, y Value) *InstructionFRem
- func (this *Block) NewFSub(x, y Value) *InstructionFSub
- func (this *Block) NewFence(ordering AtomicOrdering) *InstructionFence
- func (this *Block) NewFreeze(x Value) *InstructionFreeze
- func (this *Block) NewGetElementPtr(element Type, source Value, indices ...Value) *InstructionGetElementPtr
- func (this *Block) NewICmp(predicate IPredicate, x, y Value) *InstructionICmp
- func (this *Block) NewIndirectBr(address Value, validTargets ...Value) *TerminatorIndirectBr
- func (this *Block) NewInsertElement(x, element, index Value) *InstructionInsertElement
- func (this *Block) NewInsertValue(x, element Value, indices ...uint64) *InstructionInsertValue
- func (this *Block) NewIntToPtr(from Value, to Type) *InstructionIntToPtr
- func (this *Block) NewInvoke(invokee Value, signature *TypeFunction, args []Value, normalTarget Value, ...) *TerminatorInvoke
- func (this *Block) NewLShr(x, y Value) *InstructionLShr
- func (this *Block) NewLandingPad(result Type, clauses ...*Clause) *InstructionLandingPad
- func (this *Block) NewLoad(element Type, source Value) *InstructionLoad
- func (this *Block) NewMul(x, y Value) *InstructionMul
- func (this *Block) NewOr(x, y Value) *InstructionOr
- func (this *Block) NewPhi(incoming ...*Incoming) *InstructionPhi
- func (this *Block) NewPtrToInt(from Value, to Type) *InstructionPtrToInt
- func (this *Block) NewResume(x Value) *TerminatorResume
- func (this *Block) NewRet(x Value) *TerminatorRet
- func (this *Block) NewSDiv(x, y Value) *InstructionSDiv
- func (this *Block) NewSExt(from Value, to Type) *InstructionSExt
- func (this *Block) NewSIToFP(from Value, to Type) *InstructionSExt
- func (this *Block) NewSRem(x, y Value) *InstructionSRem
- func (this *Block) NewSelect(condition, tru, fals Value) *InstructionSelect
- func (this *Block) NewShl(x, y Value) *InstructionShl
- func (this *Block) NewShuffleVector(x, y, mask Value) *InstructionShuffleVector
- func (this *Block) NewStore(source, destination Value) *InstructionStore
- func (this *Block) NewSub(x, y Value) *InstructionSub
- func (this *Block) NewSwitch(x, defaul Value, cases ...*Case) *TerminatorSwitch
- func (this *Block) NewTrunc(from Value, to Type) *InstructionTrunc
- func (this *Block) NewUDiv(x, y Value) *InstructionUDiv
- func (this *Block) NewUIToFP(from Value, to Type) *InstructionUIToFP
- func (this *Block) NewURem(x, y Value) *InstructionURem
- func (this *Block) NewUnreachable() *TerminatorUnreachable
- func (this *Block) NewVAArg(list Value, ty Type) *InstructionVAArg
- func (this *Block) NewXor(x, y Value) *InstructionXor
- func (this *Block) NewZext(from Value, to Type) *InstructionZext
- func (this *Block) SetName(name string)
- func (this *Block) SetTerminator(terminator Terminator)
- func (this *Block) String() string
- func (this *Block) Terminated() bool
- func (this *Block) Type() Type
- type Case
- type Clause
- type ClauseType
- type Const
- type ConstArray
- type ConstBlockAddress
- type ConstCharArray
- type ConstDSOLocalEquivalent
- type ConstExpr
- type ConstFloat
- type ConstIndex
- type ConstInt
- type ConstNoCFI
- type ConstNull
- type ConstPoison
- type ConstStruct
- type ConstUndef
- type ConstVector
- type ConstZeroInitializer
- type FPredicate
- type FastMathFlag
- type FloatKind
- type Function
- type Global
- type IPredicate
- type Incoming
- type Instruction
- type InstructionAShr
- type InstructionAdd
- type InstructionAddrSpaceCast
- type InstructionAlloca
- type InstructionAnd
- type InstructionAtomicRMW
- type InstructionBitCast
- type InstructionCall
- type InstructionCatchPad
- type InstructionCleanupPad
- type InstructionCmpXchg
- type InstructionExtractElement
- type InstructionExtractValue
- type InstructionFAdd
- type InstructionFCmp
- type InstructionFDiv
- type InstructionFMul
- type InstructionFNeg
- type InstructionFPExt
- type InstructionFPToSI
- type InstructionFPToUI
- type InstructionFPTrunc
- type InstructionFRem
- type InstructionFSub
- type InstructionFence
- type InstructionFreeze
- type InstructionGetElementPtr
- type InstructionICmp
- type InstructionInsertElement
- type InstructionInsertValue
- type InstructionIntToPtr
- type InstructionLShr
- type InstructionLandingPad
- type InstructionLoad
- type InstructionMul
- type InstructionOr
- type InstructionPhi
- type InstructionPtrToInt
- type InstructionSDiv
- type InstructionSExt
- type InstructionSIToFP
- type InstructionSRem
- type InstructionSelect
- type InstructionShl
- type InstructionShuffleVector
- type InstructionStore
- type InstructionSub
- type InstructionTrunc
- type InstructionUDiv
- type InstructionUIToFP
- type InstructionURem
- type InstructionVAArg
- type InstructionXor
- type InstructionZext
- type Module
- type OverflowFlag
- type Parameter
- type Register
- type Terminator
- type TerminatorBr
- type TerminatorCallBr
- type TerminatorCatchRet
- type TerminatorCatchSwitch
- type TerminatorCleanupRet
- type TerminatorCondBr
- type TerminatorIndirectBr
- type TerminatorInvoke
- type TerminatorResume
- type TerminatorRet
- type TerminatorSwitch
- type TerminatorUnreachable
- type Type
- type TypeArray
- type TypeDefined
- type TypeFloat
- type TypeFunction
- type TypeInt
- type TypeLabel
- type TypeMMX
- type TypeMetadata
- type TypePointer
- type TypeStruct
- type TypeToken
- type TypeVector
- type TypeVoid
- type Value
- type ValueInstruction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Basic types. Pointer = &TypePointer{} // ptr Void = &TypeVoid{} // void MMX = &TypeMMX{} // x86_mmx Label = &TypeLabel{} // label Token = &TypeToken{} // token Metadata = &TypeMetadata{} // metadata // Integer types. I1 = &TypeInt{BitSize: 1} // i1 I2 = &TypeInt{BitSize: 2} // i2 I3 = &TypeInt{BitSize: 3} // i3 I4 = &TypeInt{BitSize: 4} // i4 I5 = &TypeInt{BitSize: 5} // i5 I6 = &TypeInt{BitSize: 6} // i6 I7 = &TypeInt{BitSize: 7} // i7 I8 = &TypeInt{BitSize: 8} // i8 I16 = &TypeInt{BitSize: 16} // i16 I32 = &TypeInt{BitSize: 32} // i32 I64 = &TypeInt{BitSize: 64} // i64 I128 = &TypeInt{BitSize: 128} // i128 I256 = &TypeInt{BitSize: 256} // i256 I512 = &TypeInt{BitSize: 512} // i512 I1024 = &TypeInt{BitSize: 1024} // i1024 // Floating-point types. Half = &TypeFloat{Kind: FloatKindHalf} // half Float = &TypeFloat{Kind: FloatKindFloat} // float Double = &TypeFloat{Kind: FloatKindDouble} // double X86_FP80 = &TypeFloat{Kind: FloatKindX86_FP80} // x86_fp80 FP128 = &TypeFloat{Kind: FloatKindFP128} // fp128 PPC_FP128 = &TypeFloat{Kind: FloatKindPPC_FP128} // ppc_fp128 )
Functions ¶
func EncodeFunctionName ¶
func EncodeGlobalName ¶
func EncodeLabelName ¶
func EncodeRegisterName ¶
func EncodeTypeName ¶
func EscapeIdent ¶
func EscapeQuoteString ¶
func EscapeString ¶
func TypesEqual ¶
TypesEqual checks if two types are equal to eachother, even if one or both are nil.
Types ¶
type AbstractInstructionBinary ¶
func (*AbstractInstructionBinary) LLString ¶
func (this *AbstractInstructionBinary) LLString() string
type AbstractInstructionBinaryExact ¶
type AbstractInstructionBinaryExact struct { AbstractInstructionBinary Exact bool }
func (*AbstractInstructionBinaryExact) LLString ¶
func (this *AbstractInstructionBinaryExact) LLString() string
type AbstractInstructionBinaryFP ¶
type AbstractInstructionBinaryFP struct { AbstractInstructionBinary FastMathFlags []FastMathFlag }
func (*AbstractInstructionBinaryFP) LLString ¶
func (this *AbstractInstructionBinaryFP) LLString() string
type AbstractInstructionCast ¶
func (*AbstractInstructionCast) LLString ¶
func (this *AbstractInstructionCast) LLString() string
type AbstractType ¶
type AbstractType struct {
// contains filtered or unexported fields
}
func (*AbstractType) Name ¶
func (this *AbstractType) Name() string
func (*AbstractType) Named ¶
func (this *AbstractType) Named() bool
func (*AbstractType) SetName ¶
func (this *AbstractType) SetName(name string)
type AddressSpace ¶
type AddressSpace uint64
func (AddressSpace) String ¶
func (space AddressSpace) String() string
type AtomicOrdering ¶
type AtomicOrdering uint8
const ( // not_atomic AtomicOrderingNone AtomicOrdering = 0 // none AtomicOrderingUnordered AtomicOrdering = 1 // unordered AtomicOrderingMonotonic AtomicOrdering = 2 // monotonic //AtomicOrderingConsume AtomicOrdering = 3 // consume AtomicOrderingAcquire AtomicOrdering = 4 // acquire AtomicOrderingRelease AtomicOrdering = 5 // release AtomicOrderingAcquireRelease AtomicOrdering = 6 // acq_rel AtomicOrderingSequentiallyConsistent AtomicOrdering = 7 // seq_cst )
func (AtomicOrdering) String ¶
func (ordering AtomicOrdering) String() string
type Block ¶
type Block struct { BlockName string Parent *Function Instructions []Instruction }
func (*Block) AddInstruction ¶
func (this *Block) AddInstruction(instruction Instruction)
func (*Block) Identifier ¶
func (*Block) NewAShr ¶
func (this *Block) NewAShr(x, y Value) *InstructionAShr
func (*Block) NewAdd ¶
func (this *Block) NewAdd(x, y Value) *InstructionAdd
func (*Block) NewAddrSpaceCast ¶
func (this *Block) NewAddrSpaceCast(from Value, to Type) *InstructionAddrSpaceCast
func (*Block) NewAlloca ¶
func (this *Block) NewAlloca(element Type) *InstructionAlloca
func (*Block) NewAnd ¶
func (this *Block) NewAnd(x, y Value) *InstructionAnd
func (*Block) NewAtomicRMW ¶
func (this *Block) NewAtomicRMW(op AtomicOp, destination, x Value, ordering AtomicOrdering) *InstructionAtomicRMW
func (*Block) NewBitCast ¶
func (this *Block) NewBitCast(from Value, to Type) *InstructionBitCast
func (*Block) NewBr ¶
func (this *Block) NewBr(target Value) *TerminatorBr
func (*Block) NewCall ¶
func (this *Block) NewCall(callee Value, signature *TypeFunction, args ...Value) *InstructionCall
func (*Block) NewCallBr ¶
func (this *Block) NewCallBr( callee Value, signature *TypeFunction, args []Value, normalTarget Value, otherTargets ...Value, ) *TerminatorCallBr
func (*Block) NewCatchPad ¶
func (this *Block) NewCatchPad(catchSwitch Value, args ...Value) *InstructionCatchPad
func (*Block) NewCatchRet ¶
func (this *Block) NewCatchRet(catchPad Value, target Value) *TerminatorCatchRet
func (*Block) NewCatchSwitch ¶
func (this *Block) NewCatchSwitch(parentPad Value, handlers []Value, defaultUnwindTarget Value) *TerminatorCatchSwitch
func (*Block) NewCleanupPad ¶
func (this *Block) NewCleanupPad(parentPad Value, args ...Value) *InstructionCleanupPad
func (*Block) NewCleanupRet ¶
func (this *Block) NewCleanupRet(cleanupPad, unwindTarget Value) *TerminatorCleanupRet
func (*Block) NewCmpXchg ¶
func (this *Block) NewCmpXchg(source, against, neww Value, success, failure AtomicOrdering) *InstructionCmpXchg
func (*Block) NewCondBr ¶
func (this *Block) NewCondBr(condition Value, tru, fals Value) *TerminatorCondBr
func (*Block) NewExtractElement ¶
func (this *Block) NewExtractElement(x, index Value) *InstructionExtractElement
func (*Block) NewExtractValue ¶
func (this *Block) NewExtractValue(x Value, indices ...uint64) *InstructionExtractValue
func (*Block) NewFAdd ¶
func (this *Block) NewFAdd(x, y Value) *InstructionFAdd
func (*Block) NewFCmp ¶
func (this *Block) NewFCmp(predicate FPredicate, x, y Value) *InstructionFCmp
func (*Block) NewFDiv ¶
func (this *Block) NewFDiv(x, y Value) *InstructionFDiv
func (*Block) NewFMul ¶
func (this *Block) NewFMul(x, y Value) *InstructionFMul
func (*Block) NewFNeg ¶
func (this *Block) NewFNeg(x Value) *InstructionFNeg
func (*Block) NewFPTrunc ¶
func (this *Block) NewFPTrunc(from Value, to Type) *InstructionFPTrunc
func (*Block) NewFRem ¶
func (this *Block) NewFRem(x, y Value) *InstructionFRem
func (*Block) NewFSub ¶
func (this *Block) NewFSub(x, y Value) *InstructionFSub
func (*Block) NewFence ¶
func (this *Block) NewFence(ordering AtomicOrdering) *InstructionFence
func (*Block) NewFreeze ¶
func (this *Block) NewFreeze(x Value) *InstructionFreeze
func (*Block) NewGetElementPtr ¶
func (this *Block) NewGetElementPtr(element Type, source Value, indices ...Value) *InstructionGetElementPtr
func (*Block) NewICmp ¶
func (this *Block) NewICmp(predicate IPredicate, x, y Value) *InstructionICmp
func (*Block) NewIndirectBr ¶
func (this *Block) NewIndirectBr(address Value, validTargets ...Value) *TerminatorIndirectBr
func (*Block) NewInsertElement ¶
func (this *Block) NewInsertElement(x, element, index Value) *InstructionInsertElement
func (*Block) NewInsertValue ¶
func (this *Block) NewInsertValue(x, element Value, indices ...uint64) *InstructionInsertValue
func (*Block) NewIntToPtr ¶
func (this *Block) NewIntToPtr(from Value, to Type) *InstructionIntToPtr
func (*Block) NewInvoke ¶
func (this *Block) NewInvoke( invokee Value, signature *TypeFunction, args []Value, normalTarget Value, exceptionTarget Value, ) *TerminatorInvoke
func (*Block) NewLShr ¶
func (this *Block) NewLShr(x, y Value) *InstructionLShr
func (*Block) NewLandingPad ¶
func (this *Block) NewLandingPad(result Type, clauses ...*Clause) *InstructionLandingPad
func (*Block) NewMul ¶
func (this *Block) NewMul(x, y Value) *InstructionMul
func (*Block) NewOr ¶
func (this *Block) NewOr(x, y Value) *InstructionOr
func (*Block) NewPhi ¶
func (this *Block) NewPhi(incoming ...*Incoming) *InstructionPhi
func (*Block) NewPtrToInt ¶
func (this *Block) NewPtrToInt(from Value, to Type) *InstructionPtrToInt
func (*Block) NewResume ¶
func (this *Block) NewResume(x Value) *TerminatorResume
func (*Block) NewRet ¶
func (this *Block) NewRet(x Value) *TerminatorRet
func (*Block) NewSDiv ¶
func (this *Block) NewSDiv(x, y Value) *InstructionSDiv
func (*Block) NewSRem ¶
func (this *Block) NewSRem(x, y Value) *InstructionSRem
func (*Block) NewSelect ¶
func (this *Block) NewSelect(condition, tru, fals Value) *InstructionSelect
func (*Block) NewShl ¶
func (this *Block) NewShl(x, y Value) *InstructionShl
func (*Block) NewShuffleVector ¶
func (this *Block) NewShuffleVector(x, y, mask Value) *InstructionShuffleVector
func (*Block) NewStore ¶
func (this *Block) NewStore(source, destination Value) *InstructionStore
func (*Block) NewSub ¶
func (this *Block) NewSub(x, y Value) *InstructionSub
func (*Block) NewSwitch ¶
func (this *Block) NewSwitch(x, defaul Value, cases ...*Case) *TerminatorSwitch
func (*Block) NewUDiv ¶
func (this *Block) NewUDiv(x, y Value) *InstructionUDiv
func (*Block) NewURem ¶
func (this *Block) NewURem(x, y Value) *InstructionURem
func (*Block) NewUnreachable ¶
func (this *Block) NewUnreachable() *TerminatorUnreachable
func (*Block) NewXor ¶
func (this *Block) NewXor(x, y Value) *InstructionXor
func (*Block) SetTerminator ¶
func (this *Block) SetTerminator(terminator Terminator)
func (*Block) Terminated ¶
type Case ¶
func (*Case) IsTerminator ¶
func (*Case) IsTerminator()
type Clause ¶
type Clause struct { Type ClauseType X Value }
type ClauseType ¶
type ClauseType uint8
const ( ClauseTypeCatch ClauseType = iota + 1 // catch ClauseTypeFilter // filter )
func (ClauseType) String ¶
func (ty ClauseType) String() string
type ConstArray ¶
func (*ConstArray) Identifier ¶
func (this *ConstArray) Identifier() string
func (*ConstArray) IsConstant ¶
func (*ConstArray) IsConstant()
func (*ConstArray) Name ¶
func (this *ConstArray) Name() string
func (*ConstArray) String ¶
func (this *ConstArray) String() string
func (*ConstArray) Type ¶
func (this *ConstArray) Type() Type
type ConstBlockAddress ¶
func (*ConstBlockAddress) Identifier ¶
func (this *ConstBlockAddress) Identifier() string
func (*ConstBlockAddress) IsConstant ¶
func (*ConstBlockAddress) IsConstant()
func (*ConstBlockAddress) Name ¶
func (this *ConstBlockAddress) Name() string
func (*ConstBlockAddress) String ¶
func (this *ConstBlockAddress) String() string
func (*ConstBlockAddress) Type ¶
func (this *ConstBlockAddress) Type() Type
type ConstCharArray ¶
func (*ConstCharArray) Identifier ¶
func (this *ConstCharArray) Identifier() string
func (*ConstCharArray) IsConstant ¶
func (*ConstCharArray) IsConstant()
func (*ConstCharArray) Name ¶
func (this *ConstCharArray) Name() string
func (*ConstCharArray) String ¶
func (this *ConstCharArray) String() string
func (*ConstCharArray) Type ¶
func (this *ConstCharArray) Type() Type
type ConstDSOLocalEquivalent ¶
type ConstDSOLocalEquivalent struct {
Function Const
}
func (*ConstDSOLocalEquivalent) Identifier ¶
func (this *ConstDSOLocalEquivalent) Identifier() string
func (*ConstDSOLocalEquivalent) IsConstant ¶
func (*ConstDSOLocalEquivalent) IsConstant()
func (*ConstDSOLocalEquivalent) Name ¶
func (this *ConstDSOLocalEquivalent) Name() string
func (*ConstDSOLocalEquivalent) String ¶
func (this *ConstDSOLocalEquivalent) String() string
func (*ConstDSOLocalEquivalent) Type ¶
func (this *ConstDSOLocalEquivalent) Type() Type
type ConstFloat ¶
func NewConstFloat ¶
func NewConstFloat(ty *TypeFloat, value float64) *ConstFloat
func (*ConstFloat) Identifier ¶
func (this *ConstFloat) Identifier() string
func (*ConstFloat) IsConstant ¶
func (*ConstFloat) IsConstant()
func (*ConstFloat) Name ¶
func (this *ConstFloat) Name() string
func (*ConstFloat) String ¶
func (this *ConstFloat) String() string
func (*ConstFloat) Type ¶
func (this *ConstFloat) Type() Type
type ConstIndex ¶
func (*ConstIndex) Identifier ¶
func (this *ConstIndex) Identifier() string
func (*ConstIndex) Name ¶
func (this *ConstIndex) Name() string
type ConstInt ¶
func NewConstBool ¶
func NewConstInt ¶
func (*ConstInt) Identifier ¶
func (*ConstInt) IsConstant ¶
func (*ConstInt) IsConstant()
type ConstNoCFI ¶
type ConstNoCFI struct {
Function Const
}
func (*ConstNoCFI) Identifier ¶
func (this *ConstNoCFI) Identifier() string
func (*ConstNoCFI) IsConstant ¶
func (*ConstNoCFI) IsConstant()
func (*ConstNoCFI) Name ¶
func (this *ConstNoCFI) Name() string
func (*ConstNoCFI) String ¶
func (this *ConstNoCFI) String() string
func (*ConstNoCFI) Type ¶
func (this *ConstNoCFI) Type() Type
type ConstNull ¶
type ConstNull struct{}
func (*ConstNull) Identifier ¶
func (*ConstNull) IsConstant ¶
func (*ConstNull) IsConstant()
type ConstPoison ¶
type ConstPoison struct {
Ty Type
}
func (*ConstPoison) Identifier ¶
func (this *ConstPoison) Identifier() string
func (*ConstPoison) IsConstant ¶
func (*ConstPoison) IsConstant()
func (*ConstPoison) Name ¶
func (this *ConstPoison) Name() string
func (*ConstPoison) String ¶
func (this *ConstPoison) String() string
func (*ConstPoison) Type ¶
func (this *ConstPoison) Type() Type
type ConstStruct ¶
type ConstStruct struct { Ty *TypeStruct Fields []Const }
func (*ConstStruct) Identifier ¶
func (this *ConstStruct) Identifier() string
func (*ConstStruct) IsConstant ¶
func (*ConstStruct) IsConstant()
func (*ConstStruct) Name ¶
func (this *ConstStruct) Name() string
func (*ConstStruct) String ¶
func (this *ConstStruct) String() string
func (*ConstStruct) Type ¶
func (this *ConstStruct) Type() Type
type ConstUndef ¶
type ConstUndef struct {
Ty Type
}
func (*ConstUndef) Identifier ¶
func (this *ConstUndef) Identifier() string
func (*ConstUndef) IsConstant ¶
func (*ConstUndef) IsConstant()
func (*ConstUndef) Name ¶
func (this *ConstUndef) Name() string
func (*ConstUndef) String ¶
func (this *ConstUndef) String() string
func (*ConstUndef) Type ¶
func (this *ConstUndef) Type() Type
type ConstVector ¶
type ConstVector struct { Ty *TypeVector Elements []Const }
func (*ConstVector) Identifier ¶
func (this *ConstVector) Identifier() string
func (*ConstVector) IsConstant ¶
func (*ConstVector) IsConstant()
func (*ConstVector) Name ¶
func (this *ConstVector) Name() string
func (*ConstVector) String ¶
func (this *ConstVector) String() string
func (*ConstVector) Type ¶
func (this *ConstVector) Type() Type
type ConstZeroInitializer ¶
type ConstZeroInitializer struct {
Ty Type
}
func NewConstZeroInitializer ¶
func NewConstZeroInitializer(ty Type) *ConstZeroInitializer
func (*ConstZeroInitializer) Identifier ¶
func (this *ConstZeroInitializer) Identifier() string
func (*ConstZeroInitializer) IsConstant ¶
func (*ConstZeroInitializer) IsConstant()
func (*ConstZeroInitializer) Name ¶
func (this *ConstZeroInitializer) Name() string
func (*ConstZeroInitializer) String ¶
func (this *ConstZeroInitializer) String() string
func (*ConstZeroInitializer) Type ¶
func (this *ConstZeroInitializer) Type() Type
type FPredicate ¶
type FPredicate uint8
const ( FPredicateFalse FPredicate = iota // false FPredicateOEQ // oeq FPredicateOGE // oge FPredicateOGT // ogt FPredicateOLE // ole FPredicateOLT // olt FPredicateONE // one FPredicateORD // ord FPredicateTrue // true FPredicateUEQ // ueq FPredicateUGE // uge FPredicateUGT // ugt FPredicateULE // ule FPredicateULT // ult FPredicateUNE // une FPredicateUNO // uno )
func (FPredicate) String ¶
func (predicate FPredicate) String() string
type FastMathFlag ¶
type FastMathFlag uint8
const ( FastMathFlagAFn FastMathFlag = iota // afn FastMathFlagARcp // arcp FastMathFlagContract // contract FastMathFlagFast // fast FastMathFlagNInf // ninf FastMathFlagNNaN // nnan FastMathFlagNSZ // nsz FastMathFlagReassoc // reassoc )
func (FastMathFlag) String ¶
func (flag FastMathFlag) String() string
type FloatKind ¶
type FloatKind uint8
const ( // 16-bit floating-point type (IEEE 754 half precision). FloatKindHalf FloatKind = iota // half // 32-bit floating-point type (IEEE 754 single precision). FloatKindFloat // float // 64-bit floating-point type (IEEE 754 double precision). FloatKindDouble // double // 128-bit floating-point type (IEEE 754 quadruple precision). FloatKindFP128 // fp128 // 80-bit floating-point type (x86 extended precision). FloatKindX86_FP80 // x86_fp80 // 128-bit floating-point type (PowerPC double-double arithmetic). FloatKindPPC_FP128 // ppc_fp128 )
type Function ¶
type Function struct { FunctionName string Signature *TypeFunction Parameters []*Parameter Blocks []*Block AddressSpace AddressSpace }
func (*Function) Identifier ¶
type Global ¶
type Global struct { Ty Type GlobalName string Constant bool Initial Const AddressSpace AddressSpace }
func (*Global) Identifier ¶
func (*Global) IsConstant ¶
func (this *Global) IsConstant()
type IPredicate ¶
type IPredicate uint8
const ( IPredicateEQ IPredicate = iota // eq IPredicateNE // ne IPredicateSGE // sge IPredicateSGT // sgt IPredicateSLE // sle IPredicateSLT // slt IPredicateUGE // uge IPredicateUGT // ugt IPredicateULE // ule IPredicateULT // ult )
func (IPredicate) String ¶
func (predicate IPredicate) String() string
type Instruction ¶
type Instruction interface {
LLString() string
}
type InstructionAShr ¶
type InstructionAShr struct {
AbstractInstructionBinaryExact
}
type InstructionAdd ¶
type InstructionAdd struct {
AbstractInstructionBinary
}
type InstructionAddrSpaceCast ¶
type InstructionAddrSpaceCast struct {
AbstractInstructionCast
}
type InstructionAlloca ¶
type InstructionAlloca struct { Register Element Type Count Value InAlloca bool Align Align AddressSpace AddressSpace }
func NewAlloca ¶
func NewAlloca(element Type) *InstructionAlloca
func (*InstructionAlloca) LLString ¶
func (this *InstructionAlloca) LLString() string
type InstructionAnd ¶
type InstructionAnd struct {
AbstractInstructionBinary
}
type InstructionAtomicRMW ¶
type InstructionAtomicRMW struct { Register Op AtomicOp Destination Value X Value Ordering AtomicOrdering Volatile bool SyncScope string }
func (*InstructionAtomicRMW) LLString ¶
func (this *InstructionAtomicRMW) LLString() string
type InstructionBitCast ¶
func (*InstructionBitCast) LLString ¶
func (this *InstructionBitCast) LLString() string
type InstructionCall ¶
type InstructionCall struct { Register Callee Value Signature *TypeFunction Arguments []Value AddressSpace AddressSpace }
func (*InstructionCall) LLString ¶
func (this *InstructionCall) LLString() string
func (*InstructionCall) Type ¶
func (this *InstructionCall) Type() Type
type InstructionCatchPad ¶
func (*InstructionCatchPad) LLString ¶
func (this *InstructionCatchPad) LLString() string
type InstructionCleanupPad ¶
func (*InstructionCleanupPad) LLString ¶
func (this *InstructionCleanupPad) LLString() string
type InstructionCmpXchg ¶
type InstructionCmpXchg struct { Register Source Value Against Value New Value SuccessOrdering AtomicOrdering FailureOrdering AtomicOrdering Weak bool Volatile bool SyncScope string }
func (*InstructionCmpXchg) LLString ¶
func (this *InstructionCmpXchg) LLString() string
type InstructionExtractElement ¶
func (*InstructionExtractElement) LLString ¶
func (this *InstructionExtractElement) LLString() string
type InstructionExtractValue ¶
func (*InstructionExtractValue) LLString ¶
func (this *InstructionExtractValue) LLString() string
type InstructionFAdd ¶
type InstructionFAdd struct {
AbstractInstructionBinaryFP
}
type InstructionFCmp ¶
type InstructionFCmp struct { AbstractInstructionBinaryFP Predicate FPredicate }
func (*InstructionFCmp) LLString ¶
func (this *InstructionFCmp) LLString() string
type InstructionFDiv ¶
type InstructionFDiv struct {
AbstractInstructionBinaryFP
}
type InstructionFMul ¶
type InstructionFMul struct {
AbstractInstructionBinaryFP
}
type InstructionFNeg ¶
type InstructionFNeg struct { Register X Value FastMathFlags []FastMathFlag }
func (*InstructionFNeg) LLString ¶
func (this *InstructionFNeg) LLString() string
type InstructionFPExt ¶
type InstructionFPExt struct {
AbstractInstructionCast
}
type InstructionFPToSI ¶
type InstructionFPToSI struct {
AbstractInstructionCast
}
type InstructionFPToUI ¶
type InstructionFPToUI struct {
AbstractInstructionCast
}
type InstructionFPTrunc ¶
type InstructionFPTrunc struct {
AbstractInstructionCast
}
type InstructionFRem ¶
type InstructionFRem struct {
AbstractInstructionBinaryFP
}
type InstructionFSub ¶
type InstructionFSub struct {
AbstractInstructionBinaryFP
}
type InstructionFence ¶
type InstructionFence struct { Ordering AtomicOrdering SyncScope string }
func (*InstructionFence) LLString ¶
func (this *InstructionFence) LLString() string
type InstructionFreeze ¶
func (*InstructionFreeze) LLString ¶
func (this *InstructionFreeze) LLString() string
type InstructionGetElementPtr ¶
type InstructionGetElementPtr struct { Register Element Type Source Value Indices []Value InBounds bool }
func (*InstructionGetElementPtr) LLString ¶
func (this *InstructionGetElementPtr) LLString() string
type InstructionICmp ¶
type InstructionICmp struct { AbstractInstructionBinary Predicate IPredicate }
func (*InstructionICmp) LLString ¶
func (this *InstructionICmp) LLString() string
type InstructionInsertElement ¶
func (*InstructionInsertElement) LLString ¶
func (this *InstructionInsertElement) LLString() string
type InstructionInsertValue ¶
func (*InstructionInsertValue) LLString ¶
func (this *InstructionInsertValue) LLString() string
type InstructionIntToPtr ¶
type InstructionIntToPtr struct {
AbstractInstructionCast
}
type InstructionLShr ¶
type InstructionLShr struct {
AbstractInstructionBinaryExact
}
type InstructionLandingPad ¶
func (*InstructionLandingPad) LLString ¶
func (this *InstructionLandingPad) LLString() string
type InstructionLoad ¶
type InstructionLoad struct { Register Source Value Atomic bool Volatile bool SyncScope string Ordering AtomicOrdering Align Align }
func (*InstructionLoad) LLString ¶
func (this *InstructionLoad) LLString() string
type InstructionMul ¶
type InstructionMul struct { AbstractInstructionBinary OverflowFlags []OverflowFlag }
func (*InstructionMul) LLString ¶
func (this *InstructionMul) LLString() string
type InstructionOr ¶
type InstructionOr struct {
AbstractInstructionBinary
}
type InstructionPhi ¶
type InstructionPhi struct { Register Incoming []*Incoming FastMathFlags []FastMathFlag }
func (*InstructionPhi) LLString ¶
func (this *InstructionPhi) LLString() string
type InstructionPtrToInt ¶
type InstructionPtrToInt struct {
AbstractInstructionCast
}
type InstructionSDiv ¶
type InstructionSDiv struct { AbstractInstructionBinary Exact bool }
func (*InstructionSDiv) LLString ¶
func (this *InstructionSDiv) LLString() string
type InstructionSExt ¶
type InstructionSExt struct {
AbstractInstructionCast
}
type InstructionSIToFP ¶
type InstructionSIToFP struct {
AbstractInstructionCast
}
type InstructionSRem ¶
type InstructionSRem struct {
AbstractInstructionBinary
}
type InstructionSelect ¶
type InstructionSelect struct { Register Condition Value True Value False Value FastMathFlags []FastMathFlag }
func (*InstructionSelect) LLString ¶
func (this *InstructionSelect) LLString() string
type InstructionShl ¶
type InstructionShl struct { AbstractInstructionBinary OverflowFlags []OverflowFlag }
func (*InstructionShl) LLString ¶
func (this *InstructionShl) LLString() string
type InstructionShuffleVector ¶
func (*InstructionShuffleVector) LLString ¶
func (this *InstructionShuffleVector) LLString() string
type InstructionStore ¶
type InstructionStore struct {
Source, Destination Value
Atomic bool
Volatile bool
SyncScope string
Ordering AtomicOrdering
Align Align
}
func (*InstructionStore) LLString ¶
func (this *InstructionStore) LLString() string
type InstructionSub ¶
type InstructionSub struct { AbstractInstructionBinary OverflowFlags []OverflowFlag }
func (*InstructionSub) LLString ¶
func (this *InstructionSub) LLString() string
type InstructionTrunc ¶
type InstructionTrunc struct {
AbstractInstructionCast
}
type InstructionUDiv ¶
type InstructionUDiv struct {
AbstractInstructionBinaryExact
}
type InstructionUIToFP ¶
type InstructionUIToFP struct {
AbstractInstructionCast
}
type InstructionURem ¶
type InstructionURem struct {
AbstractInstructionBinary
}
type InstructionVAArg ¶
func (*InstructionVAArg) LLString ¶
func (this *InstructionVAArg) LLString() string
type InstructionXor ¶
type InstructionXor struct {
AbstractInstructionBinary
}
type InstructionZext ¶
type InstructionZext struct {
AbstractInstructionCast
}
type Module ¶
func (*Module) NewFunction ¶
type OverflowFlag ¶
type OverflowFlag uint8
const ( OverflowFlagNSW OverflowFlag = iota // nsw OverflowFlagNUW // nuw )
func (OverflowFlag) String ¶
func (flag OverflowFlag) String() string
type Register ¶
func (*Register) Identifier ¶
type Terminator ¶
type Terminator interface { IsTerminator() Instruction }
type TerminatorBr ¶
type TerminatorBr struct {
Target Value
}
func (*TerminatorBr) IsTerminator ¶
func (*TerminatorBr) IsTerminator()
func (*TerminatorBr) LLString ¶
func (this *TerminatorBr) LLString() string
type TerminatorCallBr ¶
type TerminatorCallBr struct { InstructionCall NormalTarget Value OtherTargets []Value }
func (*TerminatorCallBr) IsTerminator ¶
func (*TerminatorCallBr) IsTerminator()
func (*TerminatorCallBr) LLString ¶
func (this *TerminatorCallBr) LLString() string
type TerminatorCatchRet ¶
func (*TerminatorCatchRet) IsTerminator ¶
func (*TerminatorCatchRet) IsTerminator()
func (*TerminatorCatchRet) LLString ¶
func (this *TerminatorCatchRet) LLString() string
type TerminatorCatchSwitch ¶
type TerminatorCatchSwitch struct { Register ParentPad Value Handlers []Value DefaultUnwindTarget Value }
func (*TerminatorCatchSwitch) IsTerminator ¶
func (*TerminatorCatchSwitch) IsTerminator()
func (*TerminatorCatchSwitch) LLString ¶
func (this *TerminatorCatchSwitch) LLString() string
type TerminatorCleanupRet ¶
func (*TerminatorCleanupRet) IsTerminator ¶
func (*TerminatorCleanupRet) IsTerminator()
func (*TerminatorCleanupRet) LLString ¶
func (this *TerminatorCleanupRet) LLString() string
type TerminatorCondBr ¶
func (*TerminatorCondBr) IsTerminator ¶
func (*TerminatorCondBr) IsTerminator()
func (*TerminatorCondBr) LLString ¶
func (this *TerminatorCondBr) LLString() string
type TerminatorIndirectBr ¶
func (*TerminatorIndirectBr) IsTerminator ¶
func (*TerminatorIndirectBr) IsTerminator()
func (*TerminatorIndirectBr) LLString ¶
func (this *TerminatorIndirectBr) LLString() string
type TerminatorInvoke ¶
type TerminatorInvoke struct { Register Invokee Value Signature *TypeFunction Arguments []Value NormalTarget Value ExceptionTarget Value AddressSpace AddressSpace }
func (*TerminatorInvoke) IsTerminator ¶
func (*TerminatorInvoke) IsTerminator()
func (*TerminatorInvoke) LLString ¶
func (this *TerminatorInvoke) LLString() string
type TerminatorResume ¶
type TerminatorResume struct {
X Value
}
func (*TerminatorResume) IsTerminator ¶
func (*TerminatorResume) IsTerminator()
func (*TerminatorResume) LLString ¶
func (this *TerminatorResume) LLString() string
type TerminatorRet ¶
type TerminatorRet struct {
X Value
}
func (*TerminatorRet) IsTerminator ¶
func (*TerminatorRet) IsTerminator()
func (*TerminatorRet) LLString ¶
func (this *TerminatorRet) LLString() string
type TerminatorSwitch ¶
func (*TerminatorSwitch) IsTerminator ¶
func (*TerminatorSwitch) IsTerminator()
func (*TerminatorSwitch) LLString ¶
func (this *TerminatorSwitch) LLString() string
type TerminatorUnreachable ¶
type TerminatorUnreachable struct { }
func (*TerminatorUnreachable) IsTerminator ¶
func (*TerminatorUnreachable) IsTerminator()
func (*TerminatorUnreachable) LLString ¶
func (this *TerminatorUnreachable) LLString() string
type Type ¶
type Type interface { fmt.Stringer LLString() string Name() string SetName(name string) Equals(Type) bool }
func ReduceToBase ¶
type TypeArray ¶
type TypeArray struct { AbstractType Element Type Length uint64 }
type TypeDefined ¶
type TypeDefined struct { AbstractType Source Type }
func (*TypeDefined) Equals ¶
func (this *TypeDefined) Equals(ty Type) bool
func (*TypeDefined) LLString ¶
func (this *TypeDefined) LLString() string
func (*TypeDefined) String ¶
func (this *TypeDefined) String() string
type TypeFloat ¶
type TypeFloat struct { AbstractType Kind FloatKind }
type TypeFunction ¶
type TypeFunction struct { AbstractType Return Type Parameters []Type Variadic bool }
func (*TypeFunction) Equals ¶
func (this *TypeFunction) Equals(ty Type) bool
func (*TypeFunction) LLString ¶
func (this *TypeFunction) LLString() string
func (*TypeFunction) String ¶
func (this *TypeFunction) String() string
type TypeInt ¶
type TypeInt struct { AbstractType BitSize uint64 }
type TypeLabel ¶
type TypeLabel struct {
AbstractType
}
type TypeMMX ¶
type TypeMMX struct {
AbstractType
}
type TypeMetadata ¶
type TypeMetadata struct {
AbstractType
}
func (*TypeMetadata) Equals ¶
func (this *TypeMetadata) Equals(ty Type) bool
func (*TypeMetadata) LLString ¶
func (this *TypeMetadata) LLString() string
func (*TypeMetadata) String ¶
func (this *TypeMetadata) String() string
type TypePointer ¶
type TypePointer struct { AbstractType AddressSpace AddressSpace }
func (*TypePointer) Equals ¶
func (this *TypePointer) Equals(ty Type) bool
func (*TypePointer) LLString ¶
func (this *TypePointer) LLString() string
func (*TypePointer) String ¶
func (this *TypePointer) String() string
type TypeStruct ¶
type TypeStruct struct { AbstractType Fields []Type Packed bool Opaque bool }
func (*TypeStruct) Equals ¶
func (this *TypeStruct) Equals(ty Type) bool
func (*TypeStruct) LLString ¶
func (this *TypeStruct) LLString() string
func (*TypeStruct) String ¶
func (this *TypeStruct) String() string
type TypeToken ¶
type TypeToken struct {
AbstractType
}
type TypeVector ¶
type TypeVector struct { AbstractType Element Type Length uint64 Scalable bool }
func (*TypeVector) Equals ¶
func (this *TypeVector) Equals(ty Type) bool
func (*TypeVector) LLString ¶
func (this *TypeVector) LLString() string
func (*TypeVector) String ¶
func (this *TypeVector) String() string
type TypeVoid ¶
type TypeVoid struct {
AbstractType
}
type ValueInstruction ¶
type ValueInstruction interface { fmt.Stringer Instruction Value SetName(name string) }
Click to show internal directories.
Click to hide internal directories.