package gc
+import "cmd/internal/src"
+
// a function named init is a special case.
// it is called by the initialization before
// main is run. to make it unique within a
}
func fninit(n []*Node) {
- // This code is using the last value of lineno for position information
- // (see comment in noder.go, noder.file method, for details).
-
+ lineno = makePos(src.NewFileBase("<autogenerated>", "<autogenerated>"), 1, 0)
nf := initfix(n)
if !anyinit(nf) {
return
}
pragcgobuf += p.pragcgobuf
-
- // For compatibility with old code only (comparisons w/ toolstash):
- // The old line number tracking simply continued incrementing the
- // virtual line number (lexlineno) and using it also for lineno.
- // After processing the last function, the lineno was used for the
- // line number information of the initialization code (fninit).
- // It would be better to use an explicit "<autogenerated>" filename
- // for fninit and set lineno to NoPos here.
- // TODO(gri) fix this once we switched permanently to the new
- // position information.
- lineno = makePos(p.file.Pos().Base(), uint(p.file.Lines), 0)
-
+ lineno = src.NoXPos
clearImports()
}