1
2
3
4
5 package obj
6
7 import (
8 "cmd/internal/goobj"
9 "cmd/internal/src"
10 )
11
12
13 func (ctxt *Link) AddImport(pkg string, fingerprint goobj.FingerprintType) {
14 ctxt.Imports = append(ctxt.Imports, goobj.ImportedPkg{Pkg: pkg, Fingerprint: fingerprint})
15 }
16
17
18
19
20
21 func (ctxt *Link) getFileIndexAndLine(xpos src.XPos) (int, int32) {
22 pos := ctxt.InnermostPos(xpos)
23 if !pos.IsKnown() {
24 pos = src.Pos{}
25 }
26 return pos.FileIndex(), int32(pos.RelLine())
27 }
28
View as plain text