go/analysis: add Pass.OtherFiles field
This field lists the names of non-Go files that are part of the package under analysis. Change-Id: Ic967dc18b98e018c691442f7378cb29db30a1454 Reviewed-on: https://go-review.googlesource.com/138136 Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
parent
d457fc8054
commit
b41e4b469b
|
@ -90,16 +90,19 @@ func (a *Analyzer) String() string { return a.Name }
|
||||||
// program, and has both input and an output components.
|
// program, and has both input and an output components.
|
||||||
//
|
//
|
||||||
// As in a compiler, one pass may depend on the result computed by another.
|
// As in a compiler, one pass may depend on the result computed by another.
|
||||||
|
//
|
||||||
|
// The Run function should not call any of the Pass functions concurrently.
|
||||||
type Pass struct {
|
type Pass struct {
|
||||||
// -- inputs --
|
// -- inputs --
|
||||||
|
|
||||||
Analyzer *Analyzer // the identity of the current analyzer
|
Analyzer *Analyzer // the identity of the current analyzer
|
||||||
|
|
||||||
// syntax and type information
|
// syntax and type information
|
||||||
Fset *token.FileSet // file position information
|
Fset *token.FileSet // file position information
|
||||||
Files []*ast.File // the abstract syntax tree of each file
|
Files []*ast.File // the abstract syntax tree of each file
|
||||||
Pkg *types.Package // type information about the package
|
OtherFiles []string // names of non-Go files of this package
|
||||||
TypesInfo *types.Info // type information about the syntax trees
|
Pkg *types.Package // type information about the package
|
||||||
|
TypesInfo *types.Info // type information about the syntax trees
|
||||||
|
|
||||||
// ResultOf provides the inputs to this analysis pass, which are
|
// ResultOf provides the inputs to this analysis pass, which are
|
||||||
// the corresponding results of its prerequisite analyzers.
|
// the corresponding results of its prerequisite analyzers.
|
||||||
|
|
|
@ -497,6 +497,7 @@ func (act *action) execOnce() {
|
||||||
Analyzer: act.a,
|
Analyzer: act.a,
|
||||||
Fset: act.pkg.Fset,
|
Fset: act.pkg.Fset,
|
||||||
Files: act.pkg.Syntax,
|
Files: act.pkg.Syntax,
|
||||||
|
OtherFiles: act.pkg.OtherFiles,
|
||||||
Pkg: act.pkg.Types,
|
Pkg: act.pkg.Types,
|
||||||
TypesInfo: act.pkg.TypesInfo,
|
TypesInfo: act.pkg.TypesInfo,
|
||||||
ResultOf: inputs,
|
ResultOf: inputs,
|
||||||
|
|
Loading…
Reference in New Issue