Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Called ¶
Called returns true when f is called in the instr. If recv is not nil, Called also checks the receiver.
func CalledFrom ¶
func CalledFrom(b *ssa.BasicBlock, i int, receiver types.Type, methods ...*types.Func) (called, ok bool)
CalledFrom checks whether receiver's method is called in an instruction which belongs to after i-th instructions, or in successor blocks of b. The first result is above value. The second result is whether type of i-th instruction does not much receiver or matches with ignore cases.
Types ¶
type CalledChecker ¶
type CalledChecker struct {
Ignore func(instr ssa.Instruction) bool
}
CalledChecker checks a function is called. See From and Func.
func (*CalledChecker) From ¶
func (c *CalledChecker) From(b *ssa.BasicBlock, i int, receiver types.Type, methods ...*types.Func) (called, ok bool)
From checks whether receiver's method is called in an instruction which belongs to after i-th instructions, or in successor blocks of b. The first result is above value. The second result is whether type of i-th instruction does not much receiver or matches with ignore cases.
func (*CalledChecker) Func ¶
func (c *CalledChecker) Func(instr ssa.Instruction, recv ssa.Value, f *types.Func) bool
Func returns true when f is called in the instr. If recv is not nil, Called also checks the receiver.