mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
compiler: emit all used files in DebugInfo.Documents
This commit is contained in:
parent
057e1c6e3c
commit
40fa7c0f6e
5 changed files with 25 additions and 10 deletions
|
@ -77,6 +77,11 @@ type codegen struct {
|
|||
// packages contains packages in the order they were loaded.
|
||||
packages []string
|
||||
|
||||
// documents contains paths to all files used by the program.
|
||||
documents []string
|
||||
// docIndex maps file path to an index in documents array.
|
||||
docIndex map[string]int
|
||||
|
||||
// Label table for recording jump destinations.
|
||||
l []int
|
||||
}
|
||||
|
@ -1541,6 +1546,7 @@ func (c *codegen) newLambda(u uint16, lit *ast.FuncLit) {
|
|||
func (c *codegen) compile(info *buildInfo, pkg *loader.PackageInfo) error {
|
||||
c.mainPkg = pkg
|
||||
c.analyzePkgOrder()
|
||||
c.fillDocumentInfo()
|
||||
funUsage := c.analyzeFuncUsage()
|
||||
|
||||
// Bring all imported functions into scope.
|
||||
|
@ -1588,6 +1594,7 @@ func newCodegen(info *buildInfo, pkg *loader.PackageInfo) *codegen {
|
|||
labels: map[labelWithType]uint16{},
|
||||
typeInfo: &pkg.Info,
|
||||
constMap: map[string]types.TypeAndValue{},
|
||||
docIndex: map[string]int{},
|
||||
|
||||
sequencePoints: make(map[string][]DebugSeqPoint),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue