Documentation
¶
Index ¶
- Constants
- Variables
- func BindingNotFound(v string) string
- func ContAssignExtern(name string) string
- func DeleteInst(i Instruction)
- func ExternFieldError(instance, name, key, want string) string
- func GetAllKey(t Type) []string
- func GetIdByBlockSymbolTable(id string, symbolEnter *blockSymbolTable) string
- func GetMethodsName(t Type) []string
- func GetTypeStr(n Value) string
- func InsertValueReplaceOriginal(original Value, insert Value)
- func IsControlInstruction(i Instruction) bool
- func IsObjectType(t Type) bool
- func NewInstruction() anInstruction
- func NewValue() anValue
- func NoCheckMustInFirst() string
- func ReplaceAllValue(v Value, to Value)
- func ReplaceValue(v Value, to Value, skip func(Instruction) bool)
- func ReplaceValueInSymbolTable(v, to Value)
- func RunOnCoverOr[T, U Instruction](insts []U, cover func(Instruction) (T, bool), f func(T), or func(U))
- func TryGetSimilarityKey(table []string, name string) string
- func TypeCompare(t1, t2 Type) bool
- func TypeCompareEx(t1, t2 Type, depth int) bool
- type AliasType
- type Assert
- func (a *Assert) AddLeftPositions(pos *Position)
- func (a *Assert) AddLeftVariables(name string)
- func (a *Assert) GetBlock() *BasicBlock
- func (a *Assert) GetFunc() *Function
- func (a *Assert) GetLeftItem() LeftInstruction
- func (a *Assert) GetLeftPosition() *Position
- func (a *Assert) GetLeftPositions() []*Position
- func (a *Assert) GetLeftVariables() []string
- func (i *Assert) GetOpcode() Opcode
- func (a *Assert) GetOperand(i int) Value
- func (a *Assert) GetOperandNum() int
- func (a *Assert) GetOperands() Values
- func (c *Assert) GetPosition() *Position
- func (a *Assert) GetSymbolTable() *blockSymbolTable
- func (r *Assert) GetUsers() Users
- func (a *Assert) GetValues() Values
- func (a *Assert) GetVariable() string
- func (a *Assert) HasLeftVariable() bool
- func (r *Assert) HasUsers() bool
- func (a *Assert) HasValues() bool
- func (c *Assert) IsExtern() bool
- func (a *Assert) LineDisasm() string
- func (c *Assert) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (a *Assert) ReplaceValue(v, to Value)
- func (a *Assert) SetBlock(block *BasicBlock)
- func (c *Assert) SetExtern(b bool)
- func (a *Assert) SetFunc(f *Function)
- func (c *Assert) SetPosition(pos *Position)
- func (a *Assert) SetSymbolTable(symbol *blockSymbolTable)
- func (a *Assert) SetVariable(v string)
- func (a *Assert) String() string
- type BasicBlock
- func (a *BasicBlock) AddLeftPositions(pos *Position)
- func (a *BasicBlock) AddLeftVariables(name string)
- func (b *BasicBlock) AddSucc(succ *BasicBlock)
- func (n *BasicBlock) AddUser(u User)
- func (b *BasicBlock) EmitInst(i Instruction)
- func (a *BasicBlock) GetBlock() *BasicBlock
- func (b *BasicBlock) GetBlockById(name string) *BasicBlock
- func (a *BasicBlock) GetFunc() *Function
- func (a *BasicBlock) GetLeftItem() LeftInstruction
- func (a *BasicBlock) GetLeftPosition() *Position
- func (a *BasicBlock) GetLeftPositions() []*Position
- func (a *BasicBlock) GetLeftVariables() []string
- func (i *BasicBlock) GetOpcode() Opcode
- func (a *BasicBlock) GetOperand(i int) Value
- func (a *BasicBlock) GetOperandNum() int
- func (a *BasicBlock) GetOperands() Values
- func (c *BasicBlock) GetPosition() *Position
- func (a *BasicBlock) GetSymbolTable() *blockSymbolTable
- func (b *BasicBlock) GetType() Type
- func (n *BasicBlock) GetUsers() Users
- func (b *BasicBlock) GetValues() Values
- func (a *BasicBlock) GetVariable() string
- func (a *BasicBlock) HasLeftVariable() bool
- func (n *BasicBlock) HasUsers() bool
- func (b *BasicBlock) HasValues() bool
- func (b *BasicBlock) IsBlock(name string) bool
- func (c *BasicBlock) IsExtern() bool
- func (b *BasicBlock) LastInst() Instruction
- func (b *BasicBlock) LineDisasm() string
- func (c *BasicBlock) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (b *BasicBlock) Reachable() int
- func (n *BasicBlock) RemoveUser(u User)
- func (b *BasicBlock) Sealed()
- func (a *BasicBlock) SetBlock(block *BasicBlock)
- func (c *BasicBlock) SetExtern(b bool)
- func (a *BasicBlock) SetFunc(f *Function)
- func (c *BasicBlock) SetPosition(pos *Position)
- func (a *BasicBlock) SetSymbolTable(symbol *blockSymbolTable)
- func (b *BasicBlock) SetType(ts Type)
- func (a *BasicBlock) SetVariable(v string)
- func (b *BasicBlock) String() string
- type BasicType
- type BinOp
- func (a *BinOp) AddLeftPositions(pos *Position)
- func (a *BinOp) AddLeftVariables(name string)
- func (n *BinOp) AddUser(u User)
- func (a *BinOp) GetBlock() *BasicBlock
- func (a *BinOp) GetFunc() *Function
- func (a *BinOp) GetLeftItem() LeftInstruction
- func (a *BinOp) GetLeftPosition() *Position
- func (a *BinOp) GetLeftPositions() []*Position
- func (a *BinOp) GetLeftVariables() []string
- func (i *BinOp) GetOpcode() Opcode
- func (a *BinOp) GetOperand(i int) Value
- func (a *BinOp) GetOperandNum() int
- func (a *BinOp) GetOperands() Values
- func (c *BinOp) GetPosition() *Position
- func (a *BinOp) GetSymbolTable() *blockSymbolTable
- func (n *BinOp) GetType() Type
- func (n *BinOp) GetUsers() Users
- func (b *BinOp) GetValues() Values
- func (a *BinOp) GetVariable() string
- func (a *BinOp) HasLeftVariable() bool
- func (n *BinOp) HasUsers() bool
- func (b *BinOp) HasValues() bool
- func (c *BinOp) IsExtern() bool
- func (b *BinOp) LineDisasm() string
- func (c *BinOp) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *BinOp) RemoveUser(u User)
- func (b *BinOp) ReplaceValue(v Value, to Value)
- func (a *BinOp) SetBlock(block *BasicBlock)
- func (c *BinOp) SetExtern(b bool)
- func (a *BinOp) SetFunc(f *Function)
- func (c *BinOp) SetPosition(pos *Position)
- func (a *BinOp) SetSymbolTable(symbol *blockSymbolTable)
- func (n *BinOp) SetType(typ Type)
- func (a *BinOp) SetVariable(v string)
- func (b *BinOp) String() string
- type BinaryOpcode
- type Builder
- type Call
- func (a *Call) AddLeftPositions(pos *Position)
- func (a *Call) AddLeftVariables(name string)
- func (n *Call) AddUser(u User)
- func (a *Call) GetBlock() *BasicBlock
- func (a *Call) GetFunc() *Function
- func (a *Call) GetLeftItem() LeftInstruction
- func (a *Call) GetLeftPosition() *Position
- func (a *Call) GetLeftPositions() []*Position
- func (a *Call) GetLeftVariables() []string
- func (i *Call) GetOpcode() Opcode
- func (a *Call) GetOperand(i int) Value
- func (a *Call) GetOperandNum() int
- func (a *Call) GetOperands() Values
- func (c *Call) GetPosition() *Position
- func (a *Call) GetSymbolTable() *blockSymbolTable
- func (n *Call) GetType() Type
- func (n *Call) GetUsers() Users
- func (c *Call) GetValues() Values
- func (a *Call) GetVariable() string
- func (c *Call) HandleFreeValue(fvs []string, sideEffect []string)
- func (a *Call) HasLeftVariable() bool
- func (n *Call) HasUsers() bool
- func (c *Call) HasValues() bool
- func (c *Call) IsExtern() bool
- func (c *Call) LineDisasm() string
- func (c *Call) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Call) RemoveUser(u User)
- func (c *Call) ReplaceValue(v Value, to Value)
- func (a *Call) SetBlock(block *BasicBlock)
- func (c *Call) SetExtern(b bool)
- func (a *Call) SetFunc(f *Function)
- func (c *Call) SetPosition(pos *Position)
- func (a *Call) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Call) SetType(typ Type)
- func (a *Call) SetVariable(v string)
- func (c *Call) String() string
- type ChanType
- type Const
- func (c *Const) Boolean() bool
- func (c *Const) Float() float64
- func (c *Const) GetRawValue() any
- func (c *Const) GetType() Type
- func (c *Const) GetTypeKind() TypeKind
- func (c *Const) IsBoolean() bool
- func (c *Const) IsFloat() bool
- func (c *Const) IsNumber() bool
- func (c *Const) IsString() bool
- func (c *Const) Number() int64
- func (c *Const) SetType(ts Type)
- func (c Const) String() string
- func (c *Const) VarString() string
- type ConstInst
- func CalcConstBinary(x, y *ConstInst, op BinaryOpcode) *ConstInst
- func CalcConstUnary(x *ConstInst, op UnaryOpcode) *ConstInst
- func NewAny() *ConstInst
- func NewConst(i any) *ConstInst
- func NewConstInst(c *Const) *ConstInst
- func NewConstWithUnary(i any, un int) *ConstInst
- func NewNil() *ConstInst
- func ToConst(v Instruction) (*ConstInst, bool)
- func (a *ConstInst) AddLeftPositions(pos *Position)
- func (a *ConstInst) AddLeftVariables(name string)
- func (n *ConstInst) AddUser(u User)
- func (a *ConstInst) GetBlock() *BasicBlock
- func (a *ConstInst) GetFunc() *Function
- func (a *ConstInst) GetLeftItem() LeftInstruction
- func (a *ConstInst) GetLeftPosition() *Position
- func (a *ConstInst) GetLeftPositions() []*Position
- func (a *ConstInst) GetLeftVariables() []string
- func (i *ConstInst) GetOpcode() Opcode
- func (a *ConstInst) GetOperand(i int) Value
- func (a *ConstInst) GetOperandNum() int
- func (a *ConstInst) GetOperands() Values
- func (c *ConstInst) GetPosition() *Position
- func (a *ConstInst) GetSymbolTable() *blockSymbolTable
- func (c *ConstInst) GetType() Type
- func (n *ConstInst) GetUsers() Users
- func (c *ConstInst) GetValues() Values
- func (a *ConstInst) GetVariable() string
- func (a *ConstInst) HasLeftVariable() bool
- func (n *ConstInst) HasUsers() bool
- func (c *ConstInst) HasValues() bool
- func (c *ConstInst) IsExtern() bool
- func (c *ConstInst) LineDisasm() string
- func (c *ConstInst) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *ConstInst) RemoveUser(u User)
- func (a *ConstInst) SetBlock(block *BasicBlock)
- func (c *ConstInst) SetExtern(b bool)
- func (a *ConstInst) SetFunc(f *Function)
- func (c *ConstInst) SetPosition(pos *Position)
- func (a *ConstInst) SetSymbolTable(symbol *blockSymbolTable)
- func (c *ConstInst) SetType(ts Type)
- func (a *ConstInst) SetVariable(v string)
- func (c *ConstInst) String() string
- type ErrorComment
- type ErrorCommentId
- type ErrorHandler
- func (e *ErrorHandler) AddDone(d *BasicBlock)
- func (e *ErrorHandler) AddFinal(f *BasicBlock)
- func (a *ErrorHandler) AddLeftPositions(pos *Position)
- func (a *ErrorHandler) AddLeftVariables(name string)
- func (a *ErrorHandler) GetBlock() *BasicBlock
- func (a *ErrorHandler) GetFunc() *Function
- func (a *ErrorHandler) GetLeftItem() LeftInstruction
- func (a *ErrorHandler) GetLeftPosition() *Position
- func (a *ErrorHandler) GetLeftPositions() []*Position
- func (a *ErrorHandler) GetLeftVariables() []string
- func (i *ErrorHandler) GetOpcode() Opcode
- func (a *ErrorHandler) GetOperand(i int) Value
- func (a *ErrorHandler) GetOperandNum() int
- func (a *ErrorHandler) GetOperands() Values
- func (c *ErrorHandler) GetPosition() *Position
- func (a *ErrorHandler) GetSymbolTable() *blockSymbolTable
- func (a *ErrorHandler) GetVariable() string
- func (a *ErrorHandler) HasLeftVariable() bool
- func (c *ErrorHandler) IsExtern() bool
- func (p *ErrorHandler) LineDisasm() string
- func (c *ErrorHandler) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (a *ErrorHandler) SetBlock(block *BasicBlock)
- func (c *ErrorHandler) SetExtern(b bool)
- func (a *ErrorHandler) SetFunc(f *Function)
- func (c *ErrorHandler) SetPosition(pos *Position)
- func (a *ErrorHandler) SetSymbolTable(symbol *blockSymbolTable)
- func (a *ErrorHandler) SetVariable(v string)
- func (e *ErrorHandler) String() string
- type ErrorKind
- type ErrorLogger
- type ErrorTag
- type Field
- func (a *Field) AddLeftPositions(pos *Position)
- func (a *Field) AddLeftVariables(name string)
- func (n *Field) AddUser(u User)
- func (field *Field) Assign(v Value, f *FunctionBuilder)
- func (a *Field) GetBlock() *BasicBlock
- func (a *Field) GetFunc() *Function
- func (a *Field) GetLeftItem() LeftInstruction
- func (a *Field) GetLeftPosition() *Position
- func (a *Field) GetLeftPositions() []*Position
- func (a *Field) GetLeftVariables() []string
- func (i *Field) GetOpcode() Opcode
- func (a *Field) GetOperand(i int) Value
- func (a *Field) GetOperandNum() int
- func (a *Field) GetOperands() Values
- func (c *Field) GetPosition() *Position
- func (a *Field) GetSymbolTable() *blockSymbolTable
- func (n *Field) GetType() Type
- func (n *Field) GetUsers() Users
- func (f *Field) GetValue(_ *FunctionBuilder) Value
- func (f *Field) GetValues() Values
- func (a *Field) GetVariable() string
- func (a *Field) HasLeftVariable() bool
- func (n *Field) HasUsers() bool
- func (f *Field) HasValues() bool
- func (c *Field) IsExtern() bool
- func (f *Field) LineDisasm() string
- func (c *Field) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Field) RemoveUser(u User)
- func (f *Field) ReplaceValue(v, to Value)
- func (a *Field) SetBlock(block *BasicBlock)
- func (c *Field) SetExtern(b bool)
- func (a *Field) SetFunc(f *Function)
- func (c *Field) SetPosition(pos *Position)
- func (a *Field) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Field) SetType(typ Type)
- func (a *Field) SetVariable(v string)
- func (f *Field) String() string
- type Function
- func (f *Function) AddErrorComment(str string, line int) error
- func (a *Function) AddLeftPositions(pos *Position)
- func (a *Function) AddLeftVariables(name string)
- func (f *Function) AddSideEffect(name string, v Value)
- func (n *Function) AddUser(u User)
- func (f *Function) DisAsm(flag FunctionAsmFlag) string
- func (f *Function) Finish()
- func (a *Function) GetBlock() *BasicBlock
- func (f *Function) GetDeferBlock() *BasicBlock
- func (a *Function) GetFunc() *Function
- func (a *Function) GetLeftItem() LeftInstruction
- func (a *Function) GetLeftPosition() *Position
- func (a *Function) GetLeftPositions() []*Position
- func (a *Function) GetLeftVariables() []string
- func (i *Function) GetOpcode() Opcode
- func (a *Function) GetOperand(i int) Value
- func (a *Function) GetOperandNum() int
- func (a *Function) GetOperands() Values
- func (f *Function) GetParent() *Function
- func (c *Function) GetPosition() *Position
- func (f *Function) GetSymbol() *Make
- func (a *Function) GetSymbolTable() *blockSymbolTable
- func (n *Function) GetType() Type
- func (n *Function) GetUsers() Users
- func (f *Function) GetValues() Values
- func (f *Function) GetValuesByName(name string) InstructionNodes
- func (a *Function) GetVariable() string
- func (a *Function) HasLeftVariable() bool
- func (n *Function) HasUsers() bool
- func (f *Function) HasValues() bool
- func (f *Function) InspectVariable(varName string) *InspectVariableResult
- func (c *Function) IsExtern() bool
- func (f *Function) IsMain() bool
- func (f *Function) LineDisasm() string
- func (f *Function) NewBasicBlock(name string) *BasicBlock
- func (f *Function) NewBasicBlockNotAddBlocks(name string) *BasicBlock
- func (f *Function) NewBasicBlockNotAddUnSealed(name string) *BasicBlock
- func (f *Function) NewBasicBlockUnSealed(name string) *BasicBlock
- func (c *Function) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (f *Function) NewErrorWithPos(kind ErrorKind, tag ErrorTag, Pos *Position, message string)
- func (f *Function) NewParam(name string) *Parameter
- func (n *Function) RemoveUser(u User)
- func (b *Function) ReplaceVariable(variable string, v, to Value)
- func (f *Function) ReturnValue() []Value
- func (a *Function) SetBlock(block *BasicBlock)
- func (c *Function) SetExtern(b bool)
- func (a *Function) SetFunc(f *Function)
- func (c *Function) SetPosition(pos *Position)
- func (f *Function) SetReg(i Instruction)
- func (a *Function) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Function) SetType(typ Type)
- func (a *Function) SetVariable(v string)
- func (f *Function) String() string
- type FunctionAsmFlag
- type FunctionBuilder
- func (b *FunctionBuilder) AddDefer(call *Call)
- func (b *FunctionBuilder) AddLabel(name string, block *BasicBlock)
- func (a FunctionBuilder) AddLeftPositions(pos *Position)
- func (a FunctionBuilder) AddLeftVariables(name string)
- func (b *FunctionBuilder) AddSubFunction(builder func())
- func (b *FunctionBuilder) AddToCmap(key string)
- func (b *FunctionBuilder) AddToLmap(key string)
- func (b *FunctionBuilder) AddUnsealedBlock(block *BasicBlock)
- func (n FunctionBuilder) AddUser(u User)
- func (b *FunctionBuilder) BuildFreeValue(variable string) Value
- func (b *FunctionBuilder) BuildIf() *IfBuilder
- func (b *FunctionBuilder) BuildLoop() *LoopBuilder
- func (b *FunctionBuilder) BuildSwitch() *SwitchBuilder
- func (b *FunctionBuilder) BuildTry() *TryBuilder
- func (b *FunctionBuilder) BuildValueFromAny(id string, v any) (value Value)
- func (b *FunctionBuilder) CanBuildFreeValue(variable string) bool
- func (f *FunctionBuilder) CoverReflectFunctionType(itype reflect.Type, level int) *FunctionType
- func (b *FunctionBuilder) CreateInterfaceWithVs(keys []Value, vs []Value) *Make
- func (b *FunctionBuilder) DeleteLabel(name string)
- func (f *FunctionBuilder) EmitAssert(cond, msgValue Value, msg string) *Assert
- func (f *FunctionBuilder) EmitBinOp(op BinaryOpcode, x, y Value) Value
- func (f *FunctionBuilder) EmitCall(c *Call) *Call
- func (f *FunctionBuilder) EmitConstInst(i any) *ConstInst
- func (f *FunctionBuilder) EmitConstInstAny() *ConstInst
- func (f *FunctionBuilder) EmitConstInstNil() *ConstInst
- func (f *FunctionBuilder) EmitConstInstWithUnary(i any, un int) *ConstInst
- func (f *FunctionBuilder) EmitErrorHandler(try, catch *BasicBlock) *ErrorHandler
- func (f *FunctionBuilder) EmitField(i, key Value) Value
- func (f *FunctionBuilder) EmitFieldMust(i, key Value) *Field
- func (f *FunctionBuilder) EmitIf(cond Value) *If
- func (f *FunctionBuilder) EmitInstructionAfter(i, after Instruction)
- func (f *FunctionBuilder) EmitInstructionBefore(i, before Instruction)
- func (f *FunctionBuilder) EmitJump(to *BasicBlock) *Jump
- func (f *FunctionBuilder) EmitLoop(body, exit *BasicBlock, cond Value) *Loop
- func (f *FunctionBuilder) EmitMakeBuildWithType(typ Type, Len, Cap Value) *Make
- func (f *FunctionBuilder) EmitMakeSlice(i Value, low, high, max Value) *Make
- func (f *FunctionBuilder) EmitMakeWithoutType(Len, Cap Value) *Make
- func (f *FunctionBuilder) EmitNext(iter Value, isIn bool) (key, field, ok Value)
- func (f *FunctionBuilder) EmitNextOnly(iter Value, isIn bool) *Next
- func (f *FunctionBuilder) EmitOnly(i Instruction)
- func (f *FunctionBuilder) EmitPanic(info Value) *Panic
- func (f *FunctionBuilder) EmitRecover() *Recover
- func (f *FunctionBuilder) EmitReturn(vs []Value) *Return
- func (f *FunctionBuilder) EmitSwitch(cond Value, defaultb *BasicBlock, label []SwitchLabel) *Switch
- func (f *FunctionBuilder) EmitToBlock(i Instruction, block *BasicBlock)
- func (f *FunctionBuilder) EmitTypeCast(v Value, typ Type) *TypeCast
- func (f *FunctionBuilder) EmitTypeValue(typ Type) *TypeValue
- func (f *FunctionBuilder) EmitUnOp(op UnaryOpcode, v Value) Value
- func (f *FunctionBuilder) EmitUndefine(name string) *Undefined
- func (f *FunctionBuilder) EmitUpdate(address, v Value) *Update
- func (b *FunctionBuilder) Finish()
- func (a FunctionBuilder) GetBlock() *BasicBlock
- func (b *FunctionBuilder) GetBreak() *BasicBlock
- func (b *FunctionBuilder) GetContinue() *BasicBlock
- func (b *FunctionBuilder) GetFallthrough() *BasicBlock
- func (b *FunctionBuilder) GetFromCmap(key string) bool
- func (b *FunctionBuilder) GetFromLmap(key string) bool
- func (a FunctionBuilder) GetFunc() *Function
- func (b *FunctionBuilder) GetIdByBlockSymbolTable(id string) string
- func (b *FunctionBuilder) GetLabel(name string) *BasicBlock
- func (a FunctionBuilder) GetLeftItem() LeftInstruction
- func (a FunctionBuilder) GetLeftPosition() *Position
- func (a FunctionBuilder) GetLeftPositions() []*Position
- func (a FunctionBuilder) GetLeftVariables() []string
- func (a FunctionBuilder) GetOperand(i int) Value
- func (a FunctionBuilder) GetOperandNum() int
- func (a FunctionBuilder) GetOperands() Values
- func (b FunctionBuilder) GetParentBuilder() *FunctionBuilder
- func (c FunctionBuilder) GetPosition() *Position
- func (a FunctionBuilder) GetSymbolTable() *blockSymbolTable
- func (n FunctionBuilder) GetType() Type
- func (n FunctionBuilder) GetUsers() Users
- func (a FunctionBuilder) GetVariable() string
- func (b FunctionBuilder) HandlerEllipsis()
- func (a FunctionBuilder) HasLeftVariable() bool
- func (n FunctionBuilder) HasUsers() bool
- func (c FunctionBuilder) IsExtern() bool
- func (b *FunctionBuilder) MapBlockSymbolTable(text string) string
- func (b *FunctionBuilder) NewBlockId() string
- func (f *FunctionBuilder) NewCall(target Value, args []Value) *Call
- func (b *FunctionBuilder) NewError(kind ErrorKind, tag ErrorTag, format string, arg ...any)
- func (b *FunctionBuilder) NewFunc(name string) (*Function, *blockSymbolTable)
- func (b *FunctionBuilder) PopBlockSymbolTable()
- func (b *FunctionBuilder) PopFunction() *FunctionBuilder
- func (b *FunctionBuilder) PopTarget() bool
- func (b *FunctionBuilder) PushBlockSymbolTable()
- func (b *FunctionBuilder) PushFunction(newFunc *Function, symbol *blockSymbolTable, block *BasicBlock) *FunctionBuilder
- func (b *FunctionBuilder) PushTarget(_break, _continue, _fallthrough *BasicBlock)
- func (b *FunctionBuilder) ReadVariable(variable string, create bool) Value
- func (b *FunctionBuilder) ReadVariableBefore(variable string, create bool, before Instruction) Value
- func (b *FunctionBuilder) ReadVariableEx(variable string, create bool, fun func([]Value))
- func (n FunctionBuilder) RemoveUser(u User)
- func (a FunctionBuilder) SetBlock(block *BasicBlock)
- func (f *FunctionBuilder) SetCurrent(i Instruction) func()
- func (c FunctionBuilder) SetExtern(b bool)
- func (a FunctionBuilder) SetFunc(f *Function)
- func (f *FunctionBuilder) SetInstructionPosition(i Instruction)
- func (b *FunctionBuilder) SetPosition(pos *Position) *Position
- func (a FunctionBuilder) SetSymbolTable(symbol *blockSymbolTable)
- func (n FunctionBuilder) SetType(typ Type)
- func (a FunctionBuilder) SetVariable(v string)
- func (b *FunctionBuilder) TryBuildExternValue(id string) Value
- func (b *FunctionBuilder) TryGetSimilarityKey(name, key string) string
- func (b *FunctionBuilder) WithExternLib(lib map[string]map[string]any)
- func (b *FunctionBuilder) WithExternMethod(builder MethodBuilder)
- func (b *FunctionBuilder) WithExternValue(vs map[string]any)
- func (f *FunctionBuilder) WriteVariable(variable string, value Value)
- type FunctionType
- func GetMethod(t Type, id string) *FunctionType
- func NewFunctionType(name string, Parameter []Type, ReturnType Type, IsVariadic bool) *FunctionType
- func NewFunctionTypeDefine(name string, Parameter []Type, ReturnType []Type, IsVariadic bool) *FunctionType
- func ToFunctionType(t Type) (*FunctionType, bool)
- func (b *FunctionType) AddMethod(id string, f *FunctionType)
- func (f *FunctionType) GetMethod() map[string]*FunctionType
- func (s *FunctionType) GetParamString() string
- func (s *FunctionType) GetTypeKind() TypeKind
- func (s *FunctionType) RawString() string
- func (s *FunctionType) SetFreeValue(fv []string)
- func (f *FunctionType) SetMethod(m map[string]*FunctionType)
- func (f *FunctionType) SetModifySelf(b bool)
- func (s *FunctionType) SetName(name string)
- func (s *FunctionType) SetSideEffect(se []string)
- func (s *FunctionType) String() string
- type IdentifierLV
- type If
- func (i *If) AddFalse(f *BasicBlock)
- func (a *If) AddLeftPositions(pos *Position)
- func (a *If) AddLeftVariables(name string)
- func (i *If) AddTrue(t *BasicBlock)
- func (a *If) GetBlock() *BasicBlock
- func (a *If) GetFunc() *Function
- func (a *If) GetLeftItem() LeftInstruction
- func (a *If) GetLeftPosition() *Position
- func (a *If) GetLeftPositions() []*Position
- func (a *If) GetLeftVariables() []string
- func (i *If) GetOpcode() Opcode
- func (a *If) GetOperand(i int) Value
- func (a *If) GetOperandNum() int
- func (a *If) GetOperands() Values
- func (c *If) GetPosition() *Position
- func (a *If) GetSymbolTable() *blockSymbolTable
- func (r *If) GetUsers() Users
- func (i *If) GetValues() Values
- func (a *If) GetVariable() string
- func (a *If) HasLeftVariable() bool
- func (r *If) HasUsers() bool
- func (i *If) HasValues() bool
- func (c *If) IsExtern() bool
- func (i *If) LineDisasm() string
- func (c *If) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (i *If) ReplaceValue(v Value, to Value)
- func (a *If) SetBlock(block *BasicBlock)
- func (c *If) SetExtern(b bool)
- func (a *If) SetFunc(f *Function)
- func (c *If) SetPosition(pos *Position)
- func (a *If) SetSymbolTable(symbol *blockSymbolTable)
- func (a *If) SetVariable(v string)
- func (i *If) String() string
- type IfBuilder
- type InspectVariableResult
- type Instruction
- type InstructionNode
- type InstructionNodes
- type InterfaceType
- func (b *InterfaceType) AddMethod(id string, f *FunctionType)
- func (i *InterfaceType) GetMethod() map[string]*FunctionType
- func (i *InterfaceType) GetTypeKind() TypeKind
- func (i *InterfaceType) RawString() string
- func (i *InterfaceType) SetMethod(m map[string]*FunctionType)
- func (i *InterfaceType) String() string
- type Jump
- func (a *Jump) AddLeftPositions(pos *Position)
- func (a *Jump) AddLeftVariables(name string)
- func (a *Jump) GetBlock() *BasicBlock
- func (a *Jump) GetFunc() *Function
- func (a *Jump) GetLeftItem() LeftInstruction
- func (a *Jump) GetLeftPosition() *Position
- func (a *Jump) GetLeftPositions() []*Position
- func (a *Jump) GetLeftVariables() []string
- func (i *Jump) GetOpcode() Opcode
- func (a *Jump) GetOperand(i int) Value
- func (a *Jump) GetOperandNum() int
- func (a *Jump) GetOperands() Values
- func (c *Jump) GetPosition() *Position
- func (a *Jump) GetSymbolTable() *blockSymbolTable
- func (a *Jump) GetVariable() string
- func (a *Jump) HasLeftVariable() bool
- func (c *Jump) IsExtern() bool
- func (p *Jump) LineDisasm() string
- func (c *Jump) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (a *Jump) SetBlock(block *BasicBlock)
- func (c *Jump) SetExtern(b bool)
- func (a *Jump) SetFunc(f *Function)
- func (c *Jump) SetPosition(pos *Position)
- func (a *Jump) SetSymbolTable(symbol *blockSymbolTable)
- func (a *Jump) SetVariable(v string)
- func (j *Jump) String() string
- type LeftInstruction
- type LeftValue
- type Loop
- func (a *Loop) AddLeftPositions(pos *Position)
- func (a *Loop) AddLeftVariables(name string)
- func (l *Loop) Finish(init, step []Value)
- func (a *Loop) GetBlock() *BasicBlock
- func (a *Loop) GetFunc() *Function
- func (a *Loop) GetLeftItem() LeftInstruction
- func (a *Loop) GetLeftPosition() *Position
- func (a *Loop) GetLeftPositions() []*Position
- func (a *Loop) GetLeftVariables() []string
- func (i *Loop) GetOpcode() Opcode
- func (a *Loop) GetOperand(i int) Value
- func (a *Loop) GetOperandNum() int
- func (a *Loop) GetOperands() Values
- func (c *Loop) GetPosition() *Position
- func (a *Loop) GetSymbolTable() *blockSymbolTable
- func (r *Loop) GetUsers() Users
- func (l *Loop) GetValues() Values
- func (a *Loop) GetVariable() string
- func (a *Loop) HasLeftVariable() bool
- func (r *Loop) HasUsers() bool
- func (l *Loop) HasValues() bool
- func (c *Loop) IsExtern() bool
- func (l *Loop) LineDisasm() string
- func (c *Loop) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (l *Loop) ReplaceValue(v Value, to Value)
- func (a *Loop) SetBlock(block *BasicBlock)
- func (c *Loop) SetExtern(b bool)
- func (a *Loop) SetFunc(f *Function)
- func (c *Loop) SetPosition(pos *Position)
- func (a *Loop) SetSymbolTable(symbol *blockSymbolTable)
- func (a *Loop) SetVariable(v string)
- func (l *Loop) String() string
- type LoopBuilder
- type Make
- func (a *Make) AddLeftPositions(pos *Position)
- func (a *Make) AddLeftVariables(name string)
- func (n *Make) AddUser(u User)
- func (a *Make) GetBlock() *BasicBlock
- func (a *Make) GetFunc() *Function
- func (a *Make) GetLeftItem() LeftInstruction
- func (a *Make) GetLeftPosition() *Position
- func (a *Make) GetLeftPositions() []*Position
- func (a *Make) GetLeftVariables() []string
- func (i *Make) GetOpcode() Opcode
- func (a *Make) GetOperand(i int) Value
- func (a *Make) GetOperandNum() int
- func (a *Make) GetOperands() Values
- func (c *Make) GetPosition() *Position
- func (a *Make) GetSymbolTable() *blockSymbolTable
- func (n *Make) GetType() Type
- func (n *Make) GetUsers() Users
- func (i *Make) GetValues() Values
- func (a *Make) GetVariable() string
- func (a *Make) HasLeftVariable() bool
- func (n *Make) HasUsers() bool
- func (i *Make) HasValues() bool
- func (c *Make) IsExtern() bool
- func (m *Make) LineDisasm() string
- func (c *Make) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Make) RemoveUser(u User)
- func (i *Make) ReplaceValue(v, to Value)
- func (a *Make) SetBlock(block *BasicBlock)
- func (c *Make) SetExtern(b bool)
- func (a *Make) SetFunc(f *Function)
- func (c *Make) SetPosition(pos *Position)
- func (a *Make) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Make) SetType(typ Type)
- func (a *Make) SetVariable(v string)
- func (i *Make) String() string
- type MethodBuilder
- type Next
- func (a *Next) AddLeftPositions(pos *Position)
- func (a *Next) AddLeftVariables(name string)
- func (n *Next) AddUser(u User)
- func (a *Next) GetBlock() *BasicBlock
- func (a *Next) GetFunc() *Function
- func (a *Next) GetLeftItem() LeftInstruction
- func (a *Next) GetLeftPosition() *Position
- func (a *Next) GetLeftPositions() []*Position
- func (a *Next) GetLeftVariables() []string
- func (i *Next) GetOpcode() Opcode
- func (a *Next) GetOperand(i int) Value
- func (a *Next) GetOperandNum() int
- func (a *Next) GetOperands() Values
- func (c *Next) GetPosition() *Position
- func (a *Next) GetSymbolTable() *blockSymbolTable
- func (n *Next) GetType() Type
- func (n *Next) GetUsers() Users
- func (n *Next) GetValues() Values
- func (a *Next) GetVariable() string
- func (a *Next) HasLeftVariable() bool
- func (n *Next) HasUsers() bool
- func (n *Next) HasValues() bool
- func (c *Next) IsExtern() bool
- func (u *Next) LineDisasm() string
- func (c *Next) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Next) RemoveUser(u User)
- func (n *Next) ReplaceValue(v, to Value)
- func (a *Next) SetBlock(block *BasicBlock)
- func (c *Next) SetExtern(b bool)
- func (a *Next) SetFunc(f *Function)
- func (c *Next) SetPosition(pos *Position)
- func (a *Next) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Next) SetType(typ Type)
- func (a *Next) SetVariable(v string)
- func (n *Next) String() string
- type Node
- type ObjectType
- func (s *ObjectType) AddField(key Value, field Type)
- func (b *ObjectType) AddMethod(id string, f *FunctionType)
- func (s *ObjectType) Finish()
- func (s *ObjectType) GetField(key Value) Type
- func (i *ObjectType) GetMethod() map[string]*FunctionType
- func (i *ObjectType) GetTypeKind() TypeKind
- func (itype ObjectType) RawString() string
- func (i *ObjectType) SetMethod(m map[string]*FunctionType)
- func (i *ObjectType) SetName(name string)
- func (itype ObjectType) String() string
- type Opcode
- type Package
- type Panic
- func (a *Panic) AddLeftPositions(pos *Position)
- func (a *Panic) AddLeftVariables(name string)
- func (n *Panic) AddUser(u User)
- func (a *Panic) GetBlock() *BasicBlock
- func (a *Panic) GetFunc() *Function
- func (a *Panic) GetLeftItem() LeftInstruction
- func (a *Panic) GetLeftPosition() *Position
- func (a *Panic) GetLeftPositions() []*Position
- func (a *Panic) GetLeftVariables() []string
- func (i *Panic) GetOpcode() Opcode
- func (a *Panic) GetOperand(i int) Value
- func (a *Panic) GetOperandNum() int
- func (a *Panic) GetOperands() Values
- func (c *Panic) GetPosition() *Position
- func (a *Panic) GetSymbolTable() *blockSymbolTable
- func (n *Panic) GetType() Type
- func (n *Panic) GetUsers() Users
- func (p *Panic) GetValues() Values
- func (a *Panic) GetVariable() string
- func (a *Panic) HasLeftVariable() bool
- func (n *Panic) HasUsers() bool
- func (p *Panic) HasValues() bool
- func (c *Panic) IsExtern() bool
- func (p *Panic) LineDisasm() string
- func (c *Panic) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Panic) RemoveUser(u User)
- func (p *Panic) ReplaceValue(v, to Value)
- func (a *Panic) SetBlock(block *BasicBlock)
- func (c *Panic) SetExtern(b bool)
- func (a *Panic) SetFunc(f *Function)
- func (c *Panic) SetPosition(pos *Position)
- func (a *Panic) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Panic) SetType(typ Type)
- func (a *Panic) SetVariable(v string)
- func (p *Panic) String() string
- type Parameter
- func (a *Parameter) AddLeftPositions(pos *Position)
- func (a *Parameter) AddLeftVariables(name string)
- func (n *Parameter) AddUser(u User)
- func (a *Parameter) GetBlock() *BasicBlock
- func (a *Parameter) GetFunc() *Function
- func (a *Parameter) GetLeftItem() LeftInstruction
- func (a *Parameter) GetLeftPosition() *Position
- func (a *Parameter) GetLeftPositions() []*Position
- func (a *Parameter) GetLeftVariables() []string
- func (i *Parameter) GetOpcode() Opcode
- func (a *Parameter) GetOperand(i int) Value
- func (a *Parameter) GetOperandNum() int
- func (a *Parameter) GetOperands() Values
- func (c *Parameter) GetPosition() *Position
- func (a *Parameter) GetSymbolTable() *blockSymbolTable
- func (n *Parameter) GetType() Type
- func (n *Parameter) GetUsers() Users
- func (p *Parameter) GetValues() Values
- func (a *Parameter) GetVariable() string
- func (a *Parameter) HasLeftVariable() bool
- func (n *Parameter) HasUsers() bool
- func (p *Parameter) HasValues() bool
- func (c *Parameter) IsExtern() bool
- func (p *Parameter) LineDisasm() string
- func (c *Parameter) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Parameter) RemoveUser(u User)
- func (a *Parameter) SetBlock(block *BasicBlock)
- func (p *Parameter) SetDefault(v Value)
- func (c *Parameter) SetExtern(b bool)
- func (a *Parameter) SetFunc(f *Function)
- func (c *Parameter) SetPosition(pos *Position)
- func (a *Parameter) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Parameter) SetType(typ Type)
- func (a *Parameter) SetVariable(v string)
- func (p *Parameter) String() string
- type Phi
- func (p *Phi) AddEdge(v Value)
- func (a *Phi) AddLeftPositions(pos *Position)
- func (a *Phi) AddLeftVariables(name string)
- func (n *Phi) AddUser(u User)
- func (phi *Phi) Build() Value
- func (a *Phi) GetBlock() *BasicBlock
- func (a *Phi) GetFunc() *Function
- func (a *Phi) GetLeftItem() LeftInstruction
- func (a *Phi) GetLeftPosition() *Position
- func (a *Phi) GetLeftPositions() []*Position
- func (a *Phi) GetLeftVariables() []string
- func (i *Phi) GetOpcode() Opcode
- func (a *Phi) GetOperand(i int) Value
- func (a *Phi) GetOperandNum() int
- func (a *Phi) GetOperands() Values
- func (c *Phi) GetPosition() *Position
- func (a *Phi) GetSymbolTable() *blockSymbolTable
- func (n *Phi) GetType() Type
- func (n *Phi) GetUsers() Users
- func (p *Phi) GetValues() Values
- func (a *Phi) GetVariable() string
- func (a *Phi) HasLeftVariable() bool
- func (n *Phi) HasUsers() bool
- func (p *Phi) HasValues() bool
- func (c *Phi) IsExtern() bool
- func (p *Phi) LineDisasm() string
- func (phi *Phi) Name() string
- func (c *Phi) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Phi) RemoveUser(u User)
- func (phi *Phi) Replace(to Value)
- func (p *Phi) ReplaceValue(v Value, to Value)
- func (a *Phi) SetBlock(block *BasicBlock)
- func (c *Phi) SetExtern(b bool)
- func (a *Phi) SetFunc(f *Function)
- func (c *Phi) SetPosition(pos *Position)
- func (a *Phi) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Phi) SetType(typ Type)
- func (a *Phi) SetVariable(v string)
- func (p *Phi) String() string
- type Position
- type Program
- func (prog *Program) AddPackage(pkg *Package)
- func (prog *Program) Build(b Builder)
- func (prog *Program) GetErrors() SSAErrors
- func (p *Program) InspectVariable(varName string) *InspectVariableResult
- func (p *Program) InspectVariableLast(varName string) *InspectVariableResult
- func (p *Program) Show()
- func (p *Program) ShowWithSource()
- type Recover
- func (a *Recover) AddLeftPositions(pos *Position)
- func (a *Recover) AddLeftVariables(name string)
- func (n *Recover) AddUser(u User)
- func (a *Recover) GetBlock() *BasicBlock
- func (a *Recover) GetFunc() *Function
- func (a *Recover) GetLeftItem() LeftInstruction
- func (a *Recover) GetLeftPosition() *Position
- func (a *Recover) GetLeftPositions() []*Position
- func (a *Recover) GetLeftVariables() []string
- func (i *Recover) GetOpcode() Opcode
- func (a *Recover) GetOperand(i int) Value
- func (a *Recover) GetOperandNum() int
- func (a *Recover) GetOperands() Values
- func (c *Recover) GetPosition() *Position
- func (a *Recover) GetSymbolTable() *blockSymbolTable
- func (n *Recover) GetType() Type
- func (n *Recover) GetUsers() Users
- func (r *Recover) GetValues() Values
- func (a *Recover) GetVariable() string
- func (a *Recover) HasLeftVariable() bool
- func (n *Recover) HasUsers() bool
- func (r *Recover) HasValues() bool
- func (c *Recover) IsExtern() bool
- func (r *Recover) LineDisasm() string
- func (c *Recover) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Recover) RemoveUser(u User)
- func (a *Recover) SetBlock(block *BasicBlock)
- func (c *Recover) SetExtern(b bool)
- func (a *Recover) SetFunc(f *Function)
- func (c *Recover) SetPosition(pos *Position)
- func (a *Recover) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Recover) SetType(typ Type)
- func (a *Recover) SetVariable(v string)
- func (r *Recover) String() string
- type Return
- func (a *Return) AddLeftPositions(pos *Position)
- func (a *Return) AddLeftVariables(name string)
- func (n *Return) AddUser(u User)
- func (a *Return) GetBlock() *BasicBlock
- func (a *Return) GetFunc() *Function
- func (a *Return) GetLeftItem() LeftInstruction
- func (a *Return) GetLeftPosition() *Position
- func (a *Return) GetLeftPositions() []*Position
- func (a *Return) GetLeftVariables() []string
- func (i *Return) GetOpcode() Opcode
- func (a *Return) GetOperand(i int) Value
- func (a *Return) GetOperandNum() int
- func (a *Return) GetOperands() Values
- func (c *Return) GetPosition() *Position
- func (a *Return) GetSymbolTable() *blockSymbolTable
- func (n *Return) GetType() Type
- func (r *Return) GetUsers() Users
- func (r *Return) GetValues() Values
- func (a *Return) GetVariable() string
- func (a *Return) HasLeftVariable() bool
- func (r *Return) HasUsers() bool
- func (r *Return) HasValues() bool
- func (c *Return) IsExtern() bool
- func (r *Return) LineDisasm() string
- func (c *Return) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Return) RemoveUser(u User)
- func (r *Return) ReplaceValue(v Value, to Value)
- func (a *Return) SetBlock(block *BasicBlock)
- func (c *Return) SetExtern(b bool)
- func (a *Return) SetFunc(f *Function)
- func (c *Return) SetPosition(pos *Position)
- func (a *Return) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Return) SetType(typ Type)
- func (a *Return) SetVariable(v string)
- func (r *Return) String() string
- type SSAError
- type SSAErrors
- type SideEffect
- func (a *SideEffect) AddLeftPositions(pos *Position)
- func (a *SideEffect) AddLeftVariables(name string)
- func (n *SideEffect) AddUser(u User)
- func (a *SideEffect) GetBlock() *BasicBlock
- func (a *SideEffect) GetFunc() *Function
- func (a *SideEffect) GetLeftItem() LeftInstruction
- func (a *SideEffect) GetLeftPosition() *Position
- func (a *SideEffect) GetLeftPositions() []*Position
- func (a *SideEffect) GetLeftVariables() []string
- func (i *SideEffect) GetOpcode() Opcode
- func (a *SideEffect) GetOperand(i int) Value
- func (a *SideEffect) GetOperandNum() int
- func (a *SideEffect) GetOperands() Values
- func (c *SideEffect) GetPosition() *Position
- func (a *SideEffect) GetSymbolTable() *blockSymbolTable
- func (n *SideEffect) GetType() Type
- func (n *SideEffect) GetUsers() Users
- func (s *SideEffect) GetValues() Values
- func (a *SideEffect) GetVariable() string
- func (a *SideEffect) HasLeftVariable() bool
- func (n *SideEffect) HasUsers() bool
- func (s *SideEffect) HasValues() bool
- func (c *SideEffect) IsExtern() bool
- func (s *SideEffect) LineDisasm() string
- func (c *SideEffect) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *SideEffect) RemoveUser(u User)
- func (s *SideEffect) ReplaceValue(v Value, to Value)
- func (a *SideEffect) SetBlock(block *BasicBlock)
- func (c *SideEffect) SetExtern(b bool)
- func (a *SideEffect) SetFunc(f *Function)
- func (c *SideEffect) SetPosition(pos *Position)
- func (a *SideEffect) SetSymbolTable(symbol *blockSymbolTable)
- func (n *SideEffect) SetType(typ Type)
- func (a *SideEffect) SetVariable(v string)
- func (s *SideEffect) String() string
- type Switch
- func (a *Switch) AddLeftPositions(pos *Position)
- func (a *Switch) AddLeftVariables(name string)
- func (a *Switch) GetBlock() *BasicBlock
- func (a *Switch) GetFunc() *Function
- func (a *Switch) GetLeftItem() LeftInstruction
- func (a *Switch) GetLeftPosition() *Position
- func (a *Switch) GetLeftPositions() []*Position
- func (a *Switch) GetLeftVariables() []string
- func (i *Switch) GetOpcode() Opcode
- func (a *Switch) GetOperand(i int) Value
- func (a *Switch) GetOperandNum() int
- func (a *Switch) GetOperands() Values
- func (c *Switch) GetPosition() *Position
- func (a *Switch) GetSymbolTable() *blockSymbolTable
- func (r *Switch) GetUsers() Users
- func (sw *Switch) GetValues() Values
- func (a *Switch) GetVariable() string
- func (a *Switch) HasLeftVariable() bool
- func (r *Switch) HasUsers() bool
- func (sw *Switch) HasValues() bool
- func (c *Switch) IsExtern() bool
- func (s Switch) LineDisasm() string
- func (c *Switch) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (sw *Switch) ReplaceValue(v Value, to Value)
- func (a *Switch) SetBlock(block *BasicBlock)
- func (c *Switch) SetExtern(b bool)
- func (a *Switch) SetFunc(f *Function)
- func (c *Switch) SetPosition(pos *Position)
- func (a *Switch) SetSymbolTable(symbol *blockSymbolTable)
- func (a *Switch) SetVariable(v string)
- func (sw *Switch) String() string
- type SwitchBuilder
- type SwitchLabel
- type TryBuilder
- type Type
- type TypeCast
- func (a *TypeCast) AddLeftPositions(pos *Position)
- func (a *TypeCast) AddLeftVariables(name string)
- func (n *TypeCast) AddUser(u User)
- func (a *TypeCast) GetBlock() *BasicBlock
- func (a *TypeCast) GetFunc() *Function
- func (a *TypeCast) GetLeftItem() LeftInstruction
- func (a *TypeCast) GetLeftPosition() *Position
- func (a *TypeCast) GetLeftPositions() []*Position
- func (a *TypeCast) GetLeftVariables() []string
- func (i *TypeCast) GetOpcode() Opcode
- func (a *TypeCast) GetOperand(i int) Value
- func (a *TypeCast) GetOperandNum() int
- func (a *TypeCast) GetOperands() Values
- func (c *TypeCast) GetPosition() *Position
- func (a *TypeCast) GetSymbolTable() *blockSymbolTable
- func (n *TypeCast) GetType() Type
- func (n *TypeCast) GetUsers() Users
- func (t *TypeCast) GetValues() Values
- func (a *TypeCast) GetVariable() string
- func (a *TypeCast) HasLeftVariable() bool
- func (n *TypeCast) HasUsers() bool
- func (t *TypeCast) HasValues() bool
- func (c *TypeCast) IsExtern() bool
- func (t *TypeCast) LineDisasm() string
- func (c *TypeCast) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *TypeCast) RemoveUser(u User)
- func (t *TypeCast) ReplaceValue(v, to Value)
- func (a *TypeCast) SetBlock(block *BasicBlock)
- func (c *TypeCast) SetExtern(b bool)
- func (a *TypeCast) SetFunc(f *Function)
- func (c *TypeCast) SetPosition(pos *Position)
- func (a *TypeCast) SetSymbolTable(symbol *blockSymbolTable)
- func (n *TypeCast) SetType(typ Type)
- func (a *TypeCast) SetVariable(v string)
- func (t *TypeCast) String() string
- type TypeKind
- type TypeValue
- func (a *TypeValue) AddLeftPositions(pos *Position)
- func (a *TypeValue) AddLeftVariables(name string)
- func (n *TypeValue) AddUser(u User)
- func (a *TypeValue) GetBlock() *BasicBlock
- func (a *TypeValue) GetFunc() *Function
- func (a *TypeValue) GetLeftItem() LeftInstruction
- func (a *TypeValue) GetLeftPosition() *Position
- func (a *TypeValue) GetLeftPositions() []*Position
- func (a *TypeValue) GetLeftVariables() []string
- func (i *TypeValue) GetOpcode() Opcode
- func (a *TypeValue) GetOperand(i int) Value
- func (a *TypeValue) GetOperandNum() int
- func (a *TypeValue) GetOperands() Values
- func (c *TypeValue) GetPosition() *Position
- func (a *TypeValue) GetSymbolTable() *blockSymbolTable
- func (n *TypeValue) GetType() Type
- func (n *TypeValue) GetUsers() Users
- func (t *TypeValue) GetValues() Values
- func (a *TypeValue) GetVariable() string
- func (a *TypeValue) HasLeftVariable() bool
- func (n *TypeValue) HasUsers() bool
- func (t *TypeValue) HasValues() bool
- func (c *TypeValue) IsExtern() bool
- func (t *TypeValue) LineDisasm() string
- func (c *TypeValue) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *TypeValue) RemoveUser(u User)
- func (a *TypeValue) SetBlock(block *BasicBlock)
- func (c *TypeValue) SetExtern(b bool)
- func (a *TypeValue) SetFunc(f *Function)
- func (c *TypeValue) SetPosition(pos *Position)
- func (a *TypeValue) SetSymbolTable(symbol *blockSymbolTable)
- func (n *TypeValue) SetType(typ Type)
- func (a *TypeValue) SetVariable(v string)
- func (t *TypeValue) String() string
- type TypedNode
- type Types
- type UnOp
- func (a *UnOp) AddLeftPositions(pos *Position)
- func (a *UnOp) AddLeftVariables(name string)
- func (n *UnOp) AddUser(u User)
- func (a *UnOp) GetBlock() *BasicBlock
- func (a *UnOp) GetFunc() *Function
- func (a *UnOp) GetLeftItem() LeftInstruction
- func (a *UnOp) GetLeftPosition() *Position
- func (a *UnOp) GetLeftPositions() []*Position
- func (a *UnOp) GetLeftVariables() []string
- func (i *UnOp) GetOpcode() Opcode
- func (a *UnOp) GetOperand(i int) Value
- func (a *UnOp) GetOperandNum() int
- func (a *UnOp) GetOperands() Values
- func (c *UnOp) GetPosition() *Position
- func (a *UnOp) GetSymbolTable() *blockSymbolTable
- func (n *UnOp) GetType() Type
- func (n *UnOp) GetUsers() Users
- func (n *UnOp) GetValues() Values
- func (a *UnOp) GetVariable() string
- func (a *UnOp) HasLeftVariable() bool
- func (n *UnOp) HasUsers() bool
- func (n *UnOp) HasValues() bool
- func (c *UnOp) IsExtern() bool
- func (u *UnOp) LineDisasm() string
- func (c *UnOp) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *UnOp) RemoveUser(u User)
- func (u *UnOp) ReplaceValue(v Value, to Value)
- func (a *UnOp) SetBlock(block *BasicBlock)
- func (c *UnOp) SetExtern(b bool)
- func (a *UnOp) SetFunc(f *Function)
- func (c *UnOp) SetPosition(pos *Position)
- func (a *UnOp) SetSymbolTable(symbol *blockSymbolTable)
- func (n *UnOp) SetType(typ Type)
- func (a *UnOp) SetVariable(v string)
- func (u *UnOp) String() string
- type UnaryOpcode
- type Undefined
- func (a *Undefined) AddLeftPositions(pos *Position)
- func (a *Undefined) AddLeftVariables(name string)
- func (n *Undefined) AddUser(u User)
- func (a *Undefined) GetBlock() *BasicBlock
- func (a *Undefined) GetFunc() *Function
- func (a *Undefined) GetLeftItem() LeftInstruction
- func (a *Undefined) GetLeftPosition() *Position
- func (a *Undefined) GetLeftPositions() []*Position
- func (a *Undefined) GetLeftVariables() []string
- func (i *Undefined) GetOpcode() Opcode
- func (a *Undefined) GetOperand(i int) Value
- func (a *Undefined) GetOperandNum() int
- func (a *Undefined) GetOperands() Values
- func (c *Undefined) GetPosition() *Position
- func (a *Undefined) GetSymbolTable() *blockSymbolTable
- func (n *Undefined) GetType() Type
- func (n *Undefined) GetUsers() Users
- func (u *Undefined) GetValues() Values
- func (a *Undefined) GetVariable() string
- func (a *Undefined) HasLeftVariable() bool
- func (n *Undefined) HasUsers() bool
- func (u *Undefined) HasValues() bool
- func (c *Undefined) IsExtern() bool
- func (u *Undefined) LineDisasm() string
- func (c *Undefined) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (n *Undefined) RemoveUser(u User)
- func (a *Undefined) SetBlock(block *BasicBlock)
- func (c *Undefined) SetExtern(b bool)
- func (a *Undefined) SetFunc(f *Function)
- func (c *Undefined) SetPosition(pos *Position)
- func (a *Undefined) SetSymbolTable(symbol *blockSymbolTable)
- func (n *Undefined) SetType(typ Type)
- func (a *Undefined) SetVariable(v string)
- func (u *Undefined) String() string
- type Update
- func (a *Update) AddLeftPositions(pos *Position)
- func (a *Update) AddLeftVariables(name string)
- func (a *Update) GetBlock() *BasicBlock
- func (a *Update) GetFunc() *Function
- func (a *Update) GetLeftItem() LeftInstruction
- func (a *Update) GetLeftPosition() *Position
- func (a *Update) GetLeftPositions() []*Position
- func (a *Update) GetLeftVariables() []string
- func (i *Update) GetOpcode() Opcode
- func (a *Update) GetOperand(i int) Value
- func (a *Update) GetOperandNum() int
- func (a *Update) GetOperands() Values
- func (c *Update) GetPosition() *Position
- func (a *Update) GetSymbolTable() *blockSymbolTable
- func (r *Update) GetUsers() Users
- func (s *Update) GetValues() Values
- func (a *Update) GetVariable() string
- func (a *Update) HasLeftVariable() bool
- func (r *Update) HasUsers() bool
- func (s *Update) HasValues() bool
- func (c *Update) IsExtern() bool
- func (u *Update) LineDisasm() string
- func (c *Update) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (s *Update) ReplaceValue(v, to Value)
- func (a *Update) SetBlock(block *BasicBlock)
- func (c *Update) SetExtern(b bool)
- func (a *Update) SetFunc(f *Function)
- func (c *Update) SetPosition(pos *Position)
- func (a *Update) SetSymbolTable(symbol *blockSymbolTable)
- func (a *Update) SetVariable(v string)
- func (s *Update) String() string
- type User
- type Users
- func (u Users) RunOnCall(f func(*Call))
- func (u Users) RunOnCallOr(f func(*Call), or func(User))
- func (u Users) RunOnField(f func(*Field))
- func (u Users) RunOnFieldOr(f func(*Field), or func(User))
- func (u Users) RunOnUpdate(f func(*Update))
- func (u Users) RunOnUpdateOr(f func(*Update), or func(User))
- type Value
- type Values
Constants ¶
const ( OpUnknown Opcode = "unknown" OpFunction = "Function" OpBasicBlock = "BasicBlock" OpParameter = "Parameter" OpPhi = "Phi" OpConstInst = "ConstInst" OpUndefined = "Undefined" OpBinOp = "BinOp" OpUnOp = "UnOp" OpCall = "Call" OpSideEffect = "SideEffect" OpReturn = "Return" OpMake = "Make" OpField = "Field" OpUpdate = "Update" OpNext = "Next" OpAssert = "Assert" OpTypeCast = "TypeCast" OpTypeValue = "TypeValue" OpErrorHandler = "ErrorHandler" OpPanic = "Panic" OpRecover = "Recover" OpJump = "Jump" OpIf = "If" OpLoop = "Loop" OpSwitch = "Switch" )
const ( // loop LoopHeader = "loop.header" LoopBody = "loop.body" LoopExit = "loop.exit" LoopLatch = "loop.latch" // if IfDone = "if.done" IfTrue = "if.true" IfFalse = "if.false" IfElif = "if.elif" // try-catch TryStart = "error.try" TryCatch = "error.catch" TryFinally = "error.final" TryDone = "" // switch SwitchDone = "switch.done" SwitchDefault = "switch.default" SwitchHandler = "switch.handler" )
const (
MAXTYPELEVEL = 15
)
const MAXTypeCompareDepth = 10
Variables ¶
var BasicTypes = []*BasicType{ Number: {Number, "number", make(map[string]*FunctionType, 0)}, String: {String, "string", make(map[string]*FunctionType, 0)}, Bytes: {Bytes, "bytes", make(map[string]*FunctionType, 0)}, Boolean: {Boolean, "boolean", make(map[string]*FunctionType, 0)}, UndefinedType: {UndefinedType, "undefined", make(map[string]*FunctionType, 0)}, Null: {Null, "null", make(map[string]*FunctionType, 0)}, Any: {Any, "any", make(map[string]*FunctionType, 0)}, ErrorType: {ErrorType, "error", make(map[string]*FunctionType, 0)}, }
var BinaryOpcodeName = map[BinaryOpcode]string{ OpLogicAnd: `LogicAnd`, OpLogicOr: `LogicOr`, OpAnd: `and`, OpAndNot: `and-not`, OpOr: `or`, OpXor: `xor`, OpShl: `shl`, OpShr: `shr`, OpAdd: `add`, OpSub: `sub`, OpMod: `mod`, OpMul: `mul`, OpDiv: `div`, OpGt: `gt`, OpLt: `lt`, OpLtEq: `ltEq`, OpGtEq: `gtEq`, OpNotEq: `neq`, OpEq: `eq`, OpIn: `in`, OpSend: `send`, }
var UnaryOpcodeName = map[UnaryOpcode]string{ OpNone: ``, OpNot: `not`, OpPlus: `plus`, OpNeg: `neg`, OpChan: `chan`, OpBitwiseNot: `bitwise-not`, }
Functions ¶
func BindingNotFound ¶ added in v1.2.8
func ContAssignExtern ¶ added in v1.2.8
func DeleteInst ¶ added in v1.2.8
func DeleteInst(i Instruction)
func ExternFieldError ¶ added in v1.2.8
func GetIdByBlockSymbolTable ¶ added in v1.2.8
func GetMethodsName ¶ added in v1.2.9
func GetTypeStr ¶
func InsertValueReplaceOriginal ¶ added in v1.2.9
func IsControlInstruction ¶ added in v1.2.9
func IsControlInstruction(i Instruction) bool
func IsObjectType ¶ added in v1.2.9
func NewInstruction ¶ added in v1.2.8
func NewInstruction() anInstruction
func NoCheckMustInFirst ¶ added in v1.2.8
func NoCheckMustInFirst() string
func ReplaceAllValue ¶ added in v1.2.9
func ReplaceValue ¶
func ReplaceValue(v Value, to Value, skip func(Instruction) bool)
func ReplaceValueInSymbolTable ¶ added in v1.2.9
func ReplaceValueInSymbolTable(v, to Value)
func RunOnCoverOr ¶ added in v1.2.8
func RunOnCoverOr[T, U Instruction](insts []U, cover func(Instruction) (T, bool), f func(T), or func(U))
func TryGetSimilarityKey ¶ added in v1.2.8
func TypeCompare ¶ added in v1.2.9
func TypeCompareEx ¶ added in v1.2.9
Types ¶
type AliasType ¶ added in v1.2.8
type AliasType struct { Name string // contains filtered or unexported fields }
====================== alias type
func NewAliasType ¶ added in v1.2.8
func (*AliasType) AddMethod ¶ added in v1.2.9
func (b *AliasType) AddMethod(id string, f *FunctionType)
func (*AliasType) GetMethod ¶ added in v1.2.8
func (a *AliasType) GetMethod() map[string]*FunctionType
func (*AliasType) GetTypeKind ¶ added in v1.2.8
func (*AliasType) SetMethod ¶ added in v1.2.8
func (a *AliasType) SetMethod(m map[string]*FunctionType)
type Assert ¶ added in v1.2.8
type Assert struct { Cond Value Msg string MsgValue Value // contains filtered or unexported fields }
----------- assert
func (*Assert) AddLeftPositions ¶ added in v1.2.8
func (a *Assert) AddLeftPositions(pos *Position)
func (*Assert) AddLeftVariables ¶ added in v1.2.8
func (a *Assert) AddLeftVariables(name string)
func (*Assert) GetBlock ¶ added in v1.2.8
func (a *Assert) GetBlock() *BasicBlock
func (*Assert) GetLeftItem ¶ added in v1.2.8
func (a *Assert) GetLeftItem() LeftInstruction
func (*Assert) GetLeftPosition ¶ added in v1.2.8
func (a *Assert) GetLeftPosition() *Position
func (*Assert) GetLeftPositions ¶ added in v1.2.8
func (a *Assert) GetLeftPositions() []*Position
left-instruction: left-position
func (*Assert) GetLeftVariables ¶ added in v1.2.8
func (a *Assert) GetLeftVariables() []string
left-instruction: variable
func (*Assert) GetOperand ¶ added in v1.2.8
func (*Assert) GetOperandNum ¶ added in v1.2.8
func (a *Assert) GetOperandNum() int
func (*Assert) GetOperands ¶ added in v1.2.8
func (a *Assert) GetOperands() Values
func (*Assert) GetPosition ¶ added in v1.2.8
func (c *Assert) GetPosition() *Position
source code position
func (*Assert) GetSymbolTable ¶ added in v1.2.8
func (a *Assert) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Assert) GetVariable ¶ added in v1.2.8
func (a *Assert) GetVariable() string
func (*Assert) HasLeftVariable ¶ added in v1.2.8
func (a *Assert) HasLeftVariable() bool
has left-instruction
func (*Assert) LineDisasm ¶ added in v1.2.8
func (*Assert) ReplaceValue ¶ added in v1.2.8
func (*Assert) SetBlock ¶ added in v1.2.8
func (a *Assert) SetBlock(block *BasicBlock)
func (*Assert) SetFunc ¶ added in v1.2.8
func (a *Assert) SetFunc(f *Function)
ssa function and block
func (*Assert) SetPosition ¶ added in v1.2.8
func (c *Assert) SetPosition(pos *Position)
func (*Assert) SetSymbolTable ¶ added in v1.2.8
func (a *Assert) SetSymbolTable(symbol *blockSymbolTable)
type BasicBlock ¶
type BasicBlock struct { Index int // BasicBlock graph Preds, Succs []*BasicBlock /* if Condition == true: this block reach */ Condition Value // instruction list Insts []Instruction Phis []*Phi // error catch Handler *ErrorHandler Skip bool // for phi build, avoid recursive // contains filtered or unexported fields }
implement Value
func (*BasicBlock) AddLeftPositions ¶ added in v1.2.8
func (a *BasicBlock) AddLeftPositions(pos *Position)
func (*BasicBlock) AddLeftVariables ¶ added in v1.2.8
func (a *BasicBlock) AddLeftVariables(name string)
func (*BasicBlock) AddSucc ¶
func (b *BasicBlock) AddSucc(succ *BasicBlock)
func (*BasicBlock) EmitInst ¶ added in v1.2.8
func (b *BasicBlock) EmitInst(i Instruction)
func (*BasicBlock) GetBlock ¶ added in v1.2.8
func (a *BasicBlock) GetBlock() *BasicBlock
func (*BasicBlock) GetBlockById ¶ added in v1.2.8
func (b *BasicBlock) GetBlockById(name string) *BasicBlock
func (*BasicBlock) GetLeftItem ¶ added in v1.2.8
func (a *BasicBlock) GetLeftItem() LeftInstruction
func (*BasicBlock) GetLeftPosition ¶ added in v1.2.8
func (a *BasicBlock) GetLeftPosition() *Position
func (*BasicBlock) GetLeftPositions ¶ added in v1.2.8
func (a *BasicBlock) GetLeftPositions() []*Position
left-instruction: left-position
func (*BasicBlock) GetLeftVariables ¶ added in v1.2.8
func (a *BasicBlock) GetLeftVariables() []string
left-instruction: variable
func (*BasicBlock) GetOpcode ¶ added in v1.2.8
func (i *BasicBlock) GetOpcode() Opcode
func (*BasicBlock) GetOperand ¶ added in v1.2.8
func (*BasicBlock) GetOperandNum ¶ added in v1.2.8
func (a *BasicBlock) GetOperandNum() int
func (*BasicBlock) GetOperands ¶ added in v1.2.8
func (a *BasicBlock) GetOperands() Values
func (*BasicBlock) GetPosition ¶ added in v1.2.8
func (c *BasicBlock) GetPosition() *Position
source code position
func (*BasicBlock) GetSymbolTable ¶ added in v1.2.8
func (a *BasicBlock) GetSymbolTable() *blockSymbolTable
symbol-table
func (*BasicBlock) GetType ¶
func (b *BasicBlock) GetType() Type
func (*BasicBlock) GetValues ¶
func (b *BasicBlock) GetValues() Values
func (*BasicBlock) GetVariable ¶ added in v1.2.8
func (a *BasicBlock) GetVariable() string
func (*BasicBlock) HasLeftVariable ¶ added in v1.2.8
func (a *BasicBlock) HasLeftVariable() bool
has left-instruction
func (*BasicBlock) HasUsers ¶ added in v1.2.8
func (n *BasicBlock) HasUsers() bool
has/get user and value
func (*BasicBlock) HasValues ¶ added in v1.2.8
func (b *BasicBlock) HasValues() bool
----------- BasicBlock
func (*BasicBlock) IsBlock ¶ added in v1.2.8
func (b *BasicBlock) IsBlock(name string) bool
func (*BasicBlock) LastInst ¶
func (b *BasicBlock) LastInst() Instruction
func (*BasicBlock) LineDisasm ¶ added in v1.2.8
func (b *BasicBlock) LineDisasm() string
func (*BasicBlock) Reachable ¶ added in v1.2.8
func (b *BasicBlock) Reachable() int
func (*BasicBlock) RemoveUser ¶
func (n *BasicBlock) RemoveUser(u User)
func (*BasicBlock) Sealed ¶
func (b *BasicBlock) Sealed()
func (*BasicBlock) SetBlock ¶ added in v1.2.8
func (a *BasicBlock) SetBlock(block *BasicBlock)
func (*BasicBlock) SetFunc ¶ added in v1.2.8
func (a *BasicBlock) SetFunc(f *Function)
ssa function and block
func (*BasicBlock) SetPosition ¶ added in v1.2.8
func (c *BasicBlock) SetPosition(pos *Position)
func (*BasicBlock) SetSymbolTable ¶ added in v1.2.8
func (a *BasicBlock) SetSymbolTable(symbol *blockSymbolTable)
func (*BasicBlock) SetType ¶
func (b *BasicBlock) SetType(ts Type)
func (*BasicBlock) SetVariable ¶ added in v1.2.8
func (a *BasicBlock) SetVariable(v string)
variable
type BasicType ¶
type BasicType struct { Kind TypeKind // contains filtered or unexported fields }
func (*BasicType) AddMethod ¶ added in v1.2.9
func (b *BasicType) AddMethod(id string, f *FunctionType)
func (*BasicType) GetMethod ¶ added in v1.2.8
func (b *BasicType) GetMethod() map[string]*FunctionType
func (*BasicType) GetTypeKind ¶ added in v1.2.8
func (*BasicType) SetMethod ¶ added in v1.2.8
func (b *BasicType) SetMethod(method map[string]*FunctionType)
type BinOp ¶
type BinOp struct { Op BinaryOpcode X, Y Value // contains filtered or unexported fields }
----------- BinOp
func NewBinOpOnly ¶ added in v1.2.8
func NewBinOpOnly(op BinaryOpcode, x, y Value) *BinOp
func ToBinOp ¶ added in v1.2.8
func ToBinOp(v Instruction) (*BinOp, bool)
func (*BinOp) AddLeftPositions ¶ added in v1.2.8
func (a *BinOp) AddLeftPositions(pos *Position)
func (*BinOp) AddLeftVariables ¶ added in v1.2.8
func (a *BinOp) AddLeftVariables(name string)
func (*BinOp) GetBlock ¶
func (a *BinOp) GetBlock() *BasicBlock
func (*BinOp) GetLeftItem ¶ added in v1.2.8
func (a *BinOp) GetLeftItem() LeftInstruction
func (*BinOp) GetLeftPosition ¶ added in v1.2.8
func (a *BinOp) GetLeftPosition() *Position
func (*BinOp) GetLeftPositions ¶ added in v1.2.8
func (a *BinOp) GetLeftPositions() []*Position
left-instruction: left-position
func (*BinOp) GetLeftVariables ¶ added in v1.2.8
func (a *BinOp) GetLeftVariables() []string
left-instruction: variable
func (*BinOp) GetOperand ¶ added in v1.2.8
func (*BinOp) GetOperandNum ¶ added in v1.2.8
func (a *BinOp) GetOperandNum() int
func (*BinOp) GetOperands ¶ added in v1.2.8
func (a *BinOp) GetOperands() Values
func (*BinOp) GetPosition ¶ added in v1.2.8
func (c *BinOp) GetPosition() *Position
source code position
func (*BinOp) GetSymbolTable ¶ added in v1.2.8
func (a *BinOp) GetSymbolTable() *blockSymbolTable
symbol-table
func (*BinOp) GetVariable ¶ added in v1.2.8
func (a *BinOp) GetVariable() string
func (*BinOp) HasLeftVariable ¶ added in v1.2.8
func (a *BinOp) HasLeftVariable() bool
has left-instruction
func (*BinOp) LineDisasm ¶ added in v1.2.8
func (*BinOp) RemoveUser ¶
func (n *BinOp) RemoveUser(u User)
func (*BinOp) ReplaceValue ¶
func (*BinOp) SetBlock ¶ added in v1.2.8
func (a *BinOp) SetBlock(block *BasicBlock)
func (*BinOp) SetPosition ¶ added in v1.2.8
func (c *BinOp) SetPosition(pos *Position)
func (*BinOp) SetSymbolTable ¶ added in v1.2.8
func (a *BinOp) SetSymbolTable(symbol *blockSymbolTable)
type BinaryOpcode ¶
type BinaryOpcode int
const ( // Binary OpShl BinaryOpcode = iota // << OpLogicAnd // && OpLogicOr // || OpShr // >> OpAnd // & OpAndNot // &^ OpOr // | OpXor // ^ OpAdd // + OpSub // - OpDiv // / OpMod // % // mul OpMul // * // boolean opcode OpGt // > OpLt // < OpGtEq // >= OpLtEq // <= OpEq // == OpNotEq // != <> OpIn // a in b OpSend // <- )
type Call ¶
type Call struct { // for call function Method Value Args []Value // go function Async bool Unpack bool // caller // caller Value // ~ drop error IsDropError bool IsEllipsis bool // contains filtered or unexported fields }
----------- Call call instruction call method function with args as argument
func NewCall ¶ added in v1.2.8
func NewCall(target Value, args, binding []Value, block *BasicBlock) *Call
func ToCall ¶ added in v1.2.8
func ToCall(v Instruction) (*Call, bool)
func (*Call) AddLeftPositions ¶ added in v1.2.8
func (a *Call) AddLeftPositions(pos *Position)
func (*Call) AddLeftVariables ¶ added in v1.2.8
func (a *Call) AddLeftVariables(name string)
func (*Call) GetBlock ¶
func (a *Call) GetBlock() *BasicBlock
func (*Call) GetLeftItem ¶ added in v1.2.8
func (a *Call) GetLeftItem() LeftInstruction
func (*Call) GetLeftPosition ¶ added in v1.2.8
func (a *Call) GetLeftPosition() *Position
func (*Call) GetLeftPositions ¶ added in v1.2.8
func (a *Call) GetLeftPositions() []*Position
left-instruction: left-position
func (*Call) GetLeftVariables ¶ added in v1.2.8
func (a *Call) GetLeftVariables() []string
left-instruction: variable
func (*Call) GetOperand ¶ added in v1.2.8
func (*Call) GetOperandNum ¶ added in v1.2.8
func (a *Call) GetOperandNum() int
func (*Call) GetOperands ¶ added in v1.2.8
func (a *Call) GetOperands() Values
func (*Call) GetPosition ¶ added in v1.2.8
func (c *Call) GetPosition() *Position
source code position
func (*Call) GetSymbolTable ¶ added in v1.2.8
func (a *Call) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Call) GetVariable ¶ added in v1.2.8
func (a *Call) GetVariable() string
func (*Call) HandleFreeValue ¶ added in v1.2.8
func (*Call) HasLeftVariable ¶ added in v1.2.8
func (a *Call) HasLeftVariable() bool
has left-instruction
func (*Call) LineDisasm ¶ added in v1.2.8
func (*Call) RemoveUser ¶
func (n *Call) RemoveUser(u User)
func (*Call) ReplaceValue ¶
func (*Call) SetBlock ¶ added in v1.2.8
func (a *Call) SetBlock(block *BasicBlock)
func (*Call) SetPosition ¶ added in v1.2.8
func (c *Call) SetPosition(pos *Position)
func (*Call) SetSymbolTable ¶ added in v1.2.8
func (a *Call) SetSymbolTable(symbol *blockSymbolTable)
type ChanType ¶
type ChanType struct {
// contains filtered or unexported fields
}
====================== chan type
func NewChanType ¶
func (*ChanType) AddMethod ¶ added in v1.2.9
func (b *ChanType) AddMethod(id string, f *FunctionType)
func (*ChanType) GetMethod ¶ added in v1.2.8
func (c *ChanType) GetMethod() map[string]*FunctionType
func (*ChanType) GetTypeKind ¶ added in v1.2.8
func (*ChanType) SetMethod ¶ added in v1.2.8
func (c *ChanType) SetMethod(m map[string]*FunctionType)
type Const ¶
type Const struct {
// contains filtered or unexported fields
}
func (*Const) GetRawValue ¶ added in v1.2.9
func (*Const) GetTypeKind ¶ added in v1.2.8
type ConstInst ¶ added in v1.2.8
----------- Const ConstInst also have block pointer, which block set this const to variable
func CalcConstBinary ¶ added in v1.2.8
func CalcConstBinary(x, y *ConstInst, op BinaryOpcode) *ConstInst
func CalcConstUnary ¶ added in v1.2.8
func CalcConstUnary(x *ConstInst, op UnaryOpcode) *ConstInst
OpNone UnaryOpcode = iota OpNot // ! OpPlus // + OpNeg // - OpChan // ->
func NewConstInst ¶ added in v1.2.8
func (*ConstInst) AddLeftPositions ¶ added in v1.2.8
func (a *ConstInst) AddLeftPositions(pos *Position)
func (*ConstInst) AddLeftVariables ¶ added in v1.2.8
func (a *ConstInst) AddLeftVariables(name string)
func (*ConstInst) GetBlock ¶ added in v1.2.8
func (a *ConstInst) GetBlock() *BasicBlock
func (*ConstInst) GetLeftItem ¶ added in v1.2.8
func (a *ConstInst) GetLeftItem() LeftInstruction
func (*ConstInst) GetLeftPosition ¶ added in v1.2.8
func (a *ConstInst) GetLeftPosition() *Position
func (*ConstInst) GetLeftPositions ¶ added in v1.2.8
func (a *ConstInst) GetLeftPositions() []*Position
left-instruction: left-position
func (*ConstInst) GetLeftVariables ¶ added in v1.2.8
func (a *ConstInst) GetLeftVariables() []string
left-instruction: variable
func (*ConstInst) GetOperand ¶ added in v1.2.8
func (*ConstInst) GetOperandNum ¶ added in v1.2.8
func (a *ConstInst) GetOperandNum() int
func (*ConstInst) GetOperands ¶ added in v1.2.8
func (a *ConstInst) GetOperands() Values
func (*ConstInst) GetPosition ¶ added in v1.2.8
func (c *ConstInst) GetPosition() *Position
source code position
func (*ConstInst) GetSymbolTable ¶ added in v1.2.8
func (a *ConstInst) GetSymbolTable() *blockSymbolTable
symbol-table
func (*ConstInst) GetVariable ¶ added in v1.2.8
func (a *ConstInst) GetVariable() string
func (*ConstInst) HasLeftVariable ¶ added in v1.2.8
func (a *ConstInst) HasLeftVariable() bool
has left-instruction
func (*ConstInst) HasUsers ¶ added in v1.2.8
func (n *ConstInst) HasUsers() bool
has/get user and value
func (*ConstInst) LineDisasm ¶ added in v1.2.8
func (*ConstInst) RemoveUser ¶ added in v1.2.8
func (n *ConstInst) RemoveUser(u User)
func (*ConstInst) SetBlock ¶ added in v1.2.8
func (a *ConstInst) SetBlock(block *BasicBlock)
func (*ConstInst) SetFunc ¶ added in v1.2.8
func (a *ConstInst) SetFunc(f *Function)
ssa function and block
func (*ConstInst) SetPosition ¶ added in v1.2.8
func (c *ConstInst) SetPosition(pos *Position)
func (*ConstInst) SetSymbolTable ¶ added in v1.2.8
func (a *ConstInst) SetSymbolTable(symbol *blockSymbolTable)
type ErrorComment ¶ added in v1.2.8
type ErrorComment struct {
// contains filtered or unexported fields
}
func (ErrorComment) Skip ¶ added in v1.2.8
func (ec ErrorComment) Skip(pos *Position) bool
type ErrorCommentId ¶ added in v1.2.8
type ErrorCommentId string
const ( SSAIgnore ErrorCommentId = "// @ssa-ignore" SSANoCheck ErrorCommentId = "// @ssa-nocheck" )
type ErrorHandler ¶ added in v1.2.8
type ErrorHandler struct {
// contains filtered or unexported fields
}
------------- ErrorHandler
func NewErrorHandler ¶ added in v1.2.8
func NewErrorHandler(try, catch *BasicBlock) *ErrorHandler
func (*ErrorHandler) AddDone ¶ added in v1.2.8
func (e *ErrorHandler) AddDone(d *BasicBlock)
func (*ErrorHandler) AddFinal ¶ added in v1.2.8
func (e *ErrorHandler) AddFinal(f *BasicBlock)
func (*ErrorHandler) AddLeftPositions ¶ added in v1.2.8
func (a *ErrorHandler) AddLeftPositions(pos *Position)
func (*ErrorHandler) AddLeftVariables ¶ added in v1.2.8
func (a *ErrorHandler) AddLeftVariables(name string)
func (*ErrorHandler) GetBlock ¶ added in v1.2.8
func (a *ErrorHandler) GetBlock() *BasicBlock
func (*ErrorHandler) GetLeftItem ¶ added in v1.2.8
func (a *ErrorHandler) GetLeftItem() LeftInstruction
func (*ErrorHandler) GetLeftPosition ¶ added in v1.2.8
func (a *ErrorHandler) GetLeftPosition() *Position
func (*ErrorHandler) GetLeftPositions ¶ added in v1.2.8
func (a *ErrorHandler) GetLeftPositions() []*Position
left-instruction: left-position
func (*ErrorHandler) GetLeftVariables ¶ added in v1.2.8
func (a *ErrorHandler) GetLeftVariables() []string
left-instruction: variable
func (*ErrorHandler) GetOpcode ¶ added in v1.2.8
func (i *ErrorHandler) GetOpcode() Opcode
func (*ErrorHandler) GetOperand ¶ added in v1.2.8
func (*ErrorHandler) GetOperandNum ¶ added in v1.2.8
func (a *ErrorHandler) GetOperandNum() int
func (*ErrorHandler) GetOperands ¶ added in v1.2.8
func (a *ErrorHandler) GetOperands() Values
func (*ErrorHandler) GetPosition ¶ added in v1.2.8
func (c *ErrorHandler) GetPosition() *Position
source code position
func (*ErrorHandler) GetSymbolTable ¶ added in v1.2.8
func (a *ErrorHandler) GetSymbolTable() *blockSymbolTable
symbol-table
func (*ErrorHandler) GetVariable ¶ added in v1.2.8
func (a *ErrorHandler) GetVariable() string
func (*ErrorHandler) HasLeftVariable ¶ added in v1.2.8
func (a *ErrorHandler) HasLeftVariable() bool
has left-instruction
func (*ErrorHandler) LineDisasm ¶ added in v1.2.8
func (p *ErrorHandler) LineDisasm() string
func (*ErrorHandler) SetBlock ¶ added in v1.2.8
func (a *ErrorHandler) SetBlock(block *BasicBlock)
func (*ErrorHandler) SetFunc ¶ added in v1.2.8
func (a *ErrorHandler) SetFunc(f *Function)
ssa function and block
func (*ErrorHandler) SetPosition ¶ added in v1.2.8
func (c *ErrorHandler) SetPosition(pos *Position)
func (*ErrorHandler) SetSymbolTable ¶ added in v1.2.8
func (a *ErrorHandler) SetSymbolTable(symbol *blockSymbolTable)
func (*ErrorHandler) SetVariable ¶ added in v1.2.8
func (a *ErrorHandler) SetVariable(v string)
variable
func (*ErrorHandler) String ¶ added in v1.2.8
func (e *ErrorHandler) String() string
type ErrorLogger ¶ added in v1.2.8
type Field ¶
type Field struct { // field Key Value Obj Value // Method or Field IsMethod bool // capture by other function OutCapture bool // contains filtered or unexported fields }
instruction ----------- Field
func NewFieldOnly ¶ added in v1.2.8
func NewFieldOnly(key, obj Value, block *BasicBlock) *Field
func ToField ¶ added in v1.2.8
func ToField(v Instruction) (*Field, bool)
func (*Field) AddLeftPositions ¶ added in v1.2.8
func (a *Field) AddLeftPositions(pos *Position)
func (*Field) AddLeftVariables ¶ added in v1.2.8
func (a *Field) AddLeftVariables(name string)
func (*Field) Assign ¶
func (field *Field) Assign(v Value, f *FunctionBuilder)
--------------- point variable to value `f.symbol[variable]value` --------------- it's memory address, not SSA value
func (*Field) GetBlock ¶
func (a *Field) GetBlock() *BasicBlock
func (*Field) GetLeftItem ¶ added in v1.2.8
func (a *Field) GetLeftItem() LeftInstruction
func (*Field) GetLeftPosition ¶ added in v1.2.8
func (a *Field) GetLeftPosition() *Position
func (*Field) GetLeftPositions ¶ added in v1.2.8
func (a *Field) GetLeftPositions() []*Position
left-instruction: left-position
func (*Field) GetLeftVariables ¶ added in v1.2.8
func (a *Field) GetLeftVariables() []string
left-instruction: variable
func (*Field) GetOperand ¶ added in v1.2.8
func (*Field) GetOperandNum ¶ added in v1.2.8
func (a *Field) GetOperandNum() int
func (*Field) GetOperands ¶ added in v1.2.8
func (a *Field) GetOperands() Values
func (*Field) GetPosition ¶ added in v1.2.8
func (c *Field) GetPosition() *Position
source code position
func (*Field) GetSymbolTable ¶ added in v1.2.8
func (a *Field) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Field) GetValue ¶
func (f *Field) GetValue(_ *FunctionBuilder) Value
func (*Field) GetVariable ¶ added in v1.2.8
func (a *Field) GetVariable() string
func (*Field) HasLeftVariable ¶ added in v1.2.8
func (a *Field) HasLeftVariable() bool
has left-instruction
func (*Field) LineDisasm ¶ added in v1.2.8
func (*Field) RemoveUser ¶
func (n *Field) RemoveUser(u User)
func (*Field) ReplaceValue ¶
func (*Field) SetBlock ¶ added in v1.2.8
func (a *Field) SetBlock(block *BasicBlock)
func (*Field) SetPosition ¶ added in v1.2.8
func (c *Field) SetPosition(pos *Position)
func (*Field) SetSymbolTable ¶ added in v1.2.8
func (a *Field) SetSymbolTable(symbol *blockSymbolTable)
type Function ¶
type Function struct { // package Package *Package Param []*Parameter Return []*Return // BasicBlock list Blocks []*BasicBlock EnterBlock *BasicBlock ExitBlock *BasicBlock DeferBlock *BasicBlock // anonymous function in this function AnonFuncs []*Function // if this function is anonFunc FreeValues []Value // the value, captured variable form parent-function, SideEffects map[string]Value // closure function side effects // for instruction InstReg map[Instruction]string // instruction -> virtual register // contains filtered or unexported fields }
implement Value
func NewFunctionWithType ¶ added in v1.2.8
func NewFunctionWithType(name string, typ *FunctionType) *Function
just create a function define, only function parameter type \ return type \ ellipsis
func ToFunction ¶ added in v1.2.8
func (*Function) AddErrorComment ¶ added in v1.2.8
func (*Function) AddLeftPositions ¶ added in v1.2.8
func (a *Function) AddLeftPositions(pos *Position)
func (*Function) AddLeftVariables ¶ added in v1.2.8
func (a *Function) AddLeftVariables(name string)
func (*Function) AddSideEffect ¶ added in v1.2.9
func (*Function) DisAsm ¶
func (f *Function) DisAsm(flag FunctionAsmFlag) string
func (*Function) GetBlock ¶ added in v1.2.8
func (a *Function) GetBlock() *BasicBlock
func (*Function) GetDeferBlock ¶ added in v1.2.9
func (f *Function) GetDeferBlock() *BasicBlock
func (*Function) GetLeftItem ¶ added in v1.2.8
func (a *Function) GetLeftItem() LeftInstruction
func (*Function) GetLeftPosition ¶ added in v1.2.8
func (a *Function) GetLeftPosition() *Position
func (*Function) GetLeftPositions ¶ added in v1.2.8
func (a *Function) GetLeftPositions() []*Position
left-instruction: left-position
func (*Function) GetLeftVariables ¶ added in v1.2.8
func (a *Function) GetLeftVariables() []string
left-instruction: variable
func (*Function) GetOperand ¶ added in v1.2.8
func (*Function) GetOperandNum ¶ added in v1.2.8
func (a *Function) GetOperandNum() int
func (*Function) GetOperands ¶ added in v1.2.8
func (a *Function) GetOperands() Values
func (*Function) GetPosition ¶ added in v1.2.8
func (c *Function) GetPosition() *Position
source code position
func (*Function) GetSymbolTable ¶ added in v1.2.8
func (a *Function) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Function) GetValuesByName ¶ added in v1.2.8
func (f *Function) GetValuesByName(name string) InstructionNodes
func (*Function) GetVariable ¶ added in v1.2.8
func (a *Function) GetVariable() string
func (*Function) HasLeftVariable ¶ added in v1.2.8
func (a *Function) HasLeftVariable() bool
has left-instruction
func (*Function) HasUsers ¶ added in v1.2.8
func (n *Function) HasUsers() bool
has/get user and value
func (*Function) InspectVariable ¶
func (f *Function) InspectVariable(varName string) *InspectVariableResult
func (*Function) LineDisasm ¶ added in v1.2.8
func (*Function) NewBasicBlock ¶
func (f *Function) NewBasicBlock(name string) *BasicBlock
func (*Function) NewBasicBlockNotAddBlocks ¶ added in v1.2.9
func (f *Function) NewBasicBlockNotAddBlocks(name string) *BasicBlock
func (*Function) NewBasicBlockNotAddUnSealed ¶ added in v1.2.9
func (f *Function) NewBasicBlockNotAddUnSealed(name string) *BasicBlock
func (*Function) NewBasicBlockUnSealed ¶
func (f *Function) NewBasicBlockUnSealed(name string) *BasicBlock
func (*Function) NewErrorWithPos ¶
func (*Function) RemoveUser ¶
func (n *Function) RemoveUser(u User)
func (*Function) ReplaceVariable ¶ added in v1.2.8
func (*Function) ReturnValue ¶
func (*Function) SetBlock ¶ added in v1.2.8
func (a *Function) SetBlock(block *BasicBlock)
func (*Function) SetFunc ¶ added in v1.2.8
func (a *Function) SetFunc(f *Function)
ssa function and block
func (*Function) SetPosition ¶ added in v1.2.8
func (c *Function) SetPosition(pos *Position)
func (*Function) SetReg ¶
func (f *Function) SetReg(i Instruction)
func (*Function) SetSymbolTable ¶ added in v1.2.8
func (a *Function) SetSymbolTable(symbol *blockSymbolTable)
type FunctionAsmFlag ¶
type FunctionAsmFlag int
const ( DisAsmDefault FunctionAsmFlag = 1 << iota DisAsmWithSource )
type FunctionBuilder ¶
type FunctionBuilder struct { *Function // for build CurrentBlock *BasicBlock // current block to build CurrentPos *Position // current position in source code ExternInstance map[string]any ExternLib map[string]map[string]any // contains filtered or unexported fields }
Function builder API
func NewBuilder ¶
func NewBuilder(f *Function, parent *FunctionBuilder) *FunctionBuilder
func (*FunctionBuilder) AddDefer ¶
func (b *FunctionBuilder) AddDefer(call *Call)
add current function defer function
func (*FunctionBuilder) AddLabel ¶ added in v1.2.8
func (b *FunctionBuilder) AddLabel(name string, block *BasicBlock)
for goto and label
func (FunctionBuilder) AddLeftPositions ¶ added in v1.2.8
func (a FunctionBuilder) AddLeftPositions(pos *Position)
func (FunctionBuilder) AddLeftVariables ¶ added in v1.2.8
func (a FunctionBuilder) AddLeftVariables(name string)
func (*FunctionBuilder) AddSubFunction ¶ added in v1.2.8
func (b *FunctionBuilder) AddSubFunction(builder func())
sub-function builder
func (*FunctionBuilder) AddToCmap ¶ added in v1.2.8
func (b *FunctionBuilder) AddToCmap(key string)
func (*FunctionBuilder) AddToLmap ¶ added in v1.2.8
func (b *FunctionBuilder) AddToLmap(key string)
func (*FunctionBuilder) AddUnsealedBlock ¶ added in v1.2.8
func (b *FunctionBuilder) AddUnsealedBlock(block *BasicBlock)
func (*FunctionBuilder) BuildFreeValue ¶
func (b *FunctionBuilder) BuildFreeValue(variable string) Value
func (*FunctionBuilder) BuildIf ¶ added in v1.2.8
func (b *FunctionBuilder) BuildIf() *IfBuilder
func (*FunctionBuilder) BuildLoop ¶ added in v1.2.8
func (b *FunctionBuilder) BuildLoop() *LoopBuilder
func (*FunctionBuilder) BuildSwitch ¶ added in v1.2.8
func (b *FunctionBuilder) BuildSwitch() *SwitchBuilder
func (*FunctionBuilder) BuildTry ¶ added in v1.2.8
func (b *FunctionBuilder) BuildTry() *TryBuilder
func (*FunctionBuilder) BuildValueFromAny ¶ added in v1.2.8
func (b *FunctionBuilder) BuildValueFromAny(id string, v any) (value Value)
func (*FunctionBuilder) CanBuildFreeValue ¶
func (b *FunctionBuilder) CanBuildFreeValue(variable string) bool
func (*FunctionBuilder) CoverReflectFunctionType ¶ added in v1.2.8
func (f *FunctionBuilder) CoverReflectFunctionType(itype reflect.Type, level int) *FunctionType
func (*FunctionBuilder) CreateInterfaceWithVs ¶
func (b *FunctionBuilder) CreateInterfaceWithVs(keys []Value, vs []Value) *Make
func (*FunctionBuilder) DeleteLabel ¶ added in v1.2.8
func (b *FunctionBuilder) DeleteLabel(name string)
func (*FunctionBuilder) EmitAssert ¶ added in v1.2.8
func (f *FunctionBuilder) EmitAssert(cond, msgValue Value, msg string) *Assert
func (*FunctionBuilder) EmitBinOp ¶ added in v1.2.8
func (f *FunctionBuilder) EmitBinOp(op BinaryOpcode, x, y Value) Value
func (*FunctionBuilder) EmitCall ¶
func (f *FunctionBuilder) EmitCall(c *Call) *Call
func (*FunctionBuilder) EmitConstInst ¶ added in v1.2.8
func (f *FunctionBuilder) EmitConstInst(i any) *ConstInst
func (*FunctionBuilder) EmitConstInstAny ¶ added in v1.2.8
func (f *FunctionBuilder) EmitConstInstAny() *ConstInst
func (*FunctionBuilder) EmitConstInstNil ¶ added in v1.2.8
func (f *FunctionBuilder) EmitConstInstNil() *ConstInst
func (*FunctionBuilder) EmitConstInstWithUnary ¶ added in v1.2.8
func (f *FunctionBuilder) EmitConstInstWithUnary(i any, un int) *ConstInst
func (*FunctionBuilder) EmitErrorHandler ¶ added in v1.2.8
func (f *FunctionBuilder) EmitErrorHandler(try, catch *BasicBlock) *ErrorHandler
func (*FunctionBuilder) EmitField ¶
func (f *FunctionBuilder) EmitField(i, key Value) Value
func (*FunctionBuilder) EmitFieldMust ¶ added in v1.2.8
func (f *FunctionBuilder) EmitFieldMust(i, key Value) *Field
func (*FunctionBuilder) EmitIf ¶
func (f *FunctionBuilder) EmitIf(cond Value) *If
func (*FunctionBuilder) EmitInstructionAfter ¶ added in v1.2.8
func (f *FunctionBuilder) EmitInstructionAfter(i, after Instruction)
func (*FunctionBuilder) EmitInstructionBefore ¶ added in v1.2.8
func (f *FunctionBuilder) EmitInstructionBefore(i, before Instruction)
func (*FunctionBuilder) EmitJump ¶
func (f *FunctionBuilder) EmitJump(to *BasicBlock) *Jump
func (*FunctionBuilder) EmitLoop ¶ added in v1.2.8
func (f *FunctionBuilder) EmitLoop(body, exit *BasicBlock, cond Value) *Loop
func (*FunctionBuilder) EmitMakeBuildWithType ¶ added in v1.2.8
func (f *FunctionBuilder) EmitMakeBuildWithType(typ Type, Len, Cap Value) *Make
func (*FunctionBuilder) EmitMakeSlice ¶ added in v1.2.8
func (f *FunctionBuilder) EmitMakeSlice(i Value, low, high, max Value) *Make
func (*FunctionBuilder) EmitMakeWithoutType ¶ added in v1.2.8
func (f *FunctionBuilder) EmitMakeWithoutType(Len, Cap Value) *Make
func (*FunctionBuilder) EmitNext ¶ added in v1.2.8
func (f *FunctionBuilder) EmitNext(iter Value, isIn bool) (key, field, ok Value)
func (*FunctionBuilder) EmitNextOnly ¶ added in v1.2.8
func (f *FunctionBuilder) EmitNextOnly(iter Value, isIn bool) *Next
func (*FunctionBuilder) EmitOnly ¶ added in v1.2.9
func (f *FunctionBuilder) EmitOnly(i Instruction)
func (*FunctionBuilder) EmitPanic ¶ added in v1.2.8
func (f *FunctionBuilder) EmitPanic(info Value) *Panic
func (*FunctionBuilder) EmitRecover ¶ added in v1.2.8
func (f *FunctionBuilder) EmitRecover() *Recover
func (*FunctionBuilder) EmitReturn ¶
func (f *FunctionBuilder) EmitReturn(vs []Value) *Return
func (*FunctionBuilder) EmitSwitch ¶
func (f *FunctionBuilder) EmitSwitch(cond Value, defaultb *BasicBlock, label []SwitchLabel) *Switch
func (*FunctionBuilder) EmitToBlock ¶ added in v1.2.8
func (f *FunctionBuilder) EmitToBlock(i Instruction, block *BasicBlock)
func (*FunctionBuilder) EmitTypeCast ¶ added in v1.2.8
func (f *FunctionBuilder) EmitTypeCast(v Value, typ Type) *TypeCast
func (*FunctionBuilder) EmitTypeValue ¶ added in v1.2.8
func (f *FunctionBuilder) EmitTypeValue(typ Type) *TypeValue
func (*FunctionBuilder) EmitUnOp ¶ added in v1.2.8
func (f *FunctionBuilder) EmitUnOp(op UnaryOpcode, v Value) Value
func (*FunctionBuilder) EmitUndefine ¶ added in v1.2.8
func (f *FunctionBuilder) EmitUndefine(name string) *Undefined
func (*FunctionBuilder) EmitUpdate ¶ added in v1.2.8
func (f *FunctionBuilder) EmitUpdate(address, v Value) *Update
func (FunctionBuilder) GetBlock ¶ added in v1.2.8
func (a FunctionBuilder) GetBlock() *BasicBlock
func (*FunctionBuilder) GetBreak ¶
func (b *FunctionBuilder) GetBreak() *BasicBlock
func (*FunctionBuilder) GetContinue ¶
func (b *FunctionBuilder) GetContinue() *BasicBlock
func (*FunctionBuilder) GetFallthrough ¶
func (b *FunctionBuilder) GetFallthrough() *BasicBlock
func (*FunctionBuilder) GetFromCmap ¶ added in v1.2.8
func (b *FunctionBuilder) GetFromCmap(key string) bool
func (*FunctionBuilder) GetFromLmap ¶ added in v1.2.8
func (b *FunctionBuilder) GetFromLmap(key string) bool
func (*FunctionBuilder) GetIdByBlockSymbolTable ¶ added in v1.2.8
func (b *FunctionBuilder) GetIdByBlockSymbolTable(id string) string
func (*FunctionBuilder) GetLabel ¶ added in v1.2.8
func (b *FunctionBuilder) GetLabel(name string) *BasicBlock
func (FunctionBuilder) GetLeftItem ¶ added in v1.2.8
func (a FunctionBuilder) GetLeftItem() LeftInstruction
func (FunctionBuilder) GetLeftPosition ¶ added in v1.2.8
func (a FunctionBuilder) GetLeftPosition() *Position
func (FunctionBuilder) GetLeftPositions ¶ added in v1.2.8
func (a FunctionBuilder) GetLeftPositions() []*Position
left-instruction: left-position
func (FunctionBuilder) GetLeftVariables ¶ added in v1.2.8
func (a FunctionBuilder) GetLeftVariables() []string
left-instruction: variable
func (FunctionBuilder) GetOperand ¶ added in v1.2.8
func (FunctionBuilder) GetOperandNum ¶ added in v1.2.8
func (a FunctionBuilder) GetOperandNum() int
func (FunctionBuilder) GetOperands ¶ added in v1.2.8
func (a FunctionBuilder) GetOperands() Values
func (FunctionBuilder) GetParentBuilder ¶
func (b FunctionBuilder) GetParentBuilder() *FunctionBuilder
get parent function
func (FunctionBuilder) GetPosition ¶ added in v1.2.8
func (c FunctionBuilder) GetPosition() *Position
source code position
func (FunctionBuilder) GetSymbolTable ¶ added in v1.2.8
func (a FunctionBuilder) GetSymbolTable() *blockSymbolTable
symbol-table
func (FunctionBuilder) GetType ¶ added in v1.2.8
func (n FunctionBuilder) GetType() Type
for Value : type
func (FunctionBuilder) GetVariable ¶ added in v1.2.8
func (a FunctionBuilder) GetVariable() string
func (FunctionBuilder) HasLeftVariable ¶ added in v1.2.8
func (a FunctionBuilder) HasLeftVariable() bool
has left-instruction
func (FunctionBuilder) HasUsers ¶ added in v1.2.8
func (n FunctionBuilder) HasUsers() bool
has/get user and value
func (*FunctionBuilder) MapBlockSymbolTable ¶
func (b *FunctionBuilder) MapBlockSymbolTable(text string) string
use block symbol table map variable -> variable+blockId
func (*FunctionBuilder) NewBlockId ¶ added in v1.2.8
func (b *FunctionBuilder) NewBlockId() string
func (*FunctionBuilder) NewCall ¶
func (f *FunctionBuilder) NewCall(target Value, args []Value) *Call
func (*FunctionBuilder) NewError ¶
func (b *FunctionBuilder) NewError(kind ErrorKind, tag ErrorTag, format string, arg ...any)
func (*FunctionBuilder) NewFunc ¶
func (b *FunctionBuilder) NewFunc(name string) (*Function, *blockSymbolTable)
new function
func (*FunctionBuilder) PopBlockSymbolTable ¶
func (b *FunctionBuilder) PopBlockSymbolTable()
func (*FunctionBuilder) PopFunction ¶
func (b *FunctionBuilder) PopFunction() *FunctionBuilder
func (*FunctionBuilder) PopTarget ¶
func (b *FunctionBuilder) PopTarget() bool
func (*FunctionBuilder) PushBlockSymbolTable ¶
func (b *FunctionBuilder) PushBlockSymbolTable()
block symbol-table stack
func (*FunctionBuilder) PushFunction ¶
func (b *FunctionBuilder) PushFunction(newFunc *Function, symbol *blockSymbolTable, block *BasicBlock) *FunctionBuilder
function stack
func (*FunctionBuilder) PushTarget ¶
func (b *FunctionBuilder) PushTarget(_break, _continue, _fallthrough *BasicBlock)
target stack
func (*FunctionBuilder) ReadVariable ¶
func (b *FunctionBuilder) ReadVariable(variable string, create bool) Value
* first check builder.currentDef
* if block sealed; just create a phi * if len(block.preds) == 0: undefined * if len(block.preds) == 1: just recursive * if len(block.preds) > 1: create phi and builder
func (*FunctionBuilder) ReadVariableBefore ¶ added in v1.2.8
func (b *FunctionBuilder) ReadVariableBefore(variable string, create bool, before Instruction) Value
func (*FunctionBuilder) ReadVariableEx ¶ added in v1.2.8
func (b *FunctionBuilder) ReadVariableEx(variable string, create bool, fun func([]Value))
func (FunctionBuilder) RemoveUser ¶ added in v1.2.8
func (n FunctionBuilder) RemoveUser(u User)
func (FunctionBuilder) SetBlock ¶ added in v1.2.8
func (a FunctionBuilder) SetBlock(block *BasicBlock)
func (*FunctionBuilder) SetCurrent ¶ added in v1.2.8
func (f *FunctionBuilder) SetCurrent(i Instruction) func()
func (FunctionBuilder) SetFunc ¶ added in v1.2.8
func (a FunctionBuilder) SetFunc(f *Function)
ssa function and block
func (*FunctionBuilder) SetInstructionPosition ¶ added in v1.2.9
func (f *FunctionBuilder) SetInstructionPosition(i Instruction)
func (*FunctionBuilder) SetPosition ¶
func (b *FunctionBuilder) SetPosition(pos *Position) *Position
handler position: set new position and return original position for backup
func (FunctionBuilder) SetSymbolTable ¶ added in v1.2.8
func (a FunctionBuilder) SetSymbolTable(symbol *blockSymbolTable)
func (FunctionBuilder) SetVariable ¶ added in v1.2.8
func (a FunctionBuilder) SetVariable(v string)
variable
func (*FunctionBuilder) TryBuildExternValue ¶ added in v1.2.8
func (b *FunctionBuilder) TryBuildExternValue(id string) Value
func (*FunctionBuilder) TryGetSimilarityKey ¶ added in v1.2.8
func (b *FunctionBuilder) TryGetSimilarityKey(name, key string) string
func (*FunctionBuilder) WithExternLib ¶ added in v1.2.8
func (b *FunctionBuilder) WithExternLib(lib map[string]map[string]any)
func (*FunctionBuilder) WithExternMethod ¶ added in v1.2.9
func (b *FunctionBuilder) WithExternMethod(builder MethodBuilder)
func (*FunctionBuilder) WithExternValue ¶ added in v1.2.8
func (b *FunctionBuilder) WithExternValue(vs map[string]any)
func (*FunctionBuilder) WriteVariable ¶ added in v1.2.8
func (f *FunctionBuilder) WriteVariable(variable string, value Value)
--------------- `f.currentDef` handler, read && write
type FunctionType ¶ added in v1.2.8
type FunctionType struct { Name string ReturnType Type Parameter Types FreeValue []string SideEffects []string IsVariadic bool IsMethod bool IsModifySelf bool // if this is method function }
func GetMethod ¶ added in v1.2.9
func GetMethod(t Type, id string) *FunctionType
func NewFunctionType ¶ added in v1.2.8
func NewFunctionType(name string, Parameter []Type, ReturnType Type, IsVariadic bool) *FunctionType
func NewFunctionTypeDefine ¶ added in v1.2.9
func NewFunctionTypeDefine(name string, Parameter []Type, ReturnType []Type, IsVariadic bool) *FunctionType
func ToFunctionType ¶ added in v1.2.8
func ToFunctionType(t Type) (*FunctionType, bool)
func (*FunctionType) AddMethod ¶ added in v1.2.9
func (b *FunctionType) AddMethod(id string, f *FunctionType)
func (*FunctionType) GetMethod ¶ added in v1.2.8
func (f *FunctionType) GetMethod() map[string]*FunctionType
func (*FunctionType) GetParamString ¶ added in v1.2.8
func (s *FunctionType) GetParamString() string
func (*FunctionType) GetTypeKind ¶ added in v1.2.8
func (s *FunctionType) GetTypeKind() TypeKind
func (*FunctionType) RawString ¶ added in v1.2.8
func (s *FunctionType) RawString() string
func (*FunctionType) SetFreeValue ¶ added in v1.2.8
func (s *FunctionType) SetFreeValue(fv []string)
func (*FunctionType) SetMethod ¶ added in v1.2.8
func (f *FunctionType) SetMethod(m map[string]*FunctionType)
func (*FunctionType) SetModifySelf ¶ added in v1.2.9
func (f *FunctionType) SetModifySelf(b bool)
func (*FunctionType) SetName ¶ added in v1.2.8
func (s *FunctionType) SetName(name string)
func (*FunctionType) SetSideEffect ¶ added in v1.2.9
func (s *FunctionType) SetSideEffect(se []string)
func (*FunctionType) String ¶ added in v1.2.8
func (s *FunctionType) String() string
type IdentifierLV ¶
type IdentifierLV struct {
// contains filtered or unexported fields
}
--------------- only point variable to value with `f.currentDef` --------------- is SSA value
func NewIdentifierLV ¶ added in v1.2.8
func NewIdentifierLV(variable string, pos *Position) *IdentifierLV
func (*IdentifierLV) Assign ¶
func (i *IdentifierLV) Assign(v Value, f *FunctionBuilder)
func (*IdentifierLV) GetPosition ¶ added in v1.2.8
func (i *IdentifierLV) GetPosition() *Position
func (*IdentifierLV) GetValue ¶
func (i *IdentifierLV) GetValue(f *FunctionBuilder) Value
func (*IdentifierLV) SetIsSideEffect ¶ added in v1.2.9
func (i *IdentifierLV) SetIsSideEffect(b bool)
type If ¶
type If struct { Cond Value True *BasicBlock False *BasicBlock // contains filtered or unexported fields }
----------- IF The If instruction transfers control to one of the two successors of its owning block, depending on the boolean Cond: the first if true, the second if false.
func (*If) AddFalse ¶
func (i *If) AddFalse(f *BasicBlock)
func (*If) AddLeftPositions ¶ added in v1.2.8
func (a *If) AddLeftPositions(pos *Position)
func (*If) AddLeftVariables ¶ added in v1.2.8
func (a *If) AddLeftVariables(name string)
func (*If) AddTrue ¶
func (i *If) AddTrue(t *BasicBlock)
func (*If) GetBlock ¶
func (a *If) GetBlock() *BasicBlock
func (*If) GetLeftItem ¶ added in v1.2.8
func (a *If) GetLeftItem() LeftInstruction
func (*If) GetLeftPosition ¶ added in v1.2.8
func (a *If) GetLeftPosition() *Position
func (*If) GetLeftPositions ¶ added in v1.2.8
func (a *If) GetLeftPositions() []*Position
left-instruction: left-position
func (*If) GetLeftVariables ¶ added in v1.2.8
func (a *If) GetLeftVariables() []string
left-instruction: variable
func (*If) GetOperand ¶ added in v1.2.8
func (*If) GetOperandNum ¶ added in v1.2.8
func (a *If) GetOperandNum() int
func (*If) GetOperands ¶ added in v1.2.8
func (a *If) GetOperands() Values
func (*If) GetSymbolTable ¶ added in v1.2.8
func (a *If) GetSymbolTable() *blockSymbolTable
symbol-table
func (*If) GetVariable ¶ added in v1.2.8
func (a *If) GetVariable() string
func (*If) HasLeftVariable ¶ added in v1.2.8
func (a *If) HasLeftVariable() bool
has left-instruction
func (*If) LineDisasm ¶ added in v1.2.8
func (*If) ReplaceValue ¶
func (*If) SetBlock ¶ added in v1.2.8
func (a *If) SetBlock(block *BasicBlock)
func (*If) SetPosition ¶ added in v1.2.8
func (c *If) SetPosition(pos *Position)
func (*If) SetSymbolTable ¶ added in v1.2.8
func (a *If) SetSymbolTable(symbol *blockSymbolTable)
type IfBuilder ¶ added in v1.2.8
type IfBuilder struct {
// contains filtered or unexported fields
}
func (*IfBuilder) BuildChild ¶ added in v1.2.8
func (*IfBuilder) BuildCondition ¶ added in v1.2.8
func (*IfBuilder) BuildFalse ¶ added in v1.2.8
func (i *IfBuilder) BuildFalse(body func())
type InspectVariableResult ¶
func (*InspectVariableResult) Merge ¶
func (r *InspectVariableResult) Merge(other *InspectVariableResult)
type Instruction ¶
type Instruction interface { ErrorLogger LineDisasm() string GetOpcode() Opcode // function GetFunc() *Function SetFunc(*Function) // block GetBlock() *BasicBlock SetBlock(*BasicBlock) GetVariable() string SetVariable(variable string) // position GetPosition() *Position SetPosition(*Position) // symbol-table SetSymbolTable(*blockSymbolTable) GetSymbolTable() *blockSymbolTable // extern IsExtern() bool SetExtern(bool) // has left-value HasLeftVariable() bool }
type InstructionNode ¶ added in v1.2.8
type InstructionNode interface { Node Instruction }
type InstructionNodes ¶ added in v1.2.8
type InstructionNodes []InstructionNode
type InterfaceType ¶
type InterfaceType struct {
// contains filtered or unexported fields
}
====================== interface type
func NewInterfaceType ¶
func NewInterfaceType(name string) *InterfaceType
func (*InterfaceType) AddMethod ¶ added in v1.2.9
func (b *InterfaceType) AddMethod(id string, f *FunctionType)
func (*InterfaceType) GetMethod ¶ added in v1.2.8
func (i *InterfaceType) GetMethod() map[string]*FunctionType
func (*InterfaceType) GetTypeKind ¶ added in v1.2.8
func (i *InterfaceType) GetTypeKind() TypeKind
func (*InterfaceType) RawString ¶ added in v1.2.8
func (i *InterfaceType) RawString() string
func (*InterfaceType) SetMethod ¶ added in v1.2.8
func (i *InterfaceType) SetMethod(m map[string]*FunctionType)
func (*InterfaceType) String ¶
func (i *InterfaceType) String() string
type Jump ¶
type Jump struct { To *BasicBlock // contains filtered or unexported fields }
----------- Jump The Jump instruction transfers control to the sole successor of its owning block.
the block containing Jump instruction only have one successor block
func NewJump ¶ added in v1.2.8
func NewJump(to *BasicBlock) *Jump
func (*Jump) AddLeftPositions ¶ added in v1.2.8
func (a *Jump) AddLeftPositions(pos *Position)
func (*Jump) AddLeftVariables ¶ added in v1.2.8
func (a *Jump) AddLeftVariables(name string)
func (*Jump) GetBlock ¶
func (a *Jump) GetBlock() *BasicBlock
func (*Jump) GetLeftItem ¶ added in v1.2.8
func (a *Jump) GetLeftItem() LeftInstruction
func (*Jump) GetLeftPosition ¶ added in v1.2.8
func (a *Jump) GetLeftPosition() *Position
func (*Jump) GetLeftPositions ¶ added in v1.2.8
func (a *Jump) GetLeftPositions() []*Position
left-instruction: left-position
func (*Jump) GetLeftVariables ¶ added in v1.2.8
func (a *Jump) GetLeftVariables() []string
left-instruction: variable
func (*Jump) GetOperand ¶ added in v1.2.8
func (*Jump) GetOperandNum ¶ added in v1.2.8
func (a *Jump) GetOperandNum() int
func (*Jump) GetOperands ¶ added in v1.2.8
func (a *Jump) GetOperands() Values
func (*Jump) GetPosition ¶ added in v1.2.8
func (c *Jump) GetPosition() *Position
source code position
func (*Jump) GetSymbolTable ¶ added in v1.2.8
func (a *Jump) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Jump) GetVariable ¶ added in v1.2.8
func (a *Jump) GetVariable() string
func (*Jump) HasLeftVariable ¶ added in v1.2.8
func (a *Jump) HasLeftVariable() bool
has left-instruction
func (*Jump) LineDisasm ¶ added in v1.2.8
func (*Jump) SetBlock ¶ added in v1.2.8
func (a *Jump) SetBlock(block *BasicBlock)
func (*Jump) SetPosition ¶ added in v1.2.8
func (c *Jump) SetPosition(pos *Position)
func (*Jump) SetSymbolTable ¶ added in v1.2.8
func (a *Jump) SetSymbolTable(symbol *blockSymbolTable)
type LeftInstruction ¶ added in v1.2.8
type LeftInstruction interface { // Instruction // variable GetLeftVariables() []string AddLeftVariables(variable string) // must // left-value position // get all left position GetLeftPositions() []*Position // get last left position GetLeftPosition() *Position AddLeftPositions(*Position) // add left position }
type LeftValue ¶
type LeftValue interface { Assign(Value, *FunctionBuilder) GetPosition() *Position GetValue(*FunctionBuilder) Value }
--------------- for assign
type Loop ¶ added in v1.2.8
type Loop struct {
Body, Exit *BasicBlock
Init, Cond, Step Value
Key Value
// contains filtered or unexported fields
}
----------- For for loop
func (*Loop) AddLeftPositions ¶ added in v1.2.8
func (a *Loop) AddLeftPositions(pos *Position)
func (*Loop) AddLeftVariables ¶ added in v1.2.8
func (a *Loop) AddLeftVariables(name string)
func (*Loop) GetBlock ¶ added in v1.2.8
func (a *Loop) GetBlock() *BasicBlock
func (*Loop) GetLeftItem ¶ added in v1.2.8
func (a *Loop) GetLeftItem() LeftInstruction
func (*Loop) GetLeftPosition ¶ added in v1.2.8
func (a *Loop) GetLeftPosition() *Position
func (*Loop) GetLeftPositions ¶ added in v1.2.8
func (a *Loop) GetLeftPositions() []*Position
left-instruction: left-position
func (*Loop) GetLeftVariables ¶ added in v1.2.8
func (a *Loop) GetLeftVariables() []string
left-instruction: variable
func (*Loop) GetOperand ¶ added in v1.2.8
func (*Loop) GetOperandNum ¶ added in v1.2.8
func (a *Loop) GetOperandNum() int
func (*Loop) GetOperands ¶ added in v1.2.8
func (a *Loop) GetOperands() Values
func (*Loop) GetPosition ¶ added in v1.2.8
func (c *Loop) GetPosition() *Position
source code position
func (*Loop) GetSymbolTable ¶ added in v1.2.8
func (a *Loop) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Loop) GetVariable ¶ added in v1.2.8
func (a *Loop) GetVariable() string
func (*Loop) HasLeftVariable ¶ added in v1.2.8
func (a *Loop) HasLeftVariable() bool
has left-instruction
func (*Loop) LineDisasm ¶ added in v1.2.8
func (*Loop) ReplaceValue ¶ added in v1.2.8
func (*Loop) SetBlock ¶ added in v1.2.8
func (a *Loop) SetBlock(block *BasicBlock)
func (*Loop) SetPosition ¶ added in v1.2.8
func (c *Loop) SetPosition(pos *Position)
func (*Loop) SetSymbolTable ¶ added in v1.2.8
func (a *Loop) SetSymbolTable(symbol *blockSymbolTable)
type LoopBuilder ¶ added in v1.2.8
type LoopBuilder struct {
// contains filtered or unexported fields
}
func (*LoopBuilder) BuildBody ¶ added in v1.2.8
func (lb *LoopBuilder) BuildBody(f func())
func (*LoopBuilder) BuildCondition ¶ added in v1.2.8
func (lb *LoopBuilder) BuildCondition(f func() Value)
func (*LoopBuilder) BuildFirstExpr ¶ added in v1.2.8
func (lb *LoopBuilder) BuildFirstExpr(f func() []Value)
func (*LoopBuilder) BuildThird ¶ added in v1.2.8
func (lb *LoopBuilder) BuildThird(f func() []Value)
func (*LoopBuilder) Finish ¶ added in v1.2.8
func (lb *LoopBuilder) Finish()
type Make ¶ added in v1.2.8
type Make struct {
// when slice or map
Len, Cap Value
// contains filtered or unexported fields
}
----------- Make
func (*Make) AddLeftPositions ¶ added in v1.2.8
func (a *Make) AddLeftPositions(pos *Position)
func (*Make) AddLeftVariables ¶ added in v1.2.8
func (a *Make) AddLeftVariables(name string)
func (*Make) GetBlock ¶ added in v1.2.8
func (a *Make) GetBlock() *BasicBlock
func (*Make) GetLeftItem ¶ added in v1.2.8
func (a *Make) GetLeftItem() LeftInstruction
func (*Make) GetLeftPosition ¶ added in v1.2.8
func (a *Make) GetLeftPosition() *Position
func (*Make) GetLeftPositions ¶ added in v1.2.8
func (a *Make) GetLeftPositions() []*Position
left-instruction: left-position
func (*Make) GetLeftVariables ¶ added in v1.2.8
func (a *Make) GetLeftVariables() []string
left-instruction: variable
func (*Make) GetOperand ¶ added in v1.2.8
func (*Make) GetOperandNum ¶ added in v1.2.8
func (a *Make) GetOperandNum() int
func (*Make) GetOperands ¶ added in v1.2.8
func (a *Make) GetOperands() Values
func (*Make) GetPosition ¶ added in v1.2.8
func (c *Make) GetPosition() *Position
source code position
func (*Make) GetSymbolTable ¶ added in v1.2.8
func (a *Make) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Make) GetVariable ¶ added in v1.2.8
func (a *Make) GetVariable() string
func (*Make) HasLeftVariable ¶ added in v1.2.8
func (a *Make) HasLeftVariable() bool
has left-instruction
func (*Make) LineDisasm ¶ added in v1.2.8
func (*Make) RemoveUser ¶ added in v1.2.8
func (n *Make) RemoveUser(u User)
func (*Make) ReplaceValue ¶ added in v1.2.8
func (*Make) SetBlock ¶ added in v1.2.8
func (a *Make) SetBlock(block *BasicBlock)
func (*Make) SetPosition ¶ added in v1.2.8
func (c *Make) SetPosition(pos *Position)
func (*Make) SetSymbolTable ¶ added in v1.2.8
func (a *Make) SetSymbolTable(symbol *blockSymbolTable)
type MethodBuilder ¶ added in v1.2.9
type MethodBuilder interface { Build(Type, string) *FunctionType GetMethodNames(Type) []string }
var ExternMethodBuilder MethodBuilder
type Next ¶ added in v1.2.8
type Next struct { Iter Value InNext bool // "in" grammar // contains filtered or unexported fields }
------------- Next
func (*Next) AddLeftPositions ¶ added in v1.2.8
func (a *Next) AddLeftPositions(pos *Position)
func (*Next) AddLeftVariables ¶ added in v1.2.8
func (a *Next) AddLeftVariables(name string)
func (*Next) GetBlock ¶ added in v1.2.8
func (a *Next) GetBlock() *BasicBlock
func (*Next) GetLeftItem ¶ added in v1.2.8
func (a *Next) GetLeftItem() LeftInstruction
func (*Next) GetLeftPosition ¶ added in v1.2.8
func (a *Next) GetLeftPosition() *Position
func (*Next) GetLeftPositions ¶ added in v1.2.8
func (a *Next) GetLeftPositions() []*Position
left-instruction: left-position
func (*Next) GetLeftVariables ¶ added in v1.2.8
func (a *Next) GetLeftVariables() []string
left-instruction: variable
func (*Next) GetOperand ¶ added in v1.2.8
func (*Next) GetOperandNum ¶ added in v1.2.8
func (a *Next) GetOperandNum() int
func (*Next) GetOperands ¶ added in v1.2.8
func (a *Next) GetOperands() Values
func (*Next) GetPosition ¶ added in v1.2.8
func (c *Next) GetPosition() *Position
source code position
func (*Next) GetSymbolTable ¶ added in v1.2.8
func (a *Next) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Next) GetVariable ¶ added in v1.2.8
func (a *Next) GetVariable() string
func (*Next) HasLeftVariable ¶ added in v1.2.8
func (a *Next) HasLeftVariable() bool
has left-instruction
func (*Next) LineDisasm ¶ added in v1.2.8
func (*Next) RemoveUser ¶ added in v1.2.8
func (n *Next) RemoveUser(u User)
func (*Next) ReplaceValue ¶ added in v1.2.8
func (*Next) SetBlock ¶ added in v1.2.8
func (a *Next) SetBlock(block *BasicBlock)
func (*Next) SetPosition ¶ added in v1.2.8
func (c *Next) SetPosition(pos *Position)
func (*Next) SetSymbolTable ¶ added in v1.2.8
func (a *Next) SetSymbolTable(symbol *blockSymbolTable)
type Node ¶
type Node interface { // string String() string // for graph HasUsers() bool GetUsers() Users HasValues() bool GetValues() Values }
data-flow
type ObjectType ¶ added in v1.2.8
type ObjectType struct { Name string Kind TypeKind Len int Key []Value FieldTypes []Type AnonymousField []*ObjectType Combination bool // function multiple return will combined to struct KeyTyp Type FieldType Type // contains filtered or unexported fields }
==================== interface type
var NextType *ObjectType = nil
func NewMapType ¶
func NewMapType(key, field Type) *ObjectType
func NewObjectType ¶ added in v1.2.8
func NewObjectType() *ObjectType
func NewStructType ¶ added in v1.2.8
func NewStructType() *ObjectType
func ToObjectType ¶ added in v1.2.8
func ToObjectType(t Type) (*ObjectType, bool)
func (*ObjectType) AddField ¶ added in v1.2.8
func (s *ObjectType) AddField(key Value, field Type)
for struct build
func (*ObjectType) AddMethod ¶ added in v1.2.9
func (b *ObjectType) AddMethod(id string, f *FunctionType)
func (*ObjectType) Finish ¶ added in v1.2.8
func (s *ObjectType) Finish()
===================== Finish simply
func (*ObjectType) GetField ¶ added in v1.2.8
func (s *ObjectType) GetField(key Value) Type
return (field-type, key-type)
func (*ObjectType) GetMethod ¶ added in v1.2.8
func (i *ObjectType) GetMethod() map[string]*FunctionType
func (*ObjectType) GetTypeKind ¶ added in v1.2.8
func (i *ObjectType) GetTypeKind() TypeKind
func (ObjectType) RawString ¶ added in v1.2.8
func (itype ObjectType) RawString() string
func (*ObjectType) SetMethod ¶ added in v1.2.8
func (i *ObjectType) SetMethod(m map[string]*FunctionType)
func (*ObjectType) SetName ¶ added in v1.2.8
func (i *ObjectType) SetName(name string)
func (ObjectType) String ¶ added in v1.2.8
func (itype ObjectType) String() string
type Package ¶
type Package struct { Name string // point to program Prog *Program // function list Funcs []*Function }
func NewPackage ¶ added in v1.2.8
func (*Package) NewFunction ¶
type Panic ¶ added in v1.2.8
type Panic struct { Info Value // contains filtered or unexported fields }
-------------- PANIC
func (*Panic) AddLeftPositions ¶ added in v1.2.8
func (a *Panic) AddLeftPositions(pos *Position)
func (*Panic) AddLeftVariables ¶ added in v1.2.8
func (a *Panic) AddLeftVariables(name string)
func (*Panic) GetBlock ¶ added in v1.2.8
func (a *Panic) GetBlock() *BasicBlock
func (*Panic) GetLeftItem ¶ added in v1.2.8
func (a *Panic) GetLeftItem() LeftInstruction
func (*Panic) GetLeftPosition ¶ added in v1.2.8
func (a *Panic) GetLeftPosition() *Position
func (*Panic) GetLeftPositions ¶ added in v1.2.8
func (a *Panic) GetLeftPositions() []*Position
left-instruction: left-position
func (*Panic) GetLeftVariables ¶ added in v1.2.8
func (a *Panic) GetLeftVariables() []string
left-instruction: variable
func (*Panic) GetOperand ¶ added in v1.2.8
func (*Panic) GetOperandNum ¶ added in v1.2.8
func (a *Panic) GetOperandNum() int
func (*Panic) GetOperands ¶ added in v1.2.8
func (a *Panic) GetOperands() Values
func (*Panic) GetPosition ¶ added in v1.2.8
func (c *Panic) GetPosition() *Position
source code position
func (*Panic) GetSymbolTable ¶ added in v1.2.8
func (a *Panic) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Panic) GetVariable ¶ added in v1.2.8
func (a *Panic) GetVariable() string
func (*Panic) HasLeftVariable ¶ added in v1.2.8
func (a *Panic) HasLeftVariable() bool
has left-instruction
func (*Panic) LineDisasm ¶ added in v1.2.8
func (*Panic) RemoveUser ¶ added in v1.2.8
func (n *Panic) RemoveUser(u User)
func (*Panic) ReplaceValue ¶ added in v1.2.8
func (*Panic) SetBlock ¶ added in v1.2.8
func (a *Panic) SetBlock(block *BasicBlock)
func (*Panic) SetPosition ¶ added in v1.2.8
func (c *Panic) SetPosition(pos *Position)
func (*Panic) SetSymbolTable ¶ added in v1.2.8
func (a *Panic) SetSymbolTable(symbol *blockSymbolTable)
type Parameter ¶
type Parameter struct { IsFreeValue bool // for extern lib BuildField func(string) Value //TODO: is modify , not cover IsModify bool // contains filtered or unexported fields }
----------- Parameter
func ToParameter ¶ added in v1.2.8
func ToParameter(v Instruction) (*Parameter, bool)
func (*Parameter) AddLeftPositions ¶ added in v1.2.8
func (a *Parameter) AddLeftPositions(pos *Position)
func (*Parameter) AddLeftVariables ¶ added in v1.2.8
func (a *Parameter) AddLeftVariables(name string)
func (*Parameter) GetBlock ¶ added in v1.2.8
func (a *Parameter) GetBlock() *BasicBlock
func (*Parameter) GetLeftItem ¶ added in v1.2.8
func (a *Parameter) GetLeftItem() LeftInstruction
func (*Parameter) GetLeftPosition ¶ added in v1.2.8
func (a *Parameter) GetLeftPosition() *Position
func (*Parameter) GetLeftPositions ¶ added in v1.2.8
func (a *Parameter) GetLeftPositions() []*Position
left-instruction: left-position
func (*Parameter) GetLeftVariables ¶ added in v1.2.8
func (a *Parameter) GetLeftVariables() []string
left-instruction: variable
func (*Parameter) GetOperand ¶ added in v1.2.8
func (*Parameter) GetOperandNum ¶ added in v1.2.8
func (a *Parameter) GetOperandNum() int
func (*Parameter) GetOperands ¶ added in v1.2.8
func (a *Parameter) GetOperands() Values
func (*Parameter) GetPosition ¶ added in v1.2.8
func (c *Parameter) GetPosition() *Position
source code position
func (*Parameter) GetSymbolTable ¶ added in v1.2.8
func (a *Parameter) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Parameter) GetVariable ¶ added in v1.2.8
func (a *Parameter) GetVariable() string
func (*Parameter) HasLeftVariable ¶ added in v1.2.8
func (a *Parameter) HasLeftVariable() bool
has left-instruction
func (*Parameter) HasUsers ¶ added in v1.2.8
func (n *Parameter) HasUsers() bool
has/get user and value
func (*Parameter) LineDisasm ¶ added in v1.2.8
func (*Parameter) RemoveUser ¶
func (n *Parameter) RemoveUser(u User)
func (*Parameter) SetBlock ¶ added in v1.2.8
func (a *Parameter) SetBlock(block *BasicBlock)
func (*Parameter) SetDefault ¶ added in v1.2.8
func (*Parameter) SetFunc ¶ added in v1.2.8
func (a *Parameter) SetFunc(f *Function)
ssa function and block
func (*Parameter) SetPosition ¶ added in v1.2.8
func (c *Parameter) SetPosition(pos *Position)
func (*Parameter) SetSymbolTable ¶ added in v1.2.8
func (a *Parameter) SetSymbolTable(symbol *blockSymbolTable)
type Phi ¶
type Phi struct { Edge []Value // edge[i] from phi.Block.Preds[i] // contains filtered or unexported fields }
----------- Phi
func ToPhi ¶ added in v1.2.8
func ToPhi(v Instruction) (*Phi, bool)
func (*Phi) AddLeftPositions ¶ added in v1.2.8
func (a *Phi) AddLeftPositions(pos *Position)
func (*Phi) AddLeftVariables ¶ added in v1.2.8
func (a *Phi) AddLeftVariables(name string)
func (*Phi) GetBlock ¶
func (a *Phi) GetBlock() *BasicBlock
func (*Phi) GetLeftItem ¶ added in v1.2.8
func (a *Phi) GetLeftItem() LeftInstruction
func (*Phi) GetLeftPosition ¶ added in v1.2.8
func (a *Phi) GetLeftPosition() *Position
func (*Phi) GetLeftPositions ¶ added in v1.2.8
func (a *Phi) GetLeftPositions() []*Position
left-instruction: left-position
func (*Phi) GetLeftVariables ¶ added in v1.2.8
func (a *Phi) GetLeftVariables() []string
left-instruction: variable
func (*Phi) GetOperand ¶ added in v1.2.8
func (*Phi) GetOperandNum ¶ added in v1.2.8
func (a *Phi) GetOperandNum() int
func (*Phi) GetOperands ¶ added in v1.2.8
func (a *Phi) GetOperands() Values
func (*Phi) GetPosition ¶ added in v1.2.8
func (c *Phi) GetPosition() *Position
source code position
func (*Phi) GetSymbolTable ¶ added in v1.2.8
func (a *Phi) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Phi) GetVariable ¶ added in v1.2.8
func (a *Phi) GetVariable() string
func (*Phi) HasLeftVariable ¶ added in v1.2.8
func (a *Phi) HasLeftVariable() bool
has left-instruction
func (*Phi) LineDisasm ¶ added in v1.2.8
func (*Phi) RemoveUser ¶
func (n *Phi) RemoveUser(u User)
func (*Phi) ReplaceValue ¶
func (*Phi) SetBlock ¶ added in v1.2.8
func (a *Phi) SetBlock(block *BasicBlock)
func (*Phi) SetPosition ¶ added in v1.2.8
func (c *Phi) SetPosition(pos *Position)
func (*Phi) SetSymbolTable ¶ added in v1.2.8
func (a *Phi) SetSymbolTable(symbol *blockSymbolTable)
type Program ¶
type Program struct { // package list Packages []*Package // contains filtered or unexported fields }
both instruction and value
func NewProgram ¶
func NewProgram() *Program
func (*Program) AddPackage ¶ added in v1.2.8
func (*Program) InspectVariable ¶
func (p *Program) InspectVariable(varName string) *InspectVariableResult
func (*Program) InspectVariableLast ¶ added in v1.2.8
func (p *Program) InspectVariableLast(varName string) *InspectVariableResult
func (*Program) ShowWithSource ¶
func (p *Program) ShowWithSource()
type Recover ¶ added in v1.2.8
type Recover struct {
// contains filtered or unexported fields
}
--------------- RECOVER
func (*Recover) AddLeftPositions ¶ added in v1.2.8
func (a *Recover) AddLeftPositions(pos *Position)
func (*Recover) AddLeftVariables ¶ added in v1.2.8
func (a *Recover) AddLeftVariables(name string)
func (*Recover) GetBlock ¶ added in v1.2.8
func (a *Recover) GetBlock() *BasicBlock
func (*Recover) GetLeftItem ¶ added in v1.2.8
func (a *Recover) GetLeftItem() LeftInstruction
func (*Recover) GetLeftPosition ¶ added in v1.2.8
func (a *Recover) GetLeftPosition() *Position
func (*Recover) GetLeftPositions ¶ added in v1.2.8
func (a *Recover) GetLeftPositions() []*Position
left-instruction: left-position
func (*Recover) GetLeftVariables ¶ added in v1.2.8
func (a *Recover) GetLeftVariables() []string
left-instruction: variable
func (*Recover) GetOperand ¶ added in v1.2.8
func (*Recover) GetOperandNum ¶ added in v1.2.8
func (a *Recover) GetOperandNum() int
func (*Recover) GetOperands ¶ added in v1.2.8
func (a *Recover) GetOperands() Values
func (*Recover) GetPosition ¶ added in v1.2.8
func (c *Recover) GetPosition() *Position
source code position
func (*Recover) GetSymbolTable ¶ added in v1.2.8
func (a *Recover) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Recover) GetVariable ¶ added in v1.2.8
func (a *Recover) GetVariable() string
func (*Recover) HasLeftVariable ¶ added in v1.2.8
func (a *Recover) HasLeftVariable() bool
has left-instruction
func (*Recover) LineDisasm ¶ added in v1.2.8
func (*Recover) RemoveUser ¶ added in v1.2.8
func (n *Recover) RemoveUser(u User)
func (*Recover) SetBlock ¶ added in v1.2.8
func (a *Recover) SetBlock(block *BasicBlock)
func (*Recover) SetFunc ¶ added in v1.2.8
func (a *Recover) SetFunc(f *Function)
ssa function and block
func (*Recover) SetPosition ¶ added in v1.2.8
func (c *Recover) SetPosition(pos *Position)
func (*Recover) SetSymbolTable ¶ added in v1.2.8
func (a *Recover) SetSymbolTable(symbol *blockSymbolTable)
type Return ¶
type Return struct { Results []Value // contains filtered or unexported fields }
----------- Return The Return instruction returns values and control back to the calling function.
func (*Return) AddLeftPositions ¶ added in v1.2.8
func (a *Return) AddLeftPositions(pos *Position)
func (*Return) AddLeftVariables ¶ added in v1.2.8
func (a *Return) AddLeftVariables(name string)
func (*Return) GetBlock ¶
func (a *Return) GetBlock() *BasicBlock
func (*Return) GetLeftItem ¶ added in v1.2.8
func (a *Return) GetLeftItem() LeftInstruction
func (*Return) GetLeftPosition ¶ added in v1.2.8
func (a *Return) GetLeftPosition() *Position
func (*Return) GetLeftPositions ¶ added in v1.2.8
func (a *Return) GetLeftPositions() []*Position
left-instruction: left-position
func (*Return) GetLeftVariables ¶ added in v1.2.8
func (a *Return) GetLeftVariables() []string
left-instruction: variable
func (*Return) GetOperand ¶ added in v1.2.8
func (*Return) GetOperandNum ¶ added in v1.2.8
func (a *Return) GetOperandNum() int
func (*Return) GetOperands ¶ added in v1.2.8
func (a *Return) GetOperands() Values
func (*Return) GetPosition ¶ added in v1.2.8
func (c *Return) GetPosition() *Position
source code position
func (*Return) GetSymbolTable ¶ added in v1.2.8
func (a *Return) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Return) GetVariable ¶ added in v1.2.8
func (a *Return) GetVariable() string
func (*Return) HasLeftVariable ¶ added in v1.2.8
func (a *Return) HasLeftVariable() bool
has left-instruction
func (*Return) LineDisasm ¶ added in v1.2.8
func (*Return) RemoveUser ¶ added in v1.2.9
func (n *Return) RemoveUser(u User)
func (*Return) ReplaceValue ¶
func (*Return) SetBlock ¶ added in v1.2.8
func (a *Return) SetBlock(block *BasicBlock)
func (*Return) SetFunc ¶ added in v1.2.8
func (a *Return) SetFunc(f *Function)
ssa function and block
func (*Return) SetPosition ¶ added in v1.2.8
func (c *Return) SetPosition(pos *Position)
func (*Return) SetSymbolTable ¶ added in v1.2.8
func (a *Return) SetSymbolTable(symbol *blockSymbolTable)
type SSAError ¶
type SideEffect ¶ added in v1.2.9
type SideEffect struct {
// contains filtered or unexported fields
}
----------- SideEffect
func NewSideEffect ¶ added in v1.2.9
func NewSideEffect(variable string, target Value) *SideEffect
func (*SideEffect) AddLeftPositions ¶ added in v1.2.9
func (a *SideEffect) AddLeftPositions(pos *Position)
func (*SideEffect) AddLeftVariables ¶ added in v1.2.9
func (a *SideEffect) AddLeftVariables(name string)
func (*SideEffect) GetBlock ¶ added in v1.2.9
func (a *SideEffect) GetBlock() *BasicBlock
func (*SideEffect) GetLeftItem ¶ added in v1.2.9
func (a *SideEffect) GetLeftItem() LeftInstruction
func (*SideEffect) GetLeftPosition ¶ added in v1.2.9
func (a *SideEffect) GetLeftPosition() *Position
func (*SideEffect) GetLeftPositions ¶ added in v1.2.9
func (a *SideEffect) GetLeftPositions() []*Position
left-instruction: left-position
func (*SideEffect) GetLeftVariables ¶ added in v1.2.9
func (a *SideEffect) GetLeftVariables() []string
left-instruction: variable
func (*SideEffect) GetOpcode ¶ added in v1.2.9
func (i *SideEffect) GetOpcode() Opcode
func (*SideEffect) GetOperand ¶ added in v1.2.9
func (*SideEffect) GetOperandNum ¶ added in v1.2.9
func (a *SideEffect) GetOperandNum() int
func (*SideEffect) GetOperands ¶ added in v1.2.9
func (a *SideEffect) GetOperands() Values
func (*SideEffect) GetPosition ¶ added in v1.2.9
func (c *SideEffect) GetPosition() *Position
source code position
func (*SideEffect) GetSymbolTable ¶ added in v1.2.9
func (a *SideEffect) GetSymbolTable() *blockSymbolTable
symbol-table
func (*SideEffect) GetValues ¶ added in v1.2.9
func (s *SideEffect) GetValues() Values
func (*SideEffect) GetVariable ¶ added in v1.2.9
func (a *SideEffect) GetVariable() string
func (*SideEffect) HasLeftVariable ¶ added in v1.2.9
func (a *SideEffect) HasLeftVariable() bool
has left-instruction
func (*SideEffect) HasUsers ¶ added in v1.2.9
func (n *SideEffect) HasUsers() bool
has/get user and value
func (*SideEffect) HasValues ¶ added in v1.2.9
func (s *SideEffect) HasValues() bool
------------ SideEffect
func (*SideEffect) LineDisasm ¶ added in v1.2.9
func (s *SideEffect) LineDisasm() string
func (*SideEffect) RemoveUser ¶ added in v1.2.9
func (n *SideEffect) RemoveUser(u User)
func (*SideEffect) ReplaceValue ¶ added in v1.2.9
func (s *SideEffect) ReplaceValue(v Value, to Value)
func (*SideEffect) SetBlock ¶ added in v1.2.9
func (a *SideEffect) SetBlock(block *BasicBlock)
func (*SideEffect) SetFunc ¶ added in v1.2.9
func (a *SideEffect) SetFunc(f *Function)
ssa function and block
func (*SideEffect) SetPosition ¶ added in v1.2.9
func (c *SideEffect) SetPosition(pos *Position)
func (*SideEffect) SetSymbolTable ¶ added in v1.2.9
func (a *SideEffect) SetSymbolTable(symbol *blockSymbolTable)
func (*SideEffect) SetVariable ¶ added in v1.2.9
func (a *SideEffect) SetVariable(v string)
variable
func (*SideEffect) String ¶ added in v1.2.9
func (s *SideEffect) String() string
type Switch ¶
type Switch struct { Cond Value DefaultBlock *BasicBlock Label []SwitchLabel // contains filtered or unexported fields }
func NewSwitch ¶ added in v1.2.8
func NewSwitch(cond Value, defaultb *BasicBlock, label []SwitchLabel) *Switch
func (*Switch) AddLeftPositions ¶ added in v1.2.8
func (a *Switch) AddLeftPositions(pos *Position)
func (*Switch) AddLeftVariables ¶ added in v1.2.8
func (a *Switch) AddLeftVariables(name string)
func (*Switch) GetBlock ¶
func (a *Switch) GetBlock() *BasicBlock
func (*Switch) GetLeftItem ¶ added in v1.2.8
func (a *Switch) GetLeftItem() LeftInstruction
func (*Switch) GetLeftPosition ¶ added in v1.2.8
func (a *Switch) GetLeftPosition() *Position
func (*Switch) GetLeftPositions ¶ added in v1.2.8
func (a *Switch) GetLeftPositions() []*Position
left-instruction: left-position
func (*Switch) GetLeftVariables ¶ added in v1.2.8
func (a *Switch) GetLeftVariables() []string
left-instruction: variable
func (*Switch) GetOperand ¶ added in v1.2.8
func (*Switch) GetOperandNum ¶ added in v1.2.8
func (a *Switch) GetOperandNum() int
func (*Switch) GetOperands ¶ added in v1.2.8
func (a *Switch) GetOperands() Values
func (*Switch) GetPosition ¶ added in v1.2.8
func (c *Switch) GetPosition() *Position
source code position
func (*Switch) GetSymbolTable ¶ added in v1.2.8
func (a *Switch) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Switch) GetVariable ¶ added in v1.2.8
func (a *Switch) GetVariable() string
func (*Switch) HasLeftVariable ¶ added in v1.2.8
func (a *Switch) HasLeftVariable() bool
has left-instruction
func (Switch) LineDisasm ¶ added in v1.2.8
func (*Switch) ReplaceValue ¶
func (*Switch) SetBlock ¶ added in v1.2.8
func (a *Switch) SetBlock(block *BasicBlock)
func (*Switch) SetFunc ¶ added in v1.2.8
func (a *Switch) SetFunc(f *Function)
ssa function and block
func (*Switch) SetPosition ¶ added in v1.2.8
func (c *Switch) SetPosition(pos *Position)
func (*Switch) SetSymbolTable ¶ added in v1.2.8
func (a *Switch) SetSymbolTable(symbol *blockSymbolTable)
type SwitchBuilder ¶ added in v1.2.8
type SwitchBuilder struct { DefaultBreak bool // contains filtered or unexported fields }
func (*SwitchBuilder) BuildBody ¶ added in v1.2.8
func (t *SwitchBuilder) BuildBody(f func(int))
func (*SwitchBuilder) BuildCondition ¶ added in v1.2.8
func (t *SwitchBuilder) BuildCondition(f func() Value)
func (*SwitchBuilder) BuildDefault ¶ added in v1.2.8
func (t *SwitchBuilder) BuildDefault(f func())
func (*SwitchBuilder) BuildHandler ¶ added in v1.2.9
func (t *SwitchBuilder) BuildHandler(f func() (int, []Value))
func (*SwitchBuilder) Finish ¶ added in v1.2.9
func (t *SwitchBuilder) Finish()
type SwitchLabel ¶
type SwitchLabel struct { Value Value Dest *BasicBlock }
----------- Switch
func NewSwitchLabel ¶
func NewSwitchLabel(v Value, dest *BasicBlock) SwitchLabel
type TryBuilder ¶ added in v1.2.8
type TryBuilder struct {
// contains filtered or unexported fields
}
func (*TryBuilder) BuildCatch ¶ added in v1.2.8
func (t *TryBuilder) BuildCatch(f func())
func (*TryBuilder) BuildError ¶ added in v1.2.9
func (t *TryBuilder) BuildError(f func() string)
func (*TryBuilder) BuildFinally ¶ added in v1.2.8
func (t *TryBuilder) BuildFinally(f func())
func (*TryBuilder) BuildTryBlock ¶ added in v1.2.8
func (t *TryBuilder) BuildTryBlock(f func())
func (*TryBuilder) Finish ¶ added in v1.2.8
func (t *TryBuilder) Finish()
type Type ¶
type Type interface { String() string RawString() string GetTypeKind() TypeKind // set/get method SetMethod(map[string]*FunctionType) AddMethod(string, *FunctionType) GetMethod() map[string]*FunctionType }
func CalculateType ¶ added in v1.2.8
func GetTypeByStr ¶
type TypeCast ¶ added in v1.2.8
type TypeCast struct { Value Value // contains filtered or unexported fields }
----------- Type-cast cast value -> type
func NewTypeCast ¶ added in v1.2.8
func (*TypeCast) AddLeftPositions ¶ added in v1.2.8
func (a *TypeCast) AddLeftPositions(pos *Position)
func (*TypeCast) AddLeftVariables ¶ added in v1.2.8
func (a *TypeCast) AddLeftVariables(name string)
func (*TypeCast) GetBlock ¶ added in v1.2.8
func (a *TypeCast) GetBlock() *BasicBlock
func (*TypeCast) GetLeftItem ¶ added in v1.2.8
func (a *TypeCast) GetLeftItem() LeftInstruction
func (*TypeCast) GetLeftPosition ¶ added in v1.2.8
func (a *TypeCast) GetLeftPosition() *Position
func (*TypeCast) GetLeftPositions ¶ added in v1.2.8
func (a *TypeCast) GetLeftPositions() []*Position
left-instruction: left-position
func (*TypeCast) GetLeftVariables ¶ added in v1.2.8
func (a *TypeCast) GetLeftVariables() []string
left-instruction: variable
func (*TypeCast) GetOperand ¶ added in v1.2.8
func (*TypeCast) GetOperandNum ¶ added in v1.2.8
func (a *TypeCast) GetOperandNum() int
func (*TypeCast) GetOperands ¶ added in v1.2.8
func (a *TypeCast) GetOperands() Values
func (*TypeCast) GetPosition ¶ added in v1.2.8
func (c *TypeCast) GetPosition() *Position
source code position
func (*TypeCast) GetSymbolTable ¶ added in v1.2.8
func (a *TypeCast) GetSymbolTable() *blockSymbolTable
symbol-table
func (*TypeCast) GetVariable ¶ added in v1.2.8
func (a *TypeCast) GetVariable() string
func (*TypeCast) HasLeftVariable ¶ added in v1.2.8
func (a *TypeCast) HasLeftVariable() bool
has left-instruction
func (*TypeCast) HasUsers ¶ added in v1.2.8
func (n *TypeCast) HasUsers() bool
has/get user and value
func (*TypeCast) LineDisasm ¶ added in v1.2.8
func (*TypeCast) RemoveUser ¶ added in v1.2.8
func (n *TypeCast) RemoveUser(u User)
func (*TypeCast) ReplaceValue ¶ added in v1.2.8
func (*TypeCast) SetBlock ¶ added in v1.2.8
func (a *TypeCast) SetBlock(block *BasicBlock)
func (*TypeCast) SetFunc ¶ added in v1.2.8
func (a *TypeCast) SetFunc(f *Function)
ssa function and block
func (*TypeCast) SetPosition ¶ added in v1.2.8
func (c *TypeCast) SetPosition(pos *Position)
func (*TypeCast) SetSymbolTable ¶ added in v1.2.8
func (a *TypeCast) SetSymbolTable(symbol *blockSymbolTable)
type TypeValue ¶ added in v1.2.8
type TypeValue struct {
// contains filtered or unexported fields
}
------------- type value
func NewTypeValue ¶ added in v1.2.8
func (*TypeValue) AddLeftPositions ¶ added in v1.2.8
func (a *TypeValue) AddLeftPositions(pos *Position)
func (*TypeValue) AddLeftVariables ¶ added in v1.2.8
func (a *TypeValue) AddLeftVariables(name string)
func (*TypeValue) GetBlock ¶ added in v1.2.8
func (a *TypeValue) GetBlock() *BasicBlock
func (*TypeValue) GetLeftItem ¶ added in v1.2.8
func (a *TypeValue) GetLeftItem() LeftInstruction
func (*TypeValue) GetLeftPosition ¶ added in v1.2.8
func (a *TypeValue) GetLeftPosition() *Position
func (*TypeValue) GetLeftPositions ¶ added in v1.2.8
func (a *TypeValue) GetLeftPositions() []*Position
left-instruction: left-position
func (*TypeValue) GetLeftVariables ¶ added in v1.2.8
func (a *TypeValue) GetLeftVariables() []string
left-instruction: variable
func (*TypeValue) GetOperand ¶ added in v1.2.8
func (*TypeValue) GetOperandNum ¶ added in v1.2.8
func (a *TypeValue) GetOperandNum() int
func (*TypeValue) GetOperands ¶ added in v1.2.8
func (a *TypeValue) GetOperands() Values
func (*TypeValue) GetPosition ¶ added in v1.2.8
func (c *TypeValue) GetPosition() *Position
source code position
func (*TypeValue) GetSymbolTable ¶ added in v1.2.8
func (a *TypeValue) GetSymbolTable() *blockSymbolTable
symbol-table
func (*TypeValue) GetVariable ¶ added in v1.2.8
func (a *TypeValue) GetVariable() string
func (*TypeValue) HasLeftVariable ¶ added in v1.2.8
func (a *TypeValue) HasLeftVariable() bool
has left-instruction
func (*TypeValue) HasUsers ¶ added in v1.2.8
func (n *TypeValue) HasUsers() bool
has/get user and value
func (*TypeValue) LineDisasm ¶ added in v1.2.8
func (*TypeValue) RemoveUser ¶ added in v1.2.8
func (n *TypeValue) RemoveUser(u User)
func (*TypeValue) SetBlock ¶ added in v1.2.8
func (a *TypeValue) SetBlock(block *BasicBlock)
func (*TypeValue) SetFunc ¶ added in v1.2.8
func (a *TypeValue) SetFunc(f *Function)
ssa function and block
func (*TypeValue) SetPosition ¶ added in v1.2.8
func (c *TypeValue) SetPosition(pos *Position)
func (*TypeValue) SetSymbolTable ¶ added in v1.2.8
func (a *TypeValue) SetSymbolTable(symbol *blockSymbolTable)
type Types ¶
type Types []Type // each value can have multiple type possible
type UnOp ¶
type UnOp struct { Op UnaryOpcode X Value // contains filtered or unexported fields }
func NewUnOpOnly ¶ added in v1.2.8
func NewUnOpOnly(op UnaryOpcode, x Value) *UnOp
func ToUnOp ¶ added in v1.2.8
func ToUnOp(v Instruction) (*UnOp, bool)
func (*UnOp) AddLeftPositions ¶ added in v1.2.8
func (a *UnOp) AddLeftPositions(pos *Position)
func (*UnOp) AddLeftVariables ¶ added in v1.2.8
func (a *UnOp) AddLeftVariables(name string)
func (*UnOp) GetBlock ¶
func (a *UnOp) GetBlock() *BasicBlock
func (*UnOp) GetLeftItem ¶ added in v1.2.8
func (a *UnOp) GetLeftItem() LeftInstruction
func (*UnOp) GetLeftPosition ¶ added in v1.2.8
func (a *UnOp) GetLeftPosition() *Position
func (*UnOp) GetLeftPositions ¶ added in v1.2.8
func (a *UnOp) GetLeftPositions() []*Position
left-instruction: left-position
func (*UnOp) GetLeftVariables ¶ added in v1.2.8
func (a *UnOp) GetLeftVariables() []string
left-instruction: variable
func (*UnOp) GetOperand ¶ added in v1.2.8
func (*UnOp) GetOperandNum ¶ added in v1.2.8
func (a *UnOp) GetOperandNum() int
func (*UnOp) GetOperands ¶ added in v1.2.8
func (a *UnOp) GetOperands() Values
func (*UnOp) GetPosition ¶ added in v1.2.8
func (c *UnOp) GetPosition() *Position
source code position
func (*UnOp) GetSymbolTable ¶ added in v1.2.8
func (a *UnOp) GetSymbolTable() *blockSymbolTable
symbol-table
func (*UnOp) GetVariable ¶ added in v1.2.8
func (a *UnOp) GetVariable() string
func (*UnOp) HasLeftVariable ¶ added in v1.2.8
func (a *UnOp) HasLeftVariable() bool
has left-instruction
func (*UnOp) LineDisasm ¶ added in v1.2.8
func (*UnOp) RemoveUser ¶ added in v1.2.8
func (n *UnOp) RemoveUser(u User)
func (*UnOp) ReplaceValue ¶ added in v1.2.8
func (*UnOp) SetBlock ¶ added in v1.2.8
func (a *UnOp) SetBlock(block *BasicBlock)
func (*UnOp) SetPosition ¶ added in v1.2.8
func (c *UnOp) SetPosition(pos *Position)
func (*UnOp) SetSymbolTable ¶ added in v1.2.8
func (a *UnOp) SetSymbolTable(symbol *blockSymbolTable)
type UnaryOpcode ¶
type UnaryOpcode int
const ( OpNone UnaryOpcode = iota OpNot // ! OpPlus // + OpNeg // - OpChan // <- OpBitwiseNot // ^ )
type Undefined ¶ added in v1.2.8
type Undefined struct {
// contains filtered or unexported fields
}
----------- Undefined
func NewUndefined ¶ added in v1.2.8
func ToUndefined ¶ added in v1.2.8
func ToUndefined(v Instruction) (*Undefined, bool)
func (*Undefined) AddLeftPositions ¶ added in v1.2.8
func (a *Undefined) AddLeftPositions(pos *Position)
func (*Undefined) AddLeftVariables ¶ added in v1.2.8
func (a *Undefined) AddLeftVariables(name string)
func (*Undefined) GetBlock ¶ added in v1.2.8
func (a *Undefined) GetBlock() *BasicBlock
func (*Undefined) GetLeftItem ¶ added in v1.2.8
func (a *Undefined) GetLeftItem() LeftInstruction
func (*Undefined) GetLeftPosition ¶ added in v1.2.8
func (a *Undefined) GetLeftPosition() *Position
func (*Undefined) GetLeftPositions ¶ added in v1.2.8
func (a *Undefined) GetLeftPositions() []*Position
left-instruction: left-position
func (*Undefined) GetLeftVariables ¶ added in v1.2.8
func (a *Undefined) GetLeftVariables() []string
left-instruction: variable
func (*Undefined) GetOperand ¶ added in v1.2.8
func (*Undefined) GetOperandNum ¶ added in v1.2.8
func (a *Undefined) GetOperandNum() int
func (*Undefined) GetOperands ¶ added in v1.2.8
func (a *Undefined) GetOperands() Values
func (*Undefined) GetPosition ¶ added in v1.2.8
func (c *Undefined) GetPosition() *Position
source code position
func (*Undefined) GetSymbolTable ¶ added in v1.2.8
func (a *Undefined) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Undefined) GetVariable ¶ added in v1.2.8
func (a *Undefined) GetVariable() string
func (*Undefined) HasLeftVariable ¶ added in v1.2.8
func (a *Undefined) HasLeftVariable() bool
has left-instruction
func (*Undefined) HasUsers ¶ added in v1.2.8
func (n *Undefined) HasUsers() bool
has/get user and value
func (*Undefined) LineDisasm ¶ added in v1.2.8
func (*Undefined) RemoveUser ¶ added in v1.2.8
func (n *Undefined) RemoveUser(u User)
func (*Undefined) SetBlock ¶ added in v1.2.8
func (a *Undefined) SetBlock(block *BasicBlock)
func (*Undefined) SetFunc ¶ added in v1.2.8
func (a *Undefined) SetFunc(f *Function)
ssa function and block
func (*Undefined) SetPosition ¶ added in v1.2.8
func (c *Undefined) SetPosition(pos *Position)
func (*Undefined) SetSymbolTable ¶ added in v1.2.8
func (a *Undefined) SetSymbolTable(symbol *blockSymbolTable)
type Update ¶
type Update struct { Value Value Address Value // this point to field // contains filtered or unexported fields }
----------- Update
func ToUpdate ¶ added in v1.2.8
func ToUpdate(v Instruction) (*Update, bool)
func (*Update) AddLeftPositions ¶ added in v1.2.8
func (a *Update) AddLeftPositions(pos *Position)
func (*Update) AddLeftVariables ¶ added in v1.2.8
func (a *Update) AddLeftVariables(name string)
func (*Update) GetBlock ¶
func (a *Update) GetBlock() *BasicBlock
func (*Update) GetLeftItem ¶ added in v1.2.8
func (a *Update) GetLeftItem() LeftInstruction
func (*Update) GetLeftPosition ¶ added in v1.2.8
func (a *Update) GetLeftPosition() *Position
func (*Update) GetLeftPositions ¶ added in v1.2.8
func (a *Update) GetLeftPositions() []*Position
left-instruction: left-position
func (*Update) GetLeftVariables ¶ added in v1.2.8
func (a *Update) GetLeftVariables() []string
left-instruction: variable
func (*Update) GetOperand ¶ added in v1.2.8
func (*Update) GetOperandNum ¶ added in v1.2.8
func (a *Update) GetOperandNum() int
func (*Update) GetOperands ¶ added in v1.2.8
func (a *Update) GetOperands() Values
func (*Update) GetPosition ¶ added in v1.2.8
func (c *Update) GetPosition() *Position
source code position
func (*Update) GetSymbolTable ¶ added in v1.2.8
func (a *Update) GetSymbolTable() *blockSymbolTable
symbol-table
func (*Update) GetVariable ¶ added in v1.2.8
func (a *Update) GetVariable() string
func (*Update) HasLeftVariable ¶ added in v1.2.8
func (a *Update) HasLeftVariable() bool
has left-instruction
func (*Update) LineDisasm ¶ added in v1.2.8
func (*Update) ReplaceValue ¶
func (*Update) SetBlock ¶ added in v1.2.8
func (a *Update) SetBlock(block *BasicBlock)
func (*Update) SetFunc ¶ added in v1.2.8
func (a *Update) SetFunc(f *Function)
ssa function and block
func (*Update) SetPosition ¶ added in v1.2.8
func (c *Update) SetPosition(pos *Position)
func (*Update) SetSymbolTable ¶ added in v1.2.8
func (a *Update) SetSymbolTable(symbol *blockSymbolTable)
type User ¶
type User interface { InstructionNode ReplaceValue(Value, Value) }
type Users ¶ added in v1.2.8
type Users []User
func (Users) RunOnCallOr ¶ added in v1.2.8
func (Users) RunOnField ¶ added in v1.2.8
func (Users) RunOnFieldOr ¶ added in v1.2.8
func (Users) RunOnUpdate ¶ added in v1.2.8
func (Users) RunOnUpdateOr ¶ added in v1.2.8
type Value ¶
type Value interface { InstructionNode LeftInstruction TypedNode AddUser(User) RemoveUser(User) SetType(Type) GetType() Type }
basic handle item (interface)
func CalcBinary ¶ added in v1.2.8
func CalcConstBinarySide ¶ added in v1.2.8
func CalcConstBinarySide(c *ConstInst, v Value, op BinaryOpcode) Value
func HandlerBinOp ¶ added in v1.2.8
func HandlerUnOp ¶ added in v1.2.8
func NewBinOp ¶ added in v1.2.8
func NewBinOp(op BinaryOpcode, x, y Value) Value
func NewUnOp ¶ added in v1.2.8
func NewUnOp(op UnaryOpcode, x Value) Value
Source Files
¶
- InstructionCover.go
- InstructionEmit.go
- InstructionHandler.go
- InstructionOpcode.go
- block.go
- builder.go
- call.go
- cfg.go
- const.go
- const_calc.go
- disasm.go
- disasmLine.go
- error.go
- error_message.go
- extern_instance.go
- func.go
- instruction.go
- object.go
- phi.go
- program.go
- ssa.go
- ssa_inspect.go
- ssa_vars.go
- type.go
- use.go
- variable.go