Example #1
0
func getLocalDecls(ctx Ctx, fnDecl *ast.FuncDecl, fn *types.Func) []*ssaLocal {
	scope := fn.Scope()
	names := scope.Names()
	var locals []*ssaLocal
	for i := 0; i < len(names); i++ {
		name := names[i]
		obj := scope.Lookup(name)
		if isParam(ctx, fn, obj) {
			continue
		}
		node := ssaLocal{obj: obj, ctx: ctx}
		locals = append(locals, &node)
	}
	return locals
}