tools/go/analysis/passes
Alan Donovan 3a5b620dc5 go/analysis/passes/ctrlflow: an Analyzer that builds CFGs
The ctrlflow Analyzer builds a control-flow graph (see
golang.org/x/tools/go/cfg) for each named and unnamed function in the
package.

It computes for each function whether it can never return, either
because the function is an intrinsic that stops the thread (e.g.
os.Exit), or because control never reaches a return statement, or
because the function inevitably calls another function that never
returns.  For each such function it exports a noReturn fact.

This change also:
- adds 'inspect', another Analyzer that builds an optimized AST
  traversal table for use by nearly every other Analyzer.
- changes analysistest.Run to return the analysis result to enable
  further testing.
  (This required changing it to analyze one package at a time,
  which is no less efficient, and is the typical case.)

Change-Id: I877e2b2363a365a9976aa9c2719ad3fba4df2634
Reviewed-on: https://go-review.googlesource.com/c/139478
Reviewed-by: Michael Matloob <matloob@golang.org>
2018-10-05 21:26:26 +00:00
..
ctrlflow go/analysis/passes/ctrlflow: an Analyzer that builds CFGs 2018-10-05 21:26:26 +00:00
findcall go/analysis/passes/ctrlflow: an Analyzer that builds CFGs 2018-10-05 21:26:26 +00:00
inspect go/analysis/passes/ctrlflow: an Analyzer that builds CFGs 2018-10-05 21:26:26 +00:00
pkgfact go/analysis/passes/ctrlflow: an Analyzer that builds CFGs 2018-10-05 21:26:26 +00:00
vet go/analysis/passes/vet: fork cmd/vet@31d19c0 2018-09-27 19:02:35 +00:00
README go/analysis/internal/checker: analysis driver based on go/packages 2018-09-26 01:25:07 +00:00

README

This directory does not contain a Go package,
but acts as a container for various analyses
that implement the golang.org/x/tools/go/analysis
API and may be imported into an analysis tool.

By convention, each package foo provides the analysis,
and each command foo/cmd/foo provides a standalone driver.