Documentation ¶
Index ¶
- Constants
- Variables
- func BindingNotFound(v string, r *Range) string
- func BindingNotFoundInCall(v string) string
- func CallAssignmentMismatch(left int, right string) string
- func CallAssignmentMismatchDropError(left int, right string) string
- func CombineMemberCallVariableName(caller, callee Value) (string, bool)
- func ContAssignExtern(name string) string
- func DeleteInst(i Instruction)
- func ExternFieldError(instance, name, key, want string) string
- func FunctionContReturnError() string
- func GetAllKey(t Type) []string
- func GetKeyString(key Value) string
- func GetMethodsName(t Type) []string
- func GetTypeStr(n Value) string
- func IsConst(v Instruction) bool
- func IsControlInstruction(i Instruction) bool
- func IsObjectType(t Type) bool
- func LineDisasm(v Instruction) string
- func LineShortDisasm(v Instruction) string
- func NewInstruction() anInstruction
- func NewValue() anValue
- func NewVariable(globalIndex int, name string, local bool, ...) ssautil.VersionedIF[Value]
- func NoCheckMustInFirst() string
- func ReplaceAllValue(v Value, to Value)
- func ReplaceMemberCall(v, to Value) map[string]Value
- func ReplaceValue(v Value, to Value, skip func(Instruction) bool)
- func RunOnCoverOr[T, U Instruction](insts []U, cover func(Instruction) (T, bool), f func(T), or func(U))
- func SetMemberCall(obj, key, member Value)
- func SpinHandle(name string, phiValue, origin, latch Value) map[string]Value
- func TryGetSimilarityKey(table []string, name string) string
- func TypeCompare(t1, t2 Type) bool
- func ValueIsNull() string
- func ValueUndefined(v string) string
- type AliasType
- func (b *AliasType) AddMethod(id string, f *FunctionType)
- func (a *AliasType) GetMethod() map[string]*FunctionType
- func (a *AliasType) GetTypeKind() TypeKind
- func (b *AliasType) PkgPathString() string
- func (a *AliasType) RawString() string
- func (a *AliasType) SetMethod(m map[string]*FunctionType)
- func (a *AliasType) String() string
- type Assert
- func (i *Assert) AddMask(v Value)
- func (a *Assert) AddVariable(v *Variable)
- func (a *Assert) GetAllVariables() map[string]*Variable
- func (a *Assert) GetBlock() *BasicBlock
- func (a *Assert) GetFunc() *Function
- func (a *Assert) GetId() int
- func (a *Assert) GetLastVariable() *Variable
- func (i *Assert) GetMask() []Value
- func (a *Assert) GetName() string
- func (i *Assert) GetOpcode() Opcode
- func (a *Assert) GetOperand(i int) Value
- func (a *Assert) GetOperandNum() int
- func (a *Assert) GetOperands() Values
- func (a *Assert) GetProgram() *Program
- func (c *Assert) GetRange() *Range
- func (r *Assert) GetUsers() Users
- func (a *Assert) GetValues() Values
- func (a *Assert) GetVariable(name string) *Variable
- func (i *Assert) GetVerboseName() string
- func (r *Assert) HasUsers() bool
- func (a *Assert) HasValues() bool
- func (c *Assert) IsExtern() bool
- func (i *Assert) IsUndefined() bool
- func (a *Assert) LineDisasm() string
- func (i *Assert) Masked() bool
- func (c *Assert) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (a *Assert) ReplaceValue(v, to Value)
- func (i *Assert) SelfDelete()
- func (a *Assert) SetBlock(block *BasicBlock)
- func (c *Assert) SetExtern(b bool)
- func (a *Assert) SetFunc(f *Function)
- func (a *Assert) SetId(id int)
- func (a *Assert) SetName(v string)
- func (c *Assert) SetRange(pos *Range)
- func (i *Assert) SetVerboseName(verbose string)
- func (a *Assert) String() string
- type BasicBlock
- func (n *BasicBlock) AddMember(k, v Value)
- func (b *BasicBlock) AddSucc(succ *BasicBlock)
- func (n *BasicBlock) AddUser(u User)
- func (n *BasicBlock) DeleteMember(k Value)
- func (b *BasicBlock) EmitInst(i Instruction)
- func (n *BasicBlock) GetAllMember() map[Value]Value
- func (b *BasicBlock) GetBlockById(name string) *BasicBlock
- func (n *BasicBlock) GetIndexMember(i int) (Value, bool)
- func (n *BasicBlock) GetKey() Value
- func (n *BasicBlock) GetMember(key Value) (Value, bool)
- func (n *BasicBlock) GetObject() Value
- func (i *BasicBlock) GetOpcode() Opcode
- func (n *BasicBlock) GetStringMember(key string) (Value, bool)
- func (b *BasicBlock) GetType() Type
- func (n *BasicBlock) GetUsers() Users
- func (b *BasicBlock) GetValues() Values
- func (n *BasicBlock) HasUsers() bool
- func (b *BasicBlock) HasValues() bool
- func (b *BasicBlock) IsBlock(name string) bool
- func (n *BasicBlock) IsMember() bool
- func (n *BasicBlock) IsMemberCallVariable() bool
- func (n *BasicBlock) IsObject() bool
- func (b *BasicBlock) LastInst() Instruction
- func (b *BasicBlock) Reachable() int
- func (n *BasicBlock) RemoveUser(u User)
- func (n *BasicBlock) SetKey(k Value)
- func (n *BasicBlock) SetObject(v Value)
- func (b *BasicBlock) SetType(ts Type)
- func (b *BasicBlock) String() string
- type BasicType
- func (b *BasicType) AddMethod(id string, f *FunctionType)
- func (b *BasicType) GetMethod() map[string]*FunctionType
- func (b *BasicType) GetTypeKind() TypeKind
- func (b *BasicType) PkgPathString() string
- func (b *BasicType) RawString() string
- func (b *BasicType) SetMethod(method map[string]*FunctionType)
- func (b *BasicType) String() string
- type BinOp
- func (n *BinOp) AddMember(k, v Value)
- func (n *BinOp) AddUser(u User)
- func (n *BinOp) DeleteMember(k Value)
- func (n *BinOp) GetAllMember() map[Value]Value
- func (n *BinOp) GetIndexMember(i int) (Value, bool)
- func (n *BinOp) GetKey() Value
- func (n *BinOp) GetMember(key Value) (Value, bool)
- func (n *BinOp) GetObject() Value
- func (i *BinOp) GetOpcode() Opcode
- func (n *BinOp) GetStringMember(key string) (Value, bool)
- func (n *BinOp) GetType() Type
- func (n *BinOp) GetUsers() Users
- func (b *BinOp) GetValues() Values
- func (n *BinOp) HasUsers() bool
- func (b *BinOp) HasValues() bool
- func (n *BinOp) IsMember() bool
- func (n *BinOp) IsMemberCallVariable() bool
- func (n *BinOp) IsObject() bool
- func (n *BinOp) RemoveUser(u User)
- func (b *BinOp) ReplaceValue(v Value, to Value)
- func (n *BinOp) SetKey(k Value)
- func (n *BinOp) SetObject(v Value)
- func (n *BinOp) SetType(typ Type)
- func (b *BinOp) String() string
- type BinaryOpcode
- type Call
- func (n *Call) AddMember(k, v Value)
- func (n *Call) AddUser(u User)
- func (n *Call) DeleteMember(k Value)
- func (n *Call) GetAllMember() map[Value]Value
- func (n *Call) GetIndexMember(i int) (Value, bool)
- func (n *Call) GetKey() Value
- func (n *Call) GetMember(key Value) (Value, bool)
- func (n *Call) GetObject() Value
- func (i *Call) GetOpcode() Opcode
- func (n *Call) GetStringMember(key string) (Value, bool)
- func (n *Call) GetType() Type
- func (n *Call) GetUsers() Users
- func (c *Call) GetValues() Values
- func (c *Call) HandleFreeValue(fvs []*Parameter)
- func (n *Call) HasUsers() bool
- func (c *Call) HasValues() bool
- func (n *Call) IsMember() bool
- func (n *Call) IsMemberCallVariable() bool
- func (n *Call) IsObject() bool
- func (n *Call) RemoveUser(u User)
- func (c *Call) ReplaceValue(v Value, to Value)
- func (n *Call) SetKey(k Value)
- func (n *Call) SetObject(v Value)
- func (n *Call) SetType(typ Type)
- func (c *Call) String() string
- type ChanType
- func (b *ChanType) AddMethod(id string, f *FunctionType)
- func (c *ChanType) GetMethod() map[string]*FunctionType
- func (c *ChanType) GetTypeKind() TypeKind
- func (c ChanType) PkgPathString() string
- func (c ChanType) RawString() string
- func (c *ChanType) SetMethod(m map[string]*FunctionType)
- func (c ChanType) String() string
- type ClassBluePrint
- func (c *ClassBluePrint) AddMethod(string, *FunctionType)
- func (c *ClassBluePrint) Apply(obj Value) Type
- func (c *ClassBluePrint) GetMethod() map[string]*FunctionType
- func (c *ClassBluePrint) GetTypeKind() TypeKind
- func (c *ClassBluePrint) PkgPathString() string
- func (c *ClassBluePrint) RawString() string
- func (c *ClassBluePrint) SetMethod(map[string]*FunctionType)
- func (c *ClassBluePrint) SetObjectType(t *ObjectType)
- func (c *ClassBluePrint) SetThis(v Value)
- func (c *ClassBluePrint) String() string
- 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 (n *ConstInst) AddMember(k, v Value)
- func (n *ConstInst) AddUser(u User)
- func (n *ConstInst) DeleteMember(k Value)
- func (n *ConstInst) GetAllMember() map[Value]Value
- func (n *ConstInst) GetIndexMember(i int) (Value, bool)
- func (n *ConstInst) GetKey() Value
- func (n *ConstInst) GetMember(key Value) (Value, bool)
- func (n *ConstInst) GetObject() Value
- func (i *ConstInst) GetOpcode() Opcode
- func (n *ConstInst) GetStringMember(key string) (Value, bool)
- func (c *ConstInst) GetType() Type
- func (n *ConstInst) GetUsers() Users
- func (c *ConstInst) GetValues() Values
- func (n *ConstInst) HasUsers() bool
- func (c *ConstInst) HasValues() bool
- func (n *ConstInst) IsMember() bool
- func (n *ConstInst) IsMemberCallVariable() bool
- func (n *ConstInst) IsObject() bool
- func (n *ConstInst) RemoveUser(u User)
- func (c *ConstInst) ReplaceValue(v Value, to Value)
- func (n *ConstInst) SetKey(k Value)
- func (n *ConstInst) SetObject(v Value)
- func (c *ConstInst) SetType(ts Type)
- func (c *ConstInst) String() string
- type DisasmLiner
- type ErrorComment
- type ErrorCommentId
- type ErrorHandler
- func (e *ErrorHandler) AddDone(d *BasicBlock)
- func (e *ErrorHandler) AddFinal(f *BasicBlock)
- func (i *ErrorHandler) AddMask(v Value)
- func (a *ErrorHandler) AddVariable(v *Variable)
- func (a *ErrorHandler) GetAllVariables() map[string]*Variable
- func (a *ErrorHandler) GetBlock() *BasicBlock
- func (a *ErrorHandler) GetFunc() *Function
- func (a *ErrorHandler) GetId() int
- func (a *ErrorHandler) GetLastVariable() *Variable
- func (i *ErrorHandler) GetMask() []Value
- func (a *ErrorHandler) GetName() string
- func (i *ErrorHandler) GetOpcode() Opcode
- func (a *ErrorHandler) GetOperand(i int) Value
- func (a *ErrorHandler) GetOperandNum() int
- func (a *ErrorHandler) GetOperands() Values
- func (a *ErrorHandler) GetProgram() *Program
- func (c *ErrorHandler) GetRange() *Range
- func (a *ErrorHandler) GetVariable(name string) *Variable
- func (i *ErrorHandler) GetVerboseName() string
- func (c *ErrorHandler) IsExtern() bool
- func (i *ErrorHandler) IsUndefined() bool
- func (a *ErrorHandler) LineDisasm() string
- func (i *ErrorHandler) Masked() bool
- func (c *ErrorHandler) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (i *ErrorHandler) ReplaceValue(Value, Value)
- func (i *ErrorHandler) SelfDelete()
- func (a *ErrorHandler) SetBlock(block *BasicBlock)
- func (c *ErrorHandler) SetExtern(b bool)
- func (a *ErrorHandler) SetFunc(f *Function)
- func (a *ErrorHandler) SetId(id int)
- func (a *ErrorHandler) SetName(v string)
- func (c *ErrorHandler) SetRange(pos *Range)
- func (i *ErrorHandler) SetVerboseName(verbose string)
- func (e *ErrorHandler) String() string
- type ErrorKind
- type ErrorLogger
- type ErrorTag
- type ExternLib
- func (n *ExternLib) AddMember(k, v Value)
- func (n *ExternLib) AddUser(u User)
- func (ex *ExternLib) BuildField(key string) Value
- func (n *ExternLib) DeleteMember(k Value)
- func (n *ExternLib) GetAllMember() map[Value]Value
- func (n *ExternLib) GetIndexMember(i int) (Value, bool)
- func (n *ExternLib) GetKey() Value
- func (n *ExternLib) GetMember(key Value) (Value, bool)
- func (n *ExternLib) GetObject() Value
- func (i *ExternLib) GetOpcode() Opcode
- func (n *ExternLib) GetStringMember(key string) (Value, bool)
- func (n *ExternLib) GetType() Type
- func (n *ExternLib) GetUsers() Users
- func (e *ExternLib) GetValues() Values
- func (n *ExternLib) HasUsers() bool
- func (e *ExternLib) HasValues() bool
- func (n *ExternLib) IsMember() bool
- func (n *ExternLib) IsMemberCallVariable() bool
- func (n *ExternLib) IsObject() bool
- func (n *ExternLib) RemoveUser(u User)
- func (e *ExternLib) ReplaceValue(v Value, to Value)
- func (n *ExternLib) SetKey(k Value)
- func (n *ExternLib) SetObject(v Value)
- func (n *ExternLib) SetType(typ Type)
- func (e *ExternLib) String() string
- type FullDisasmLiner
- func (f *FullDisasmLiner) AddLevel() bool
- func (b FullDisasmLiner) DeleteName(i Instruction)
- func (f *FullDisasmLiner) DisasmValue(v Value) string
- func (b FullDisasmLiner) GetName(i Instruction) (string, bool)
- func (b FullDisasmLiner) SetName(i Instruction, name string)
- func (b *FullDisasmLiner) SkipLevelChecking() bool
- type Function
- func (f *Function) AddErrorComment(str string, line int) error
- func (n *Function) AddMember(k, v Value)
- func (f *Function) AddSideEffect(name *Variable, v Value)
- func (n *Function) AddUser(u User)
- func (f *Function) CheckAndSetSideEffect(variable *Variable, v Value)
- func (n *Function) DeleteMember(k Value)
- func (f *Function) DisAsm(flag FunctionAsmFlag) string
- func (f *Function) Finish()
- func (f *Function) FirstBlockInstruction() []Instruction
- func (n *Function) GetAllMember() map[Value]Value
- func (f *Function) GetDeferBlock() *BasicBlock
- func (n *Function) GetIndexMember(i int) (Value, bool)
- func (n *Function) GetKey() Value
- func (n *Function) GetMember(key Value) (Value, bool)
- func (n *Function) GetObject() Value
- func (i *Function) GetOpcode() Opcode
- func (f *Function) GetParent() *Function
- func (f *Function) GetProgram() *Program
- func (f *Function) GetReferenceFiles() []string
- func (n *Function) GetStringMember(key string) (Value, bool)
- func (n *Function) GetType() Type
- func (n *Function) GetUsers() Users
- func (f *Function) GetValues() Values
- func (n *Function) HasUsers() bool
- func (f *Function) HasValues() bool
- func (f *Function) IsMain() bool
- func (n *Function) IsMember() bool
- func (n *Function) IsMemberCallVariable() bool
- func (n *Function) IsObject() bool
- 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 (f *Function) NewError(kind ErrorKind, tag ErrorTag, format string)
- func (f *Function) NewErrorWithPos(kind ErrorKind, tag ErrorTag, Pos *Range, message string)
- func (f *Function) PushReferenceFile(file, code string)
- func (n *Function) RemoveUser(u User)
- func (f *Function) ReturnValue() []Value
- func (n *Function) SetKey(k Value)
- func (n *Function) SetObject(v Value)
- func (n *Function) SetType(typ Type)
- func (f *Function) String() string
- type FunctionAsmFlag
- type FunctionBuilder
- func (b *FunctionBuilder) AddDefer(call *Call)
- func (b *FunctionBuilder) AddLabel(name string, block *BasicBlock)
- func (n FunctionBuilder) AddMember(k, v Value)
- func (n FunctionBuilder) AddUser(u User)
- func (b *FunctionBuilder) AssignVariable(variable *Variable, value Value)
- func (b *FunctionBuilder) Break() bool
- func (b *FunctionBuilder) BuildFreeValue(variable string) *Parameter
- func (b *FunctionBuilder) BuildSwitch() *SwitchBuilder
- func (b *FunctionBuilder) BuildSyntaxBlock(builder func())
- func (b *FunctionBuilder) BuildTry() *TryBuilder
- func (b *FunctionBuilder) BuildValueFromAny(id string, v any) (value Value)
- func (b *FunctionBuilder) Continue() bool
- func (f *FunctionBuilder) CoverReflectFunctionType(itype reflect.Type, level int) *FunctionType
- func (b *FunctionBuilder) CreateIfBuilder() *IfBuilder
- func (b *FunctionBuilder) CreateInterfaceWithMap(keys []Value, vs []Value) *Make
- func (b *FunctionBuilder) CreateInterfaceWithSlice(vs []Value) *Make
- func (b *FunctionBuilder) CreateLocalVariable(name string) *Variable
- func (b *FunctionBuilder) CreateLoopBuilder() *LoopBuilder
- func (b *FunctionBuilder) CreateMemberCallVariable(value, key Value) *Variable
- func (b *FunctionBuilder) CreateVariable(name string) *Variable
- func (b *FunctionBuilder) DeleteLabel(name string)
- func (n FunctionBuilder) DeleteMember(k Value)
- 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 (b *FunctionBuilder) EmitFirst(i Instruction, block *BasicBlock)
- func (f *FunctionBuilder) EmitIf() *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) EmitNewClassBluePrint(memberCount int) *ClassBluePrint
- 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) EmitPhi(name string, vs []Value) *Phi
- func (f *FunctionBuilder) EmitRecover() *Recover
- func (f *FunctionBuilder) EmitReturn(vs []Value) *Return
- func (f *FunctionBuilder) EmitSideEffect(name string, call *Call, value Value) *SideEffect
- 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) EmitUndefined(name string) *Undefined
- func (b *FunctionBuilder) Fallthrough() bool
- func (b *FunctionBuilder) Finish()
- func (n FunctionBuilder) GetAllMember() map[Value]Value
- func (n FunctionBuilder) GetIndexMember(i int) (Value, bool)
- func (n FunctionBuilder) GetKey() Value
- func (b *FunctionBuilder) GetLabel(name string) *BasicBlock
- func (b *FunctionBuilder) GetMarkedFunction() *FunctionType
- func (n FunctionBuilder) GetMember(key Value) (Value, bool)
- func (n FunctionBuilder) GetObject() Value
- func (n FunctionBuilder) GetStringMember(key string) (Value, bool)
- func (n FunctionBuilder) GetType() Type
- func (n FunctionBuilder) GetUsers() Users
- func (b FunctionBuilder) HandlerEllipsis()
- func (n FunctionBuilder) HasUsers() bool
- func (b *FunctionBuilder) InterfaceAddFieldBuild(size int, keys func(int) Value, value func(int) Value) *Make
- func (b *FunctionBuilder) IsBlockFinish() bool
- func (n FunctionBuilder) IsMember() bool
- func (n FunctionBuilder) IsMemberCallVariable() bool
- func (n FunctionBuilder) IsObject() bool
- func (b *FunctionBuilder) IsParentFunctionVariable(v *Variable) bool
- func (f *FunctionBuilder) NewCall(target Value, args []Value) *Call
- func (b *FunctionBuilder) NewError(kind ErrorKind, tag ErrorTag, massage string, arg ...interface{})
- func (b *FunctionBuilder) NewFunc(name string) *Function
- func (f *FunctionBuilder) NewParam(name string) *Parameter
- func (b *FunctionBuilder) PeekValue(name string) Value
- func (b *FunctionBuilder) PeekValueByVariable(v *Variable) Value
- func (b *FunctionBuilder) PeekValueInThisFunction(name string) Value
- func (b *FunctionBuilder) PopFunction() *FunctionBuilder
- func (b *FunctionBuilder) PopTarget() bool
- func (b *FunctionBuilder) PushFunction(newFunc *Function) *FunctionBuilder
- func (b *FunctionBuilder) PushTarget(scope ssautil.LabelTarget[Value], _break, _continue, _fallthrough *BasicBlock)
- func (b *FunctionBuilder) ReadMemberCallVariable(value, key Value) Value
- func (b *FunctionBuilder) ReadOrCreateMemberCallVariable(caller, callee Value) Value
- func (b *FunctionBuilder) ReadOrCreateVariable(name string) Value
- func (b *FunctionBuilder) ReadValue(name string) Value
- func (b *FunctionBuilder) ReadValueByVariable(v *Variable) Value
- func (b *FunctionBuilder) ReadValueInThisFunction(name string) Value
- func (n FunctionBuilder) RemoveUser(u User)
- func (f *FunctionBuilder) SetCurrent(i Instruction) func()
- func (f *FunctionBuilder) SetInstructionPosition(i Instruction)
- func (n FunctionBuilder) SetKey(k Value)
- func (b *FunctionBuilder) SetMarkedFunction(name string)
- func (n FunctionBuilder) SetObject(v Value)
- func (n FunctionBuilder) SetType(typ Type)
- func (b *FunctionBuilder) TryBuildExternValue(id string) Value
- func (b *FunctionBuilder) TryGetSimilarityKey(name, key string) string
- func (b *FunctionBuilder) WithDefineFunction(defineFunc map[string]any)
- func (b *FunctionBuilder) WithExternLib(lib map[string]map[string]any)
- func (b *FunctionBuilder) WithExternMethod(builder MethodBuilder)
- func (b *FunctionBuilder) WithExternValue(vs map[string]any)
- type FunctionSideEffect
- 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) Copy() *FunctionType
- func (f *FunctionType) GetMethod() map[string]*FunctionType
- func (s *FunctionType) GetParamString() string
- func (s *FunctionType) GetTypeKind() TypeKind
- func (s *FunctionType) PkgPathString() string
- func (s *FunctionType) RawString() string
- func (s *FunctionType) SetFreeValue(fv map[string]*Parameter)
- 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 []*FunctionSideEffect)
- func (s *FunctionType) String() string
- type If
- func (i *If) AddFalse(f *BasicBlock)
- func (i *If) AddMask(v Value)
- func (i *If) AddTrue(t *BasicBlock)
- func (a *If) AddVariable(v *Variable)
- func (a *If) GetAllVariables() map[string]*Variable
- func (a *If) GetBlock() *BasicBlock
- func (a *If) GetFunc() *Function
- func (a *If) GetId() int
- func (a *If) GetLastVariable() *Variable
- func (i *If) GetMask() []Value
- func (a *If) GetName() string
- func (i *If) GetOpcode() Opcode
- func (a *If) GetOperand(i int) Value
- func (a *If) GetOperandNum() int
- func (a *If) GetOperands() Values
- func (a *If) GetProgram() *Program
- func (c *If) GetRange() *Range
- func (r *If) GetUsers() Users
- func (i *If) GetValues() Values
- func (a *If) GetVariable(name string) *Variable
- func (i *If) GetVerboseName() string
- func (r *If) HasUsers() bool
- func (i *If) HasValues() bool
- func (c *If) IsExtern() bool
- func (i *If) IsUndefined() bool
- func (a *If) LineDisasm() string
- func (i *If) Masked() bool
- func (c *If) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (i *If) ReplaceValue(v Value, to Value)
- func (i *If) SelfDelete()
- func (a *If) SetBlock(block *BasicBlock)
- func (i *If) SetCondition(t Value)
- func (c *If) SetExtern(b bool)
- func (a *If) SetFunc(f *Function)
- func (a *If) SetId(id int)
- func (a *If) SetName(v string)
- func (c *If) SetRange(pos *Range)
- func (i *If) SetVerboseName(verbose string)
- func (i *If) String() string
- type IfBuilder
- type IfBuilderItem
- type Instruction
- 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) PkgPathString() string
- func (i *InterfaceType) RawString() string
- func (i *InterfaceType) SetMethod(m map[string]*FunctionType)
- func (i *InterfaceType) String() string
- type Jump
- func (i *Jump) AddMask(v Value)
- func (a *Jump) AddVariable(v *Variable)
- func (a *Jump) GetAllVariables() map[string]*Variable
- func (a *Jump) GetBlock() *BasicBlock
- func (a *Jump) GetFunc() *Function
- func (a *Jump) GetId() int
- func (a *Jump) GetLastVariable() *Variable
- func (i *Jump) GetMask() []Value
- func (a *Jump) GetName() string
- func (i *Jump) GetOpcode() Opcode
- func (a *Jump) GetOperand(i int) Value
- func (a *Jump) GetOperandNum() int
- func (a *Jump) GetOperands() Values
- func (a *Jump) GetProgram() *Program
- func (c *Jump) GetRange() *Range
- func (a *Jump) GetVariable(name string) *Variable
- func (i *Jump) GetVerboseName() string
- func (c *Jump) IsExtern() bool
- func (i *Jump) IsUndefined() bool
- func (a *Jump) LineDisasm() string
- func (i *Jump) Masked() bool
- func (c *Jump) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (i *Jump) ReplaceValue(Value, Value)
- func (i *Jump) SelfDelete()
- func (a *Jump) SetBlock(block *BasicBlock)
- func (c *Jump) SetExtern(b bool)
- func (a *Jump) SetFunc(f *Function)
- func (a *Jump) SetId(id int)
- func (a *Jump) SetName(v string)
- func (c *Jump) SetRange(pos *Range)
- func (i *Jump) SetVerboseName(verbose string)
- func (j *Jump) String() string
- type Loop
- func (i *Loop) AddMask(v Value)
- func (a *Loop) AddVariable(v *Variable)
- func (l *Loop) Finish(init, step []Value)
- func (a *Loop) GetAllVariables() map[string]*Variable
- func (a *Loop) GetBlock() *BasicBlock
- func (a *Loop) GetFunc() *Function
- func (a *Loop) GetId() int
- func (a *Loop) GetLastVariable() *Variable
- func (i *Loop) GetMask() []Value
- func (a *Loop) GetName() string
- func (i *Loop) GetOpcode() Opcode
- func (a *Loop) GetOperand(i int) Value
- func (a *Loop) GetOperandNum() int
- func (a *Loop) GetOperands() Values
- func (a *Loop) GetProgram() *Program
- func (c *Loop) GetRange() *Range
- func (r *Loop) GetUsers() Users
- func (l *Loop) GetValues() Values
- func (a *Loop) GetVariable(name string) *Variable
- func (i *Loop) GetVerboseName() string
- func (r *Loop) HasUsers() bool
- func (l *Loop) HasValues() bool
- func (c *Loop) IsExtern() bool
- func (i *Loop) IsUndefined() bool
- func (a *Loop) LineDisasm() string
- func (i *Loop) Masked() bool
- func (c *Loop) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (l *Loop) ReplaceValue(v Value, to Value)
- func (i *Loop) SelfDelete()
- func (a *Loop) SetBlock(block *BasicBlock)
- func (c *Loop) SetExtern(b bool)
- func (a *Loop) SetFunc(f *Function)
- func (a *Loop) SetId(id int)
- func (a *Loop) SetName(v string)
- func (c *Loop) SetRange(pos *Range)
- func (i *Loop) SetVerboseName(verbose string)
- func (l *Loop) String() string
- type LoopBuilder
- type Make
- func (n *Make) AddMember(k, v Value)
- func (n *Make) AddUser(u User)
- func (n *Make) DeleteMember(k Value)
- func (n *Make) GetAllMember() map[Value]Value
- func (n *Make) GetIndexMember(i int) (Value, bool)
- func (n *Make) GetKey() Value
- func (n *Make) GetMember(key Value) (Value, bool)
- func (n *Make) GetObject() Value
- func (i *Make) GetOpcode() Opcode
- func (n *Make) GetStringMember(key string) (Value, bool)
- func (n *Make) GetType() Type
- func (n *Make) GetUsers() Users
- func (i *Make) GetValues() Values
- func (n *Make) HasUsers() bool
- func (i *Make) HasValues() bool
- func (n *Make) IsMember() bool
- func (n *Make) IsMemberCallVariable() bool
- func (n *Make) IsObject() bool
- func (n *Make) RemoveUser(u User)
- func (i *Make) ReplaceValue(v, to Value)
- func (n *Make) SetKey(k Value)
- func (n *Make) SetObject(v Value)
- func (n *Make) SetType(typ Type)
- func (i *Make) String() string
- type Maskable
- type MemberCall
- type MethodBuilder
- type NameDisasmLiner
- func (n *NameDisasmLiner) AddLevel() bool
- func (b NameDisasmLiner) DeleteName(i Instruction)
- func (n *NameDisasmLiner) DisasmValue(v Value) string
- func (b NameDisasmLiner) GetName(i Instruction) (string, bool)
- func (b NameDisasmLiner) SetName(i Instruction, name string)
- func (b *NameDisasmLiner) SkipLevelChecking() bool
- type Next
- func (n *Next) AddMember(k, v Value)
- func (n *Next) AddUser(u User)
- func (n *Next) DeleteMember(k Value)
- func (n *Next) GetAllMember() map[Value]Value
- func (n *Next) GetIndexMember(i int) (Value, bool)
- func (n *Next) GetKey() Value
- func (n *Next) GetMember(key Value) (Value, bool)
- func (n *Next) GetObject() Value
- func (i *Next) GetOpcode() Opcode
- func (n *Next) GetStringMember(key string) (Value, bool)
- func (n *Next) GetType() Type
- func (n *Next) GetUsers() Users
- func (n *Next) GetValues() Values
- func (n *Next) HasUsers() bool
- func (n *Next) HasValues() bool
- func (n *Next) IsMember() bool
- func (n *Next) IsMemberCallVariable() bool
- func (n *Next) IsObject() bool
- func (n *Next) RemoveUser(u User)
- func (n *Next) ReplaceValue(v, to Value)
- func (n *Next) SetKey(k Value)
- func (n *Next) SetObject(v Value)
- func (n *Next) SetType(typ Type)
- 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 (i *ObjectType) PkgPathString() string
- func (itype *ObjectType) RawString() string
- func (i *ObjectType) SetMethod(m map[string]*FunctionType)
- func (i *ObjectType) SetName(name string)
- func (i *ObjectType) SetTypeKind(t TypeKind)
- func (itype *ObjectType) String() string
- type Opcode
- type Package
- type Panic
- func (n *Panic) AddMember(k, v Value)
- func (n *Panic) AddUser(u User)
- func (n *Panic) DeleteMember(k Value)
- func (n *Panic) GetAllMember() map[Value]Value
- func (n *Panic) GetIndexMember(i int) (Value, bool)
- func (n *Panic) GetKey() Value
- func (n *Panic) GetMember(key Value) (Value, bool)
- func (n *Panic) GetObject() Value
- func (i *Panic) GetOpcode() Opcode
- func (n *Panic) GetStringMember(key string) (Value, bool)
- func (n *Panic) GetType() Type
- func (n *Panic) GetUsers() Users
- func (p *Panic) GetValues() Values
- func (n *Panic) HasUsers() bool
- func (p *Panic) HasValues() bool
- func (n *Panic) IsMember() bool
- func (n *Panic) IsMemberCallVariable() bool
- func (n *Panic) IsObject() bool
- func (n *Panic) RemoveUser(u User)
- func (p *Panic) ReplaceValue(v, to Value)
- func (n *Panic) SetKey(k Value)
- func (n *Panic) SetObject(v Value)
- func (n *Panic) SetType(typ Type)
- func (p *Panic) String() string
- type Parameter
- func (n *Parameter) AddMember(k, v Value)
- func (n *Parameter) AddUser(u User)
- func (p *Parameter) Copy() *Parameter
- func (n *Parameter) DeleteMember(k Value)
- func (n *Parameter) GetAllMember() map[Value]Value
- func (p *Parameter) GetDefault() Value
- func (n *Parameter) GetIndexMember(i int) (Value, bool)
- func (n *Parameter) GetKey() Value
- func (n *Parameter) GetMember(key Value) (Value, bool)
- func (n *Parameter) GetObject() Value
- func (i *Parameter) GetOpcode() Opcode
- func (n *Parameter) GetStringMember(key string) (Value, bool)
- func (n *Parameter) GetType() Type
- func (n *Parameter) GetUsers() Users
- func (p *Parameter) GetValues() Values
- func (n *Parameter) HasUsers() bool
- func (p *Parameter) HasValues() bool
- func (n *Parameter) IsMember() bool
- func (n *Parameter) IsMemberCallVariable() bool
- func (n *Parameter) IsObject() bool
- func (n *Parameter) RemoveUser(u User)
- func (p *Parameter) SetDefault(v Value)
- func (n *Parameter) SetKey(k Value)
- func (n *Parameter) SetObject(v Value)
- func (n *Parameter) SetType(typ Type)
- func (p *Parameter) String() string
- type ParentScope
- type Phi
- func (n *Phi) AddMember(k, v Value)
- func (n *Phi) AddUser(u User)
- func (n *Phi) DeleteMember(k Value)
- func (n *Phi) GetAllMember() map[Value]Value
- func (n *Phi) GetIndexMember(i int) (Value, bool)
- func (n *Phi) GetKey() Value
- func (n *Phi) GetMember(key Value) (Value, bool)
- func (n *Phi) GetObject() Value
- func (i *Phi) GetOpcode() Opcode
- func (n *Phi) GetStringMember(key string) (Value, bool)
- func (n *Phi) GetType() Type
- func (n *Phi) GetUsers() Users
- func (p *Phi) GetValues() Values
- func (n *Phi) HasUsers() bool
- func (p *Phi) HasValues() bool
- func (n *Phi) IsMember() bool
- func (n *Phi) IsMemberCallVariable() bool
- func (n *Phi) IsObject() bool
- func (n *Phi) RemoveUser(u User)
- func (p *Phi) ReplaceValue(v Value, to Value)
- func (n *Phi) SetKey(k Value)
- func (n *Phi) SetObject(v Value)
- func (n *Phi) SetType(typ Type)
- func (p *Phi) String() string
- type Position
- type Program
- func (prog *Program) AddError(err *SSAError)
- func (prog *Program) AddPackage(pkg *Package)
- func (p *Program) DeleteInstruction(i Instruction)
- func (prog *Program) EachFunction(handler func(*Function))
- func (prog *Program) GetAndCreateMainFunction() *Function
- func (prog *Program) GetAndCreateMainFunctionBuilder() *FunctionBuilder
- func (prog *Program) GetErrors() SSAErrors
- func (p *Program) GetFunctionFast(paths ...string) *Function
- func (p *Program) GetInstructionById(id int) Instruction
- func (p *Program) GetInstructionsByName(name string) []Instruction
- func (prog *Program) GetPackage(name string) *Package
- func (p *Program) RemoveInstructionWithName(name string, i Instruction)
- func (p *Program) SetInstructionWithName(name string, i Instruction)
- func (p *Program) SetVirtualRegister(i Instruction)
- func (p *Program) Show() *Program
- func (p *Program) ShowWithSource()
- type Range
- type Recover
- func (n *Recover) AddMember(k, v Value)
- func (n *Recover) AddUser(u User)
- func (n *Recover) DeleteMember(k Value)
- func (n *Recover) GetAllMember() map[Value]Value
- func (n *Recover) GetIndexMember(i int) (Value, bool)
- func (n *Recover) GetKey() Value
- func (n *Recover) GetMember(key Value) (Value, bool)
- func (n *Recover) GetObject() Value
- func (i *Recover) GetOpcode() Opcode
- func (n *Recover) GetStringMember(key string) (Value, bool)
- func (n *Recover) GetType() Type
- func (n *Recover) GetUsers() Users
- func (r *Recover) GetValues() Values
- func (n *Recover) HasUsers() bool
- func (r *Recover) HasValues() bool
- func (n *Recover) IsMember() bool
- func (n *Recover) IsMemberCallVariable() bool
- func (n *Recover) IsObject() bool
- func (n *Recover) RemoveUser(u User)
- func (n *Recover) SetKey(k Value)
- func (n *Recover) SetObject(v Value)
- func (n *Recover) SetType(typ Type)
- func (r *Recover) String() string
- type Return
- func (n *Return) AddMember(k, v Value)
- func (n *Return) AddUser(u User)
- func (n *Return) DeleteMember(k Value)
- func (n *Return) GetAllMember() map[Value]Value
- func (n *Return) GetIndexMember(i int) (Value, bool)
- func (n *Return) GetKey() Value
- func (n *Return) GetMember(key Value) (Value, bool)
- func (n *Return) GetObject() Value
- func (i *Return) GetOpcode() Opcode
- func (n *Return) GetStringMember(key string) (Value, bool)
- func (n *Return) GetType() Type
- func (r *Return) GetUsers() Users
- func (r *Return) GetValues() Values
- func (r *Return) HasUsers() bool
- func (r *Return) HasValues() bool
- func (n *Return) IsMember() bool
- func (n *Return) IsMemberCallVariable() bool
- func (n *Return) IsObject() bool
- func (n *Return) RemoveUser(u User)
- func (r *Return) ReplaceValue(v Value, to Value)
- func (n *Return) SetKey(k Value)
- func (n *Return) SetObject(v Value)
- func (n *Return) SetType(typ Type)
- func (r *Return) String() string
- type SSAError
- type SSAErrors
- type Scope
- type ScopeIF
- type SideEffect
- func (n *SideEffect) AddMember(k, v Value)
- func (n *SideEffect) AddUser(u User)
- func (n *SideEffect) DeleteMember(k Value)
- func (n *SideEffect) GetAllMember() map[Value]Value
- func (n *SideEffect) GetIndexMember(i int) (Value, bool)
- func (n *SideEffect) GetKey() Value
- func (n *SideEffect) GetMember(key Value) (Value, bool)
- func (n *SideEffect) GetObject() Value
- func (i *SideEffect) GetOpcode() Opcode
- func (n *SideEffect) GetStringMember(key string) (Value, bool)
- func (n *SideEffect) GetType() Type
- func (n *SideEffect) GetUsers() Users
- func (s *SideEffect) GetValues() Values
- func (n *SideEffect) HasUsers() bool
- func (s *SideEffect) HasValues() bool
- func (n *SideEffect) IsMember() bool
- func (n *SideEffect) IsMemberCallVariable() bool
- func (n *SideEffect) IsObject() bool
- func (n *SideEffect) RemoveUser(u User)
- func (s *SideEffect) ReplaceValue(v Value, to Value)
- func (n *SideEffect) SetKey(k Value)
- func (n *SideEffect) SetObject(v Value)
- func (n *SideEffect) SetType(typ Type)
- func (s *SideEffect) String() string
- type Switch
- func (i *Switch) AddMask(v Value)
- func (a *Switch) AddVariable(v *Variable)
- func (a *Switch) GetAllVariables() map[string]*Variable
- func (a *Switch) GetBlock() *BasicBlock
- func (a *Switch) GetFunc() *Function
- func (a *Switch) GetId() int
- func (a *Switch) GetLastVariable() *Variable
- func (i *Switch) GetMask() []Value
- func (a *Switch) GetName() string
- func (i *Switch) GetOpcode() Opcode
- func (a *Switch) GetOperand(i int) Value
- func (a *Switch) GetOperandNum() int
- func (a *Switch) GetOperands() Values
- func (a *Switch) GetProgram() *Program
- func (c *Switch) GetRange() *Range
- func (r *Switch) GetUsers() Users
- func (sw *Switch) GetValues() Values
- func (a *Switch) GetVariable(name string) *Variable
- func (i *Switch) GetVerboseName() string
- func (r *Switch) HasUsers() bool
- func (sw *Switch) HasValues() bool
- func (c *Switch) IsExtern() bool
- func (i *Switch) IsUndefined() bool
- func (a *Switch) LineDisasm() string
- func (i *Switch) Masked() bool
- func (c *Switch) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (sw *Switch) ReplaceValue(v Value, to Value)
- func (i *Switch) SelfDelete()
- func (a *Switch) SetBlock(block *BasicBlock)
- func (c *Switch) SetExtern(b bool)
- func (a *Switch) SetFunc(f *Function)
- func (a *Switch) SetId(id int)
- func (a *Switch) SetName(v string)
- func (c *Switch) SetRange(pos *Range)
- func (i *Switch) SetVerboseName(verbose string)
- func (sw *Switch) String() string
- type SwitchBuilder
- type SwitchLabel
- type TryBuilder
- type Type
- func CalculateType(ts []Type) Type
- func GetAnyType() Type
- func GetBooleanType() Type
- func GetBytesType() Type
- func GetErrorType() Type
- func GetNullType() Type
- func GetNumberType() Type
- func GetStringType() Type
- func GetType(i any) Type
- func GetTypeByStr(typ string) Type
- func GetUndefinedType() Type
- func ParseClassBluePrint(this Value, objectTyp *ObjectType) (ret Type)
- type TypeCast
- func (n *TypeCast) AddMember(k, v Value)
- func (n *TypeCast) AddUser(u User)
- func (n *TypeCast) DeleteMember(k Value)
- func (n *TypeCast) GetAllMember() map[Value]Value
- func (n *TypeCast) GetIndexMember(i int) (Value, bool)
- func (n *TypeCast) GetKey() Value
- func (n *TypeCast) GetMember(key Value) (Value, bool)
- func (n *TypeCast) GetObject() Value
- func (i *TypeCast) GetOpcode() Opcode
- func (n *TypeCast) GetStringMember(key string) (Value, bool)
- func (n *TypeCast) GetType() Type
- func (n *TypeCast) GetUsers() Users
- func (t *TypeCast) GetValues() Values
- func (n *TypeCast) HasUsers() bool
- func (t *TypeCast) HasValues() bool
- func (n *TypeCast) IsMember() bool
- func (n *TypeCast) IsMemberCallVariable() bool
- func (n *TypeCast) IsObject() bool
- func (n *TypeCast) RemoveUser(u User)
- func (t *TypeCast) ReplaceValue(v, to Value)
- func (n *TypeCast) SetKey(k Value)
- func (n *TypeCast) SetObject(v Value)
- func (n *TypeCast) SetType(typ Type)
- func (t *TypeCast) String() string
- type TypeKind
- type TypeValue
- func (n *TypeValue) AddMember(k, v Value)
- func (n *TypeValue) AddUser(u User)
- func (n *TypeValue) DeleteMember(k Value)
- func (n *TypeValue) GetAllMember() map[Value]Value
- func (n *TypeValue) GetIndexMember(i int) (Value, bool)
- func (n *TypeValue) GetKey() Value
- func (n *TypeValue) GetMember(key Value) (Value, bool)
- func (n *TypeValue) GetObject() Value
- func (i *TypeValue) GetOpcode() Opcode
- func (n *TypeValue) GetStringMember(key string) (Value, bool)
- func (n *TypeValue) GetType() Type
- func (n *TypeValue) GetUsers() Users
- func (t *TypeValue) GetValues() Values
- func (n *TypeValue) HasUsers() bool
- func (t *TypeValue) HasValues() bool
- func (n *TypeValue) IsMember() bool
- func (n *TypeValue) IsMemberCallVariable() bool
- func (n *TypeValue) IsObject() bool
- func (n *TypeValue) RemoveUser(u User)
- func (n *TypeValue) SetKey(k Value)
- func (n *TypeValue) SetObject(v Value)
- func (n *TypeValue) SetType(typ Type)
- func (t *TypeValue) String() string
- type Typed
- type Types
- type UnOp
- func (n *UnOp) AddMember(k, v Value)
- func (n *UnOp) AddUser(u User)
- func (n *UnOp) DeleteMember(k Value)
- func (n *UnOp) GetAllMember() map[Value]Value
- func (n *UnOp) GetIndexMember(i int) (Value, bool)
- func (n *UnOp) GetKey() Value
- func (n *UnOp) GetMember(key Value) (Value, bool)
- func (n *UnOp) GetObject() Value
- func (i *UnOp) GetOpcode() Opcode
- func (n *UnOp) GetStringMember(key string) (Value, bool)
- func (n *UnOp) GetType() Type
- func (n *UnOp) GetUsers() Users
- func (n *UnOp) GetValues() Values
- func (n *UnOp) HasUsers() bool
- func (n *UnOp) HasValues() bool
- func (n *UnOp) IsMember() bool
- func (n *UnOp) IsMemberCallVariable() bool
- func (n *UnOp) IsObject() bool
- func (n *UnOp) RemoveUser(u User)
- func (u *UnOp) ReplaceValue(v Value, to Value)
- func (n *UnOp) SetKey(k Value)
- func (n *UnOp) SetObject(v Value)
- func (n *UnOp) SetType(typ Type)
- func (u *UnOp) String() string
- type UnaryOpcode
- type Undefined
- func (n *Undefined) AddMember(k, v Value)
- func (n *Undefined) AddUser(u User)
- func (n *Undefined) DeleteMember(k Value)
- func (n *Undefined) GetAllMember() map[Value]Value
- func (n *Undefined) GetIndexMember(i int) (Value, bool)
- func (n *Undefined) GetKey() Value
- func (n *Undefined) GetMember(key Value) (Value, bool)
- func (n *Undefined) GetObject() Value
- func (i *Undefined) GetOpcode() Opcode
- func (n *Undefined) GetStringMember(key string) (Value, bool)
- func (n *Undefined) GetType() Type
- func (n *Undefined) GetUsers() Users
- func (u *Undefined) GetValues() Values
- func (n *Undefined) HasUsers() bool
- func (u *Undefined) HasValues() bool
- func (n *Undefined) IsMember() bool
- func (n *Undefined) IsMemberCallVariable() bool
- func (n *Undefined) IsObject() bool
- func (u *Undefined) IsUndefined() bool
- func (n *Undefined) RemoveUser(u User)
- func (n *Undefined) SetKey(k Value)
- func (n *Undefined) SetObject(v Value)
- func (n *Undefined) SetType(typ Type)
- func (u *Undefined) String() string
- type UndefinedKind
- type User
- type Users
- type Value
- func CalcBinary(b *BinOp) Value
- func CalcConstBinarySide(c *ConstInst, v Value, op BinaryOpcode) Value
- func HandlerBinOp(b *BinOp) (ret Value)
- func HandlerUnOp(u *UnOp) (ret Value)
- func NewBinOp(op BinaryOpcode, x, y Value) Value
- func NewUnOp(op UnaryOpcode, x Value) Value
- func ToValue(n any) (Value, bool)
- type Values
- type Variable
- func (v *Variable) AddRange(p *Range, force bool)
- func (variable *Variable) Assign(value Value) error
- func (b *Variable) GetMemberCall() (Value, Value)
- func (b *Variable) IsMemberCall() bool
- func (v *Variable) NewError(kind ErrorKind, tag ErrorTag, msg string)
- func (v *Variable) SetDefRange(r *Range)
- func (v *Variable) SetMemberCall(obj, key Value)
Constants ¶
const ( // loop LoopHeader = "loop.header" // first LoopCondition = "loop.condition" // second // condition LoopBody = "loop.body" // body LoopExit = "loop.exit" // exit LoopLatch = "loop.latch" // third // 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 = "error.done" // switch SwitchDone = "switch.done" SwitchDefault = "switch.default" SwitchHandler = "switch.handler" )
const (
MAXTYPELEVEL = 15
)
const MAXTypeCompareDepth = 10
Variables ¶
var ( NextOk = NewConst("ok") NextField = NewConst("field") NextKey = NewConst("key") )
var BasicTypes = map[TypeKind]*BasicType{ NumberTypeKind: NewBasicType(NumberTypeKind, "number"), StringTypeKind: NewBasicType(StringTypeKind, "string"), BytesTypeKind: NewBasicType(BytesTypeKind, "bytes"), BooleanTypeKind: NewBasicType(BooleanTypeKind, "boolean"), UndefinedTypeKind: NewBasicType(UndefinedTypeKind, "undefined"), NullTypeKind: NewBasicType(NullTypeKind, "null"), AnyTypeKind: NewBasicType(AnyTypeKind, "any"), ErrorTypeKind: NewBasicType(ErrorTypeKind, "error"), }
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`, OpPow: `pow`, }
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 BindingNotFoundInCall ¶ added in v1.3.1
func CallAssignmentMismatch ¶ added in v1.3.1
func CallAssignmentMismatchDropError ¶ added in v1.3.1
func CombineMemberCallVariableName ¶ added in v1.3.1
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 FunctionContReturnError ¶ added in v1.3.1
func FunctionContReturnError() string
func GetKeyString ¶ added in v1.3.1
func GetMethodsName ¶ added in v1.2.9
func GetTypeStr ¶
func IsConst ¶ added in v1.3.1
func IsConst(v Instruction) bool
func IsControlInstruction ¶ added in v1.2.9
func IsControlInstruction(i Instruction) bool
func IsObjectType ¶ added in v1.2.9
func LineDisasm ¶ added in v1.3.0
func LineDisasm(v Instruction) string
LineDisasm disasm a instruction to string
func LineShortDisasm ¶ added in v1.3.1
func LineShortDisasm(v Instruction) string
LineShortDisasm disasm a instruction to string, but will use id or name
func NewInstruction ¶ added in v1.2.8
func NewInstruction() anInstruction
func NewVariable ¶ added in v1.3.0
func NewVariable(globalIndex int, name string, local bool, scope ssautil.ScopedVersionedTableIF[Value]) ssautil.VersionedIF[Value]
func NoCheckMustInFirst ¶ added in v1.2.8
func NoCheckMustInFirst() string
func ReplaceAllValue ¶ added in v1.2.9
func ReplaceMemberCall ¶ added in v1.3.1
func ReplaceValue ¶
func ReplaceValue(v Value, to Value, skip func(Instruction) bool)
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 SpinHandle ¶ added in v1.3.1
func TryGetSimilarityKey ¶ added in v1.2.8
func TypeCompare ¶ added in v1.2.9
func ValueIsNull ¶ added in v1.3.1
func ValueIsNull() string
func ValueUndefined ¶ added in v1.3.1
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) PkgPathString ¶ added in v1.3.1
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) AddVariable ¶ added in v1.3.0
func (a *Assert) AddVariable(v *Variable)
func (*Assert) GetAllVariables ¶ added in v1.3.0
func (*Assert) GetBlock ¶ added in v1.2.8
func (a *Assert) GetBlock() *BasicBlock
func (*Assert) GetLastVariable ¶ added in v1.3.1
func (a *Assert) GetLastVariable() *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) GetProgram ¶ added in v1.3.0
func (a *Assert) GetProgram() *Program
func (*Assert) GetVariable ¶ added in v1.2.8
func (*Assert) GetVerboseName ¶ added in v1.3.1
func (i *Assert) GetVerboseName() string
func (*Assert) IsUndefined ¶ added in v1.3.1
func (i *Assert) IsUndefined() bool
func (*Assert) LineDisasm ¶ added in v1.2.8
func (a *Assert) LineDisasm() string
func (*Assert) ReplaceValue ¶ added in v1.2.8
func (*Assert) SelfDelete ¶ added in v1.3.1
func (i *Assert) SelfDelete()
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) SetVerboseName ¶ added in v1.3.1
func (i *Assert) SetVerboseName(verbose string)
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 ScopeTable *Scope // contains filtered or unexported fields }
implement Value
func (*BasicBlock) AddSucc ¶
func (b *BasicBlock) AddSucc(succ *BasicBlock)
func (*BasicBlock) DeleteMember ¶ added in v1.3.1
func (n *BasicBlock) DeleteMember(k Value)
func (*BasicBlock) EmitInst ¶ added in v1.2.8
func (b *BasicBlock) EmitInst(i Instruction)
func (*BasicBlock) GetAllMember ¶ added in v1.3.1
func (*BasicBlock) GetBlockById ¶ added in v1.2.8
func (b *BasicBlock) GetBlockById(name string) *BasicBlock
func (*BasicBlock) GetIndexMember ¶ added in v1.3.1
func (*BasicBlock) GetOpcode ¶ added in v1.2.8
func (i *BasicBlock) GetOpcode() Opcode
func (*BasicBlock) GetStringMember ¶ added in v1.3.1
func (*BasicBlock) GetType ¶
func (b *BasicBlock) GetType() Type
func (*BasicBlock) GetValues ¶
func (b *BasicBlock) GetValues() Values
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) IsMemberCallVariable ¶ added in v1.3.1
func (n *BasicBlock) IsMemberCallVariable() bool
func (*BasicBlock) LastInst ¶
func (b *BasicBlock) LastInst() Instruction
func (*BasicBlock) Reachable ¶ added in v1.2.8
func (b *BasicBlock) Reachable() int
func (*BasicBlock) RemoveUser ¶
func (n *BasicBlock) RemoveUser(u User)
func (*BasicBlock) SetType ¶
func (b *BasicBlock) SetType(ts Type)
type BasicType ¶
type BasicType struct { Kind TypeKind // contains filtered or unexported fields }
func NewBasicType ¶ added in v1.3.1
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) PkgPathString ¶ added in v1.3.1
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) DeleteMember ¶ added in v1.3.1
func (n *BinOp) DeleteMember(k Value)
func (*BinOp) GetAllMember ¶ added in v1.3.1
func (*BinOp) GetIndexMember ¶ added in v1.3.1
func (*BinOp) GetStringMember ¶ added in v1.3.1
func (*BinOp) IsMemberCallVariable ¶ added in v1.3.1
func (n *BinOp) IsMemberCallVariable() bool
func (*BinOp) RemoveUser ¶
func (n *BinOp) RemoveUser(u User)
func (*BinOp) ReplaceValue ¶
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 // <- OpPow // ** )
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) DeleteMember ¶ added in v1.3.1
func (n *Call) DeleteMember(k Value)
func (*Call) GetAllMember ¶ added in v1.3.1
func (*Call) GetIndexMember ¶ added in v1.3.1
func (*Call) GetStringMember ¶ added in v1.3.1
func (*Call) HandleFreeValue ¶ added in v1.2.8
func (*Call) IsMemberCallVariable ¶ added in v1.3.1
func (n *Call) IsMemberCallVariable() bool
func (*Call) RemoveUser ¶
func (n *Call) RemoveUser(u User)
func (*Call) ReplaceValue ¶
type ChanType ¶
type ChanType struct { Elem Type // 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) PkgPathString ¶ added in v1.3.1
func (*ChanType) SetMethod ¶ added in v1.2.8
func (c *ChanType) SetMethod(m map[string]*FunctionType)
type ClassBluePrint ¶ added in v1.3.2
type ClassBluePrint struct { This Value *ObjectType // this field, is function pin to this object, // when set type to a new object, it will be set to the new object MarkedField map[Value]*FunctionType // key -> value NormalField map[Value]Type // key -> value }
ClassBluePrint is a class blue print, it is used to create a new class
func NewClassBluePrint ¶ added in v1.3.2
func NewClassBluePrint() *ClassBluePrint
func (*ClassBluePrint) AddMethod ¶ added in v1.3.2
func (c *ClassBluePrint) AddMethod(string, *FunctionType)
func (*ClassBluePrint) Apply ¶ added in v1.3.2
func (c *ClassBluePrint) Apply(obj Value) Type
func (*ClassBluePrint) GetMethod ¶ added in v1.3.2
func (c *ClassBluePrint) GetMethod() map[string]*FunctionType
func (*ClassBluePrint) GetTypeKind ¶ added in v1.3.2
func (c *ClassBluePrint) GetTypeKind() TypeKind
func (*ClassBluePrint) PkgPathString ¶ added in v1.3.2
func (c *ClassBluePrint) PkgPathString() string
func (*ClassBluePrint) RawString ¶ added in v1.3.2
func (c *ClassBluePrint) RawString() string
func (*ClassBluePrint) SetMethod ¶ added in v1.3.2
func (c *ClassBluePrint) SetMethod(map[string]*FunctionType)
func (*ClassBluePrint) SetObjectType ¶
func (c *ClassBluePrint) SetObjectType(t *ObjectType)
func (*ClassBluePrint) SetThis ¶
func (c *ClassBluePrint) SetThis(v Value)
func (*ClassBluePrint) String ¶ added in v1.3.2
func (c *ClassBluePrint) String() string
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) DeleteMember ¶ added in v1.3.1
func (n *ConstInst) DeleteMember(k Value)
func (*ConstInst) GetAllMember ¶ added in v1.3.1
func (*ConstInst) GetIndexMember ¶ added in v1.3.1
func (*ConstInst) GetStringMember ¶ added in v1.3.1
func (*ConstInst) HasUsers ¶ added in v1.2.8
func (n *ConstInst) HasUsers() bool
has/get user and value
func (*ConstInst) IsMemberCallVariable ¶ added in v1.3.1
func (n *ConstInst) IsMemberCallVariable() bool
func (*ConstInst) RemoveUser ¶ added in v1.2.8
func (n *ConstInst) RemoveUser(u User)
func (*ConstInst) ReplaceValue ¶ added in v1.3.0
type DisasmLiner ¶ added in v1.3.0
type DisasmLiner interface { DisasmValue(v Value) string // level += 1; and check should stop? // if this method return true, should stop AddLevel() bool SkipLevelChecking() bool // cache // those method should use `*cacheDisasmLiner` GetName(v Instruction) (string, bool) SetName(v Instruction, name string) DeleteName(v Instruction) }
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 *Range) 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) AddVariable ¶ added in v1.3.0
func (a *ErrorHandler) AddVariable(v *Variable)
func (*ErrorHandler) GetAllVariables ¶ added in v1.3.0
func (*ErrorHandler) GetBlock ¶ added in v1.2.8
func (a *ErrorHandler) GetBlock() *BasicBlock
func (*ErrorHandler) GetLastVariable ¶ added in v1.3.1
func (a *ErrorHandler) GetLastVariable() *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) GetProgram ¶ added in v1.3.0
func (a *ErrorHandler) GetProgram() *Program
func (*ErrorHandler) GetRange ¶ added in v1.3.0
func (c *ErrorHandler) GetRange() *Range
source code position
func (*ErrorHandler) GetVariable ¶ added in v1.2.8
func (*ErrorHandler) GetVerboseName ¶ added in v1.3.1
func (i *ErrorHandler) GetVerboseName() string
func (*ErrorHandler) IsUndefined ¶ added in v1.3.1
func (i *ErrorHandler) IsUndefined() bool
func (*ErrorHandler) LineDisasm ¶ added in v1.2.8
func (a *ErrorHandler) LineDisasm() string
func (*ErrorHandler) ReplaceValue ¶ added in v1.3.1
func (*ErrorHandler) SelfDelete ¶ added in v1.3.1
func (i *ErrorHandler) SelfDelete()
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) SetVerboseName ¶ added in v1.3.1
func (i *ErrorHandler) SetVerboseName(verbose string)
func (*ErrorHandler) String ¶ added in v1.2.8
func (e *ErrorHandler) String() string
type ErrorLogger ¶ added in v1.2.8
type ExternLib ¶ added in v1.3.0
type ExternLib struct { MemberMap map[string]Value Member []Value // contains filtered or unexported fields }
----------- externLib
func NewExternLib ¶ added in v1.3.0
func NewExternLib(variable string, builder *FunctionBuilder, table map[string]any) *ExternLib
func ToExternLib ¶ added in v1.3.0
func ToExternLib(v Instruction) (*ExternLib, bool)
func (*ExternLib) BuildField ¶ added in v1.3.0
func (*ExternLib) DeleteMember ¶ added in v1.3.1
func (n *ExternLib) DeleteMember(k Value)
func (*ExternLib) GetAllMember ¶ added in v1.3.1
func (*ExternLib) GetIndexMember ¶ added in v1.3.1
func (*ExternLib) GetStringMember ¶ added in v1.3.1
func (*ExternLib) HasUsers ¶ added in v1.3.0
func (n *ExternLib) HasUsers() bool
has/get user and value
func (*ExternLib) IsMemberCallVariable ¶ added in v1.3.1
func (n *ExternLib) IsMemberCallVariable() bool
func (*ExternLib) RemoveUser ¶ added in v1.3.0
func (n *ExternLib) RemoveUser(u User)
func (*ExternLib) ReplaceValue ¶ added in v1.3.0
type FullDisasmLiner ¶ added in v1.3.1
type FullDisasmLiner struct {
// contains filtered or unexported fields
}
func NewFullDisasmLiner ¶ added in v1.3.1
func NewFullDisasmLiner(max int) *FullDisasmLiner
func (*FullDisasmLiner) AddLevel ¶ added in v1.3.1
func (f *FullDisasmLiner) AddLevel() bool
func (FullDisasmLiner) DeleteName ¶ added in v1.3.1
func (b FullDisasmLiner) DeleteName(i Instruction)
func (*FullDisasmLiner) DisasmValue ¶ added in v1.3.1
func (f *FullDisasmLiner) DisasmValue(v Value) string
func (FullDisasmLiner) GetName ¶ added in v1.3.1
func (b FullDisasmLiner) GetName(i Instruction) (string, bool)
func (FullDisasmLiner) SetName ¶ added in v1.3.1
func (b FullDisasmLiner) SetName(i Instruction, name string)
func (*FullDisasmLiner) SkipLevelChecking ¶ added in v1.3.1
func (b *FullDisasmLiner) SkipLevelChecking() bool
type Function ¶
type Function struct { // package, double link Package *Package // just function parameter and all return instruction Param []*Parameter ParamLength int Return []*Return // BasicBlock list Blocks []*BasicBlock // First and End block EnterBlock *BasicBlock ExitBlock *BasicBlock // For Defer semantic // this block will always execute when the function exits, // regardless of whether the function returns normally or exits due to a panic. DeferBlock *BasicBlock // for closure function FreeValues map[string]*Parameter // store the captured variable form parent-function, just contain name, and type is Parameter // closure function side effects // TODO: currently, this value is not being used, but it should be utilized in the future. SideEffects []*FunctionSideEffect ChildFuncs []*Function // child function within this function // 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) AddSideEffect ¶ added in v1.2.9
func (*Function) CheckAndSetSideEffect ¶ added in v1.3.2
func (*Function) DeleteMember ¶ added in v1.3.1
func (n *Function) DeleteMember(k Value)
func (*Function) DisAsm ¶
func (f *Function) DisAsm(flag FunctionAsmFlag) string
func (*Function) Finish ¶
func (f *Function) Finish()
Finish the function, set FunctionType, set EnterBlock/ExitBlock
func (*Function) FirstBlockInstruction ¶ added in v1.3.0
func (f *Function) FirstBlockInstruction() []Instruction
func (*Function) GetAllMember ¶ added in v1.3.1
func (*Function) GetDeferBlock ¶ added in v1.2.9
func (f *Function) GetDeferBlock() *BasicBlock
func (*Function) GetIndexMember ¶ added in v1.3.1
func (*Function) GetProgram ¶ added in v1.3.0
func (*Function) GetReferenceFiles ¶ added in v1.3.1
func (*Function) GetStringMember ¶ added in v1.3.1
func (*Function) HasUsers ¶ added in v1.2.8
func (n *Function) HasUsers() bool
has/get user and value
func (*Function) IsMemberCallVariable ¶ added in v1.3.1
func (n *Function) IsMemberCallVariable() bool
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) PushReferenceFile ¶ added in v1.3.1
func (*Function) RemoveUser ¶
func (n *Function) RemoveUser(u User)
func (*Function) ReturnValue ¶
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 CurrentRange *Range // current position in source code ExternInstance map[string]any ExternLib map[string]map[string]any DefineFunc map[string]any MarkedFunc *FunctionType MarkedVariable *Variable MarkedThisObject Value // 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) AssignVariable ¶ added in v1.3.1
func (b *FunctionBuilder) AssignVariable(variable *Variable, value Value)
AssignVariable assign value to variable
func (*FunctionBuilder) Break ¶ added in v1.3.1
func (b *FunctionBuilder) Break() bool
func (*FunctionBuilder) BuildFreeValue ¶
func (b *FunctionBuilder) BuildFreeValue(variable string) *Parameter
func (*FunctionBuilder) BuildSwitch ¶ added in v1.2.8
func (b *FunctionBuilder) BuildSwitch() *SwitchBuilder
func (*FunctionBuilder) BuildSyntaxBlock ¶ added in v1.3.1
func (b *FunctionBuilder) BuildSyntaxBlock(builder func())
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) Continue ¶ added in v1.3.1
func (b *FunctionBuilder) Continue() bool
func (*FunctionBuilder) CoverReflectFunctionType ¶ added in v1.2.8
func (f *FunctionBuilder) CoverReflectFunctionType(itype reflect.Type, level int) *FunctionType
func (*FunctionBuilder) CreateIfBuilder ¶ added in v1.3.1
func (b *FunctionBuilder) CreateIfBuilder() *IfBuilder
CreateIfBuilder Create IfBuilder
func (*FunctionBuilder) CreateInterfaceWithMap ¶ added in v1.3.1
func (b *FunctionBuilder) CreateInterfaceWithMap(keys []Value, vs []Value) *Make
func (*FunctionBuilder) CreateInterfaceWithSlice ¶ added in v1.3.1
func (b *FunctionBuilder) CreateInterfaceWithSlice(vs []Value) *Make
func (*FunctionBuilder) CreateLocalVariable ¶ added in v1.3.1
func (b *FunctionBuilder) CreateLocalVariable(name string) *Variable
CreateVariable create variable
func (*FunctionBuilder) CreateLoopBuilder ¶ added in v1.3.1
func (b *FunctionBuilder) CreateLoopBuilder() *LoopBuilder
CreateLoopBuilder Create LoopBuilder
func (*FunctionBuilder) CreateMemberCallVariable ¶ added in v1.3.1
func (b *FunctionBuilder) CreateMemberCallVariable(value, key Value) *Variable
func (*FunctionBuilder) CreateVariable ¶ added in v1.3.1
func (b *FunctionBuilder) CreateVariable(name string) *Variable
func (*FunctionBuilder) DeleteLabel ¶ added in v1.2.8
func (b *FunctionBuilder) DeleteLabel(name string)
func (FunctionBuilder) DeleteMember ¶ added in v1.3.1
func (n FunctionBuilder) DeleteMember(k Value)
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) EmitFirst ¶ added in v1.3.1
func (b *FunctionBuilder) EmitFirst(i Instruction, block *BasicBlock)
func (*FunctionBuilder) EmitIf ¶
func (f *FunctionBuilder) EmitIf() *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) EmitNewClassBluePrint ¶ added in v1.3.2
func (f *FunctionBuilder) EmitNewClassBluePrint(memberCount int) *ClassBluePrint
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) EmitPhi ¶ added in v1.3.1
func (f *FunctionBuilder) EmitPhi(name string, vs []Value) *Phi
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) EmitSideEffect ¶ added in v1.3.1
func (f *FunctionBuilder) EmitSideEffect(name string, call *Call, value Value) *SideEffect
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) EmitUndefined ¶ added in v1.3.1
func (f *FunctionBuilder) EmitUndefined(name string) *Undefined
EmitUndefined emit undefined value the current block is finished. NOTE: the object/membercall will create vars in finished blocks
func (*FunctionBuilder) Fallthrough ¶ added in v1.3.1
func (b *FunctionBuilder) Fallthrough() bool
func (FunctionBuilder) GetAllMember ¶ added in v1.3.1
func (FunctionBuilder) GetIndexMember ¶ added in v1.3.1
func (*FunctionBuilder) GetLabel ¶ added in v1.2.8
func (b *FunctionBuilder) GetLabel(name string) *BasicBlock
func (*FunctionBuilder) GetMarkedFunction ¶ added in v1.3.1
func (b *FunctionBuilder) GetMarkedFunction() *FunctionType
func (FunctionBuilder) GetStringMember ¶ added in v1.3.1
func (FunctionBuilder) GetType ¶ added in v1.2.8
func (n FunctionBuilder) GetType() Type
for Value : type
func (FunctionBuilder) HasUsers ¶ added in v1.2.8
func (n FunctionBuilder) HasUsers() bool
has/get user and value
func (*FunctionBuilder) InterfaceAddFieldBuild ¶ added in v1.3.1
func (*FunctionBuilder) IsBlockFinish ¶ added in v1.3.0
func (b *FunctionBuilder) IsBlockFinish() bool
current block is finish?
func (FunctionBuilder) IsMemberCallVariable ¶ added in v1.3.1
func (n FunctionBuilder) IsMemberCallVariable() bool
func (*FunctionBuilder) IsParentFunctionVariable ¶ added in v1.3.1
func (b *FunctionBuilder) IsParentFunctionVariable(v *Variable) bool
func (*FunctionBuilder) NewCall ¶
func (f *FunctionBuilder) NewCall(target Value, args []Value) *Call
func (*FunctionBuilder) NewError ¶
func (b *FunctionBuilder) NewError(kind ErrorKind, tag ErrorTag, massage string, arg ...interface{})
func (*FunctionBuilder) NewFunc ¶
func (b *FunctionBuilder) NewFunc(name string) *Function
new function
func (*FunctionBuilder) NewParam ¶ added in v1.3.1
func (f *FunctionBuilder) NewParam(name string) *Parameter
func (*FunctionBuilder) PeekValue ¶ added in v1.3.1
func (b *FunctionBuilder) PeekValue(name string) Value
func (*FunctionBuilder) PeekValueByVariable ¶ added in v1.3.1
func (b *FunctionBuilder) PeekValueByVariable(v *Variable) Value
func (*FunctionBuilder) PeekValueInThisFunction ¶ added in v1.3.1
func (b *FunctionBuilder) PeekValueInThisFunction(name string) Value
func (*FunctionBuilder) PopFunction ¶
func (b *FunctionBuilder) PopFunction() *FunctionBuilder
func (*FunctionBuilder) PopTarget ¶
func (b *FunctionBuilder) PopTarget() bool
func (*FunctionBuilder) PushFunction ¶
func (b *FunctionBuilder) PushFunction(newFunc *Function) *FunctionBuilder
function stack
func (*FunctionBuilder) PushTarget ¶
func (b *FunctionBuilder) PushTarget(scope ssautil.LabelTarget[Value], _break, _continue, _fallthrough *BasicBlock)
target stack
func (*FunctionBuilder) ReadMemberCallVariable ¶ added in v1.3.1
func (b *FunctionBuilder) ReadMemberCallVariable(value, key Value) Value
func (*FunctionBuilder) ReadOrCreateMemberCallVariable ¶ added in v1.3.1
func (b *FunctionBuilder) ReadOrCreateMemberCallVariable(caller, callee Value) Value
func (*FunctionBuilder) ReadOrCreateVariable ¶ added in v1.3.1
func (b *FunctionBuilder) ReadOrCreateVariable(name string) Value
func (*FunctionBuilder) ReadValue ¶ added in v1.3.1
func (b *FunctionBuilder) ReadValue(name string) Value
ReadValue get value by name
func (*FunctionBuilder) ReadValueByVariable ¶ added in v1.3.1
func (b *FunctionBuilder) ReadValueByVariable(v *Variable) Value
ReadValueByVariable get value by variable
func (*FunctionBuilder) ReadValueInThisFunction ¶ added in v1.3.1
func (b *FunctionBuilder) ReadValueInThisFunction(name string) Value
func (FunctionBuilder) RemoveUser ¶ added in v1.2.8
func (n FunctionBuilder) RemoveUser(u User)
func (*FunctionBuilder) SetCurrent ¶ added in v1.2.8
func (f *FunctionBuilder) SetCurrent(i Instruction) func()
func (*FunctionBuilder) SetInstructionPosition ¶ added in v1.2.9
func (f *FunctionBuilder) SetInstructionPosition(i Instruction)
func (*FunctionBuilder) SetMarkedFunction ¶ added in v1.3.1
func (b *FunctionBuilder) SetMarkedFunction(name string)
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) WithDefineFunction ¶ added in v1.3.1
func (b *FunctionBuilder) WithDefineFunction(defineFunc map[string]any)
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)
type FunctionSideEffect ¶ added in v1.3.1
type FunctionSideEffect struct { Name string VerboseName string Modify Value // only call-side Scope > this Scope-level, this side-effect can be create // Scope *Scope Variable *Variable // is modify parameter field IsMemberCall bool ParameterIndex int Key Value }
FunctionSideEffect is a side-effect in a closure
type FunctionType ¶ added in v1.2.8
type FunctionType struct { Name string ReturnType Type Parameter Types ParameterLen int ParameterValue []*Parameter FreeValue []*Parameter SideEffects []*FunctionSideEffect IsVariadic bool IsMethod bool IsModifySelf bool // if this is method function // contains filtered or unexported fields }
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) Copy ¶ added in v1.3.2
func (f *FunctionType) Copy() *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) PkgPathString ¶ added in v1.3.1
func (s *FunctionType) PkgPathString() string
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 map[string]*Parameter)
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 []*FunctionSideEffect)
func (*FunctionType) String ¶ added in v1.2.8
func (s *FunctionType) String() string
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) AddTrue ¶
func (i *If) AddTrue(t *BasicBlock)
func (*If) AddVariable ¶ added in v1.3.0
func (a *If) AddVariable(v *Variable)
func (*If) GetAllVariables ¶ added in v1.3.0
func (*If) GetBlock ¶
func (a *If) GetBlock() *BasicBlock
func (*If) GetLastVariable ¶ added in v1.3.1
func (a *If) GetLastVariable() *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) GetProgram ¶ added in v1.3.0
func (a *If) GetProgram() *Program
func (*If) GetVariable ¶ added in v1.2.8
func (*If) GetVerboseName ¶ added in v1.3.1
func (i *If) GetVerboseName() string
func (*If) IsUndefined ¶ added in v1.3.1
func (i *If) IsUndefined() bool
func (*If) LineDisasm ¶ added in v1.2.8
func (a *If) LineDisasm() string
func (*If) ReplaceValue ¶
func (*If) SelfDelete ¶ added in v1.3.1
func (i *If) SelfDelete()
func (*If) SetBlock ¶ added in v1.2.8
func (a *If) SetBlock(block *BasicBlock)
func (*If) SetCondition ¶ added in v1.3.1
func (*If) SetVerboseName ¶ added in v1.3.1
func (i *If) SetVerboseName(verbose string)
type IfBuilder ¶ added in v1.2.8
type IfBuilder struct {
// contains filtered or unexported fields
}
IfBuilder is a builder for if statement ssa control flow: if builder
func (*IfBuilder) AppendItem ¶ added in v1.3.1
AppendItem append IfBuilderItem to IfBuilder
func (*IfBuilder) SetCondition ¶ added in v1.3.1
SetCondition build if condition and body, short for append item
type IfBuilderItem ¶ added in v1.3.1
type IfBuilderItem struct { Condition func() Value Body func() }
IfBuilderItem is pair of condition and body, if condition is true, then run body
type Instruction ¶
type Instruction interface { ErrorLogger GetOpcode() Opcode // function GetFunc() *Function SetFunc(*Function) // block GetBlock() *BasicBlock SetBlock(*BasicBlock) // program GetProgram() *Program GetName() string SetName(variable string) GetVerboseName() string SetVerboseName(string) GetId() int // for identify SetId(int) // position GetRange() *Range SetRange(*Range) // extern IsExtern() bool SetExtern(bool) GetVariable(string) *Variable GetLastVariable() *Variable GetAllVariables() map[string]*Variable AddVariable(*Variable) ReplaceValue(Value, Value) SelfDelete() }
type InterfaceType ¶
type InterfaceType struct {
// contains filtered or unexported fields
}
====================== interface type
func NewInterfaceType ¶
func NewInterfaceType(name, pkgPath 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) PkgPathString ¶ added in v1.3.1
func (i *InterfaceType) PkgPathString() string
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) AddVariable ¶ added in v1.3.0
func (a *Jump) AddVariable(v *Variable)
func (*Jump) GetAllVariables ¶ added in v1.3.0
func (*Jump) GetBlock ¶
func (a *Jump) GetBlock() *BasicBlock
func (*Jump) GetLastVariable ¶ added in v1.3.1
func (a *Jump) GetLastVariable() *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) GetProgram ¶ added in v1.3.0
func (a *Jump) GetProgram() *Program
func (*Jump) GetVariable ¶ added in v1.2.8
func (*Jump) GetVerboseName ¶ added in v1.3.1
func (i *Jump) GetVerboseName() string
func (*Jump) IsUndefined ¶ added in v1.3.1
func (i *Jump) IsUndefined() bool
func (*Jump) LineDisasm ¶ added in v1.2.8
func (a *Jump) LineDisasm() string
func (*Jump) ReplaceValue ¶ added in v1.3.1
func (*Jump) SelfDelete ¶ added in v1.3.1
func (i *Jump) SelfDelete()
func (*Jump) SetBlock ¶ added in v1.2.8
func (a *Jump) SetBlock(block *BasicBlock)
func (*Jump) SetVerboseName ¶ added in v1.3.1
func (i *Jump) SetVerboseName(verbose string)
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) AddVariable ¶ added in v1.3.0
func (a *Loop) AddVariable(v *Variable)
func (*Loop) GetAllVariables ¶ added in v1.3.0
func (*Loop) GetBlock ¶ added in v1.2.8
func (a *Loop) GetBlock() *BasicBlock
func (*Loop) GetLastVariable ¶ added in v1.3.1
func (a *Loop) GetLastVariable() *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) GetProgram ¶ added in v1.3.0
func (a *Loop) GetProgram() *Program
func (*Loop) GetVariable ¶ added in v1.2.8
func (*Loop) GetVerboseName ¶ added in v1.3.1
func (i *Loop) GetVerboseName() string
func (*Loop) IsUndefined ¶ added in v1.3.1
func (i *Loop) IsUndefined() bool
func (*Loop) LineDisasm ¶ added in v1.2.8
func (a *Loop) LineDisasm() string
func (*Loop) ReplaceValue ¶ added in v1.2.8
func (*Loop) SelfDelete ¶ added in v1.3.1
func (i *Loop) SelfDelete()
func (*Loop) SetBlock ¶ added in v1.2.8
func (a *Loop) SetBlock(block *BasicBlock)
func (*Loop) SetVerboseName ¶ added in v1.3.1
func (i *Loop) SetVerboseName(verbose string)
type LoopBuilder ¶ added in v1.2.8
type LoopBuilder struct {
// contains filtered or unexported fields
}
enter:
... // for first expression in here jump loop.header
loop.header: <- enter, loop.latch
// for stmt cond in here If [cond] true -> loop.body, false -> loop.exit
loop.body: <- loop.header
// for body block in here
loop.latch: <- loop.body (target of continue)
// for third expr in here jump loop.header
loop.exit: <- loop.header (target of break)
jump rest
rest:
...rest.code....
LoopBuilder is a builder for loop statement
func (*LoopBuilder) Finish ¶ added in v1.2.8
func (lb *LoopBuilder) Finish()
func (*LoopBuilder) SetBody ¶ added in v1.3.1
func (lb *LoopBuilder) SetBody(f func())
SetBody : Loop Body
func (*LoopBuilder) SetCondition ¶ added in v1.3.1
func (lb *LoopBuilder) SetCondition(f func() Value)
SetCondition : Loop Condition
func (*LoopBuilder) SetFirst ¶ added in v1.3.1
func (lb *LoopBuilder) SetFirst(f func() []Value)
SetFirst : Loop First Expression
func (*LoopBuilder) SetThird ¶ added in v1.3.1
func (lb *LoopBuilder) SetThird(f func() []Value)
SetThird : Loop Third Expression
type Make ¶ added in v1.2.8
type Make struct {
// when slice or map
Len, Cap Value
// contains filtered or unexported fields
}
----------- Make
func ToMake ¶ added in v1.3.0
func ToMake(v Instruction) (*Make, bool)
func (*Make) DeleteMember ¶ added in v1.3.1
func (n *Make) DeleteMember(k Value)
func (*Make) GetAllMember ¶ added in v1.3.1
func (*Make) GetIndexMember ¶ added in v1.3.1
func (*Make) GetStringMember ¶ added in v1.3.1
func (*Make) IsMemberCallVariable ¶ added in v1.3.1
func (n *Make) IsMemberCallVariable() bool
func (*Make) RemoveUser ¶ added in v1.2.8
func (n *Make) RemoveUser(u User)
func (*Make) ReplaceValue ¶ added in v1.2.8
type MemberCall ¶ added in v1.3.1
type MemberCall interface { // object member caller IsObject() bool AddMember(Value, Value) GetMember(Value) (Value, bool) GetIndexMember(int) (Value, bool) GetStringMember(string) (Value, bool) DeleteMember(Value) // delete by key GetAllMember() map[Value]Value // map[key]value // member, member callee IsMember() bool SetObject(Value) SetKey(Value) GetKey() Value GetObject() Value }
type MethodBuilder ¶ added in v1.2.9
type MethodBuilder interface { Build(Type, string) *FunctionType GetMethodNames(Type) []string }
var ExternMethodBuilder MethodBuilder
type NameDisasmLiner ¶ added in v1.3.1
type NameDisasmLiner struct {
// contains filtered or unexported fields
}
func NewNameDisasmLiner ¶ added in v1.3.1
func NewNameDisasmLiner() *NameDisasmLiner
func (*NameDisasmLiner) AddLevel ¶ added in v1.3.1
func (n *NameDisasmLiner) AddLevel() bool
func (NameDisasmLiner) DeleteName ¶ added in v1.3.1
func (b NameDisasmLiner) DeleteName(i Instruction)
func (*NameDisasmLiner) DisasmValue ¶ added in v1.3.1
func (n *NameDisasmLiner) DisasmValue(v Value) string
func (NameDisasmLiner) GetName ¶ added in v1.3.1
func (b NameDisasmLiner) GetName(i Instruction) (string, bool)
func (NameDisasmLiner) SetName ¶ added in v1.3.1
func (b NameDisasmLiner) SetName(i Instruction, name string)
func (*NameDisasmLiner) SkipLevelChecking ¶ added in v1.3.1
func (b *NameDisasmLiner) SkipLevelChecking() bool
type Next ¶ added in v1.2.8
type Next struct { Iter Value InNext bool // "in" grammar // contains filtered or unexported fields }
------------- Next
func (*Next) DeleteMember ¶ added in v1.3.1
func (n *Next) DeleteMember(k Value)
func (*Next) GetAllMember ¶ added in v1.3.1
func (*Next) GetIndexMember ¶ added in v1.3.1
func (*Next) GetStringMember ¶ added in v1.3.1
func (*Next) IsMemberCallVariable ¶ added in v1.3.1
func (n *Next) IsMemberCallVariable() bool
func (*Next) RemoveUser ¶ added in v1.2.8
func (n *Next) RemoveUser(u User)
func (*Next) ReplaceValue ¶ added in v1.2.8
type Node ¶
type Node interface { // string String() string // for graph HasUsers() bool GetUsers() Users HasValues() bool GetValues() Values IsUndefined() bool }
data-flow
type ObjectType ¶ added in v1.2.8
type ObjectType struct { Name string Kind TypeKind Len int Keys []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
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) PkgPathString ¶ added in v1.3.1
func (i *ObjectType) PkgPathString() string
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) SetTypeKind ¶ added in v1.3.1
func (i *ObjectType) SetTypeKind(t TypeKind)
func (*ObjectType) String ¶ added in v1.2.8
func (itype *ObjectType) String() string
type Opcode ¶ added in v1.2.8
type Opcode string
const ( OpUnknown Opcode = "unknown" OpFunction Opcode = "Function" OpBasicBlock Opcode = "BasicBlock" OpParameter Opcode = "Parameter" OpFreeValue Opcode = "FreeValue" OpExternLib Opcode = "ExternLib" OpPhi Opcode = "Phi" OpConstInst Opcode = "ConstInst" OpUndefined Opcode = "Undefined" OpBinOp Opcode = "BinOp" OpUnOp Opcode = "UnOp" OpCall Opcode = "Call" OpSideEffect Opcode = "SideEffect" OpReturn Opcode = "Return" OpMake Opcode = "Make" OpNext Opcode = "Next" OpAssert Opcode = "Assert" OpTypeCast Opcode = "TypeCast" OpTypeValue Opcode = "TypeValue" OpErrorHandler Opcode = "ErrorHandler" OpPanic Opcode = "Panic" OpRecover Opcode = "Recover" OpJump Opcode = "Jump" OpIf Opcode = "If" OpLoop Opcode = "Loop" OpSwitch Opcode = "Switch" )
type Package ¶
type Package struct { Name string // point to program Prog *Program // function list Funcs map[string]*Function }
func NewPackage ¶ added in v1.2.8
func (*Package) GetFunction ¶ added in v1.3.0
func (*Package) NewFunction ¶
type Panic ¶ added in v1.2.8
type Panic struct { Info Value // contains filtered or unexported fields }
-------------- PANIC
func (*Panic) DeleteMember ¶ added in v1.3.1
func (n *Panic) DeleteMember(k Value)
func (*Panic) GetAllMember ¶ added in v1.3.1
func (*Panic) GetIndexMember ¶ added in v1.3.1
func (*Panic) GetStringMember ¶ added in v1.3.1
func (*Panic) IsMemberCallVariable ¶ added in v1.3.1
func (n *Panic) IsMemberCallVariable() bool
func (*Panic) RemoveUser ¶ added in v1.2.8
func (n *Panic) RemoveUser(u User)
func (*Panic) ReplaceValue ¶ added in v1.2.8
type Parameter ¶
type Parameter struct { IsFreeValue bool FormalParameterIndex int // if this flag set, this parameter will be set to member call, // if pass a as parameter, it will be set to `a.Key` is parameter IsMemberCall bool MemberCallObjectIndex int MemberCallKey Value // contains filtered or unexported fields }
----------- Parameter
func NewParam ¶ added in v1.2.8
func NewParam(variable string, isFreeValue bool, builder *FunctionBuilder) *Parameter
func ToParameter ¶ added in v1.2.8
func ToParameter(v Instruction) (*Parameter, bool)
func (*Parameter) DeleteMember ¶ added in v1.3.1
func (n *Parameter) DeleteMember(k Value)
func (*Parameter) GetAllMember ¶ added in v1.3.1
func (*Parameter) GetDefault ¶ added in v1.3.1
func (*Parameter) GetIndexMember ¶ added in v1.3.1
func (*Parameter) GetStringMember ¶ added in v1.3.1
func (*Parameter) HasUsers ¶ added in v1.2.8
func (n *Parameter) HasUsers() bool
has/get user and value
func (*Parameter) IsMemberCallVariable ¶ added in v1.3.1
func (n *Parameter) IsMemberCallVariable() bool
func (*Parameter) RemoveUser ¶
func (n *Parameter) RemoveUser(u User)
func (*Parameter) SetDefault ¶ added in v1.2.8
type ParentScope ¶ added in v1.3.1
type ParentScope struct {
// contains filtered or unexported fields
}
func (*ParentScope) Create ¶ added in v1.3.1
func (p *ParentScope) Create(scope *Scope) *ParentScope
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) DeleteMember ¶ added in v1.3.1
func (n *Phi) DeleteMember(k Value)
func (*Phi) GetAllMember ¶ added in v1.3.1
func (*Phi) GetIndexMember ¶ added in v1.3.1
func (*Phi) GetStringMember ¶ added in v1.3.1
func (*Phi) IsMemberCallVariable ¶ added in v1.3.1
func (n *Phi) IsMemberCallVariable() bool
func (*Phi) RemoveUser ¶
func (n *Phi) RemoveUser(u User)
func (*Phi) ReplaceValue ¶
type Position ¶
func NewPosition ¶ added in v1.3.0
type Program ¶
type Program struct { // package list Packages map[string]*Package ConstInstruction *omap.OrderedMap[int, *ConstInst] NameToInstructions *omap.OrderedMap[string, []Instruction] IdToInstructionMap *omap.OrderedMap[int, Instruction] // contains filtered or unexported fields }
both instruction and value
func NewProgram ¶
func NewProgram() *Program
func (*Program) AddPackage ¶ added in v1.2.8
func (*Program) DeleteInstruction ¶ added in v1.3.0
func (p *Program) DeleteInstruction(i Instruction)
func (*Program) EachFunction ¶ added in v1.3.0
func (*Program) GetAndCreateMainFunction ¶ added in v1.3.0
func (*Program) GetAndCreateMainFunctionBuilder ¶ added in v1.3.0
func (prog *Program) GetAndCreateMainFunctionBuilder() *FunctionBuilder
create or get main function builder
func (*Program) GetFunctionFast ¶ added in v1.3.0
func (*Program) GetInstructionById ¶ added in v1.3.0
func (p *Program) GetInstructionById(id int) Instruction
func (*Program) GetInstructionsByName ¶ added in v1.3.0
func (p *Program) GetInstructionsByName(name string) []Instruction
func (*Program) GetPackage ¶ added in v1.3.0
func (*Program) RemoveInstructionWithName ¶ added in v1.3.1
func (p *Program) RemoveInstructionWithName(name string, i Instruction)
func (*Program) SetInstructionWithName ¶ added in v1.3.0
func (p *Program) SetInstructionWithName(name string, i Instruction)
func (*Program) SetVirtualRegister ¶ added in v1.3.0
func (p *Program) SetVirtualRegister(i Instruction)
set virtual register, and this virtual-register will be instruction-id and set to the instruction
func (*Program) ShowWithSource ¶
func (p *Program) ShowWithSource()
type Range ¶ added in v1.3.0
func (*Range) CompareEnd ¶ added in v1.3.0
func (*Range) CompareStart ¶ added in v1.3.0
if ret < 0: p before other if ret == 0: p = other if ret > 0: p after other
type Recover ¶ added in v1.2.8
type Recover struct {
// contains filtered or unexported fields
}
--------------- RECOVER
func (*Recover) DeleteMember ¶ added in v1.3.1
func (n *Recover) DeleteMember(k Value)
func (*Recover) GetAllMember ¶ added in v1.3.1
func (*Recover) GetIndexMember ¶ added in v1.3.1
func (*Recover) GetStringMember ¶ added in v1.3.1
func (*Recover) IsMemberCallVariable ¶ added in v1.3.1
func (n *Recover) IsMemberCallVariable() bool
func (*Recover) RemoveUser ¶ added in v1.2.8
func (n *Recover) RemoveUser(u User)
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) DeleteMember ¶ added in v1.3.1
func (n *Return) DeleteMember(k Value)
func (*Return) GetAllMember ¶ added in v1.3.1
func (*Return) GetIndexMember ¶ added in v1.3.1
func (*Return) GetStringMember ¶ added in v1.3.1
func (*Return) IsMemberCallVariable ¶ added in v1.3.1
func (n *Return) IsMemberCallVariable() bool
func (*Return) RemoveUser ¶ added in v1.2.9
func (n *Return) RemoveUser(u User)
func (*Return) ReplaceValue ¶
type Scope ¶ added in v1.3.0
type Scope struct { *ssautil.ScopedVersionedTable[Value] }
func (*Scope) CreateSubScope ¶ added in v1.3.1
func (s *Scope) CreateSubScope() ssautil.ScopedVersionedTableIF[Value]
type ScopeIF ¶ added in v1.3.1
type ScopeIF ssautil.ScopedVersionedTableIF[Value]
type SideEffect ¶ added in v1.2.9
type SideEffect struct { CallSite *Call // call instruction Value Value // modify to this value // contains filtered or unexported fields }
----------- SideEffect
func NewSideEffect ¶ added in v1.2.9
func NewSideEffect(variable string, call *Call, value Value) *SideEffect
func (*SideEffect) DeleteMember ¶ added in v1.3.1
func (n *SideEffect) DeleteMember(k Value)
func (*SideEffect) GetAllMember ¶ added in v1.3.1
func (*SideEffect) GetIndexMember ¶ added in v1.3.1
func (*SideEffect) GetOpcode ¶ added in v1.2.9
func (i *SideEffect) GetOpcode() Opcode
func (*SideEffect) GetStringMember ¶ added in v1.3.1
func (*SideEffect) GetValues ¶ added in v1.2.9
func (s *SideEffect) GetValues() Values
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) IsMemberCallVariable ¶ added in v1.3.1
func (n *SideEffect) IsMemberCallVariable() bool
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) 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) AddVariable ¶ added in v1.3.0
func (a *Switch) AddVariable(v *Variable)
func (*Switch) GetAllVariables ¶ added in v1.3.0
func (*Switch) GetBlock ¶
func (a *Switch) GetBlock() *BasicBlock
func (*Switch) GetLastVariable ¶ added in v1.3.1
func (a *Switch) GetLastVariable() *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) GetProgram ¶ added in v1.3.0
func (a *Switch) GetProgram() *Program
func (*Switch) GetVariable ¶ added in v1.2.8
func (*Switch) GetVerboseName ¶ added in v1.3.1
func (i *Switch) GetVerboseName() string
func (*Switch) IsUndefined ¶ added in v1.3.1
func (i *Switch) IsUndefined() bool
func (*Switch) LineDisasm ¶ added in v1.2.8
func (a *Switch) LineDisasm() string
func (*Switch) ReplaceValue ¶
func (*Switch) SelfDelete ¶ added in v1.3.1
func (i *Switch) SelfDelete()
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) SetVerboseName ¶ added in v1.3.1
func (i *Switch) SetVerboseName(verbose string)
type SwitchBuilder ¶ added in v1.2.8
type SwitchBuilder struct { AutoBreak bool // contains filtered or unexported fields }
func (*SwitchBuilder) BuildBody ¶ added in v1.2.8
func (t *SwitchBuilder) BuildBody(f func(int))
func (*SwitchBuilder) BuildCaseSize ¶ added in v1.3.1
func (sw *SwitchBuilder) BuildCaseSize(size 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) Finish ¶ added in v1.2.9
func (t *SwitchBuilder) Finish()
func (*SwitchBuilder) SetCase ¶ added in v1.3.1
func (sw *SwitchBuilder) SetCase(f func(int) []Value)
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 // only string PkgPathString() string // package path 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 GetAnyType ¶ added in v1.3.0
func GetAnyType() Type
func GetBooleanType ¶ added in v1.3.0
func GetBooleanType() Type
func GetBytesType ¶ added in v1.3.0
func GetBytesType() Type
func GetErrorType ¶ added in v1.3.0
func GetErrorType() Type
func GetNullType ¶ added in v1.3.0
func GetNullType() Type
func GetNumberType ¶ added in v1.3.0
func GetNumberType() Type
func GetStringType ¶ added in v1.3.0
func GetStringType() Type
func GetTypeByStr ¶
func GetUndefinedType ¶ added in v1.3.0
func GetUndefinedType() Type
func ParseClassBluePrint ¶ added in v1.3.2
func ParseClassBluePrint(this Value, objectTyp *ObjectType) (ret Type)
ParseClassBluePrint parse get classBluePrint if the ObjectType is a ClassFactor
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) DeleteMember ¶ added in v1.3.1
func (n *TypeCast) DeleteMember(k Value)
func (*TypeCast) GetAllMember ¶ added in v1.3.1
func (*TypeCast) GetIndexMember ¶ added in v1.3.1
func (*TypeCast) GetStringMember ¶ added in v1.3.1
func (*TypeCast) HasUsers ¶ added in v1.2.8
func (n *TypeCast) HasUsers() bool
has/get user and value
func (*TypeCast) IsMemberCallVariable ¶ added in v1.3.1
func (n *TypeCast) IsMemberCallVariable() bool
func (*TypeCast) RemoveUser ¶ added in v1.2.8
func (n *TypeCast) RemoveUser(u User)
func (*TypeCast) ReplaceValue ¶ added in v1.2.8
type TypeKind ¶
type TypeKind int
basic type
const ( NumberTypeKind TypeKind = iota StringTypeKind BytesTypeKind BooleanTypeKind UndefinedTypeKind // undefined is nil in golang NullTypeKind // AnyTypeKind // any type ChanTypeKind ErrorTypeKind ObjectTypeKind SliceTypeKind // slice MapTypeKind // map StructTypeKind // struct TupleTypeKind // slice has fixed length InterfaceTypeKind FunctionTypeKind ClassBluePrintTypeKind )
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) DeleteMember ¶ added in v1.3.1
func (n *TypeValue) DeleteMember(k Value)
func (*TypeValue) GetAllMember ¶ added in v1.3.1
func (*TypeValue) GetIndexMember ¶ added in v1.3.1
func (*TypeValue) GetStringMember ¶ added in v1.3.1
func (*TypeValue) HasUsers ¶ added in v1.2.8
func (n *TypeValue) HasUsers() bool
has/get user and value
func (*TypeValue) IsMemberCallVariable ¶ added in v1.3.1
func (n *TypeValue) IsMemberCallVariable() bool
func (*TypeValue) RemoveUser ¶ added in v1.2.8
func (n *TypeValue) RemoveUser(u User)
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) DeleteMember ¶ added in v1.3.1
func (n *UnOp) DeleteMember(k Value)
func (*UnOp) GetAllMember ¶ added in v1.3.1
func (*UnOp) GetIndexMember ¶ added in v1.3.1
func (*UnOp) GetStringMember ¶ added in v1.3.1
func (*UnOp) IsMemberCallVariable ¶ added in v1.3.1
func (n *UnOp) IsMemberCallVariable() bool
func (*UnOp) RemoveUser ¶ added in v1.2.8
func (n *UnOp) RemoveUser(u User)
func (*UnOp) ReplaceValue ¶ added in v1.2.8
type UnaryOpcode ¶
type UnaryOpcode int
const ( OpNone UnaryOpcode = iota OpNot // ! OpPlus // + OpNeg // - OpChan // <- OpBitwiseNot // ^ )
type Undefined ¶ added in v1.2.8
type Undefined struct { Kind UndefinedKind // contains filtered or unexported fields }
func NewUndefined ¶ added in v1.2.8
func ToUndefined ¶ added in v1.2.8
func ToUndefined(v Instruction) (*Undefined, bool)
func (*Undefined) DeleteMember ¶ added in v1.3.1
func (n *Undefined) DeleteMember(k Value)
func (*Undefined) GetAllMember ¶ added in v1.3.1
func (*Undefined) GetIndexMember ¶ added in v1.3.1
func (*Undefined) GetStringMember ¶ added in v1.3.1
func (*Undefined) HasUsers ¶ added in v1.2.8
func (n *Undefined) HasUsers() bool
has/get user and value
func (*Undefined) IsMemberCallVariable ¶ added in v1.3.1
func (n *Undefined) IsMemberCallVariable() bool
func (*Undefined) IsUndefined ¶ added in v1.3.1
func (*Undefined) RemoveUser ¶ added in v1.2.8
func (n *Undefined) RemoveUser(u User)
type UndefinedKind ¶ added in v1.3.1
type UndefinedKind int
mark undefined value type
const ( // normal undefined value UndefinedValue UndefinedKind = iota // member call but not this key UndefinedMemberInValid // member call, has this key, but not this value, this shouldn't mark error UndefinedMemberValid )
type Value ¶
type Value interface { Node Instruction MemberCall Typed Maskable AddUser(User) RemoveUser(User) }
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
type Variable ¶ added in v1.3.0
type Variable struct { *ssautil.Versioned[Value] DefRange *Range UseRange map[*Range]struct{} // contains filtered or unexported fields }
func ReadVariableFromScope ¶ added in v1.3.1
func (*Variable) GetMemberCall ¶ added in v1.3.1
func (*Variable) IsMemberCall ¶ added in v1.3.1
func (*Variable) SetDefRange ¶ added in v1.3.1
func (*Variable) SetMemberCall ¶ added in v1.3.1
Source Files ¶
- InstructionCover.go
- InstructionEmit.go
- InstructionHandler.go
- InstructionOpcode.go
- block.go
- builder.go
- call.go
- cfg.go
- class.go
- closure.go
- const.go
- const_calc.go
- disasm.go
- disasmLine.go
- error.go
- error_message.go
- extern_instance.go
- func.go
- id.go
- instruction.go
- label.go
- next.go
- object.go
- phi.go
- position.go
- program.go
- return.go
- scope.go
- ssa.go
- ssa_inspect.go
- ssa_predefined.go
- ssa_vars.go
- type.go
- use.go
- value.go
- variable.go