Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for updateDead (0.08 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/shift/dead.go

    package shift
    
    // Simplified dead code detector.
    // Used for skipping shift checks on unreachable arch-specific code.
    
    import (
    	"go/ast"
    	"go/constant"
    	"go/types"
    )
    
    // updateDead puts unreachable "if" and "case" nodes into dead.
    func updateDead(info *types.Info, dead map[ast.Node]bool, node ast.Node) {
    	if dead[node] {
    		// The node is already marked as dead.
    		return
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 06 18:23:38 UTC 2018
    - 2.2K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/shift/shift.go

    	dead := make(map[ast.Node]bool)
    	nodeFilter := []ast.Node{
    		(*ast.IfStmt)(nil),
    		(*ast.SwitchStmt)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		// TODO(adonovan): move updateDead into this file.
    		updateDead(pass.TypesInfo, dead, n)
    	})
    
    	nodeFilter = []ast.Node{
    		(*ast.AssignStmt)(nil),
    		(*ast.BinaryExpr)(nil),
    	}
    	inspect.Preorder(nodeFilter, func(node ast.Node) {
    		if dead[node] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 3.5K bytes
    - Viewed (0)
Back to top