mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/internal/obj, cmd/link: add InlTree in new object files
Add InlTree to the FuncInfo aux symbol in new object files. In the linker, change InlinedCall.Func from a Symbol to a string, as we only use its Name. (There was a use of Func.File, but that use is not correct anyway.) So we don't need to create a Symbol if not necessary. Change-Id: I38ce568ae0934cd9cb6d0b30599f1c8d75444fc9 Reviewed-on: https://go-review.googlesource.com/c/go/+/200098 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
dab05a0484
commit
6ba3ae9ca5
8 changed files with 91 additions and 9 deletions
|
|
@ -395,6 +395,18 @@ func genFuncInfoSyms(ctxt *Link) {
|
|||
fsym := ctxt.Lookup(f)
|
||||
o.File[i] = makeSymRef(fsym)
|
||||
}
|
||||
o.InlTree = make([]goobj2.InlTreeNode, len(pc.InlTree.nodes))
|
||||
for i, inl := range pc.InlTree.nodes {
|
||||
f, l := linkgetlineFromPos(ctxt, inl.Pos)
|
||||
fsym := ctxt.Lookup(f)
|
||||
o.InlTree[i] = goobj2.InlTreeNode{
|
||||
Parent: int32(inl.Parent),
|
||||
File: makeSymRef(fsym),
|
||||
Line: l,
|
||||
Func: makeSymRef(inl.Func),
|
||||
ParentPC: inl.ParentPC,
|
||||
}
|
||||
}
|
||||
|
||||
o.Write(&b)
|
||||
isym := &LSym{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue