Home | History | Annotate | Download | only in cfg

Lines Matching defs:cfg

5 // This package constructs a simple control-flow graph (CFG) of the
8 // Use cfg.New to construct the CFG for a function body.
10 // The blocks of the CFG contain all the function's non-control
11 // statements. The CFG does not contain control statements such as If,
21 // produces this CFG:
32 // The CFG does contain Return statements; even implicit returns are
35 // The CFG does not record conditions associated with conditional branch
40 package cfg
55 // A CFG represents the control-flow graph of a single function.
58 type CFG struct {
73 index int32 // index within CFG.Blocks
81 // The CFG builder calls mayReturn to determine whether a given function
86 func New(body *ast.BlockStmt, mayReturn func(*ast.CallExpr) bool) *CFG {
89 cfg: new(CFG),
102 return b.cfg
118 func (g *CFG) Format(fset *token.FileSet) string {