)
// Index into the abbrevs table below.
-// Keep in sync with ispubname() and ispubtype() in ld/dwarf.go.
-// ispubtype considers >= NULLTYPE public
const (
DW_ABRV_NULL = iota
DW_ABRV_COMPUNIT
// its corresponding 'abstract' DIE (containing location-independent
// attributes such as name, type, etc). Inlined subroutine DIEs can
// have other inlined subroutine DIEs as children.
-func PutInlinedFunc(ctxt Context, s *FnState, callersym Sym, callIdx int) error {
+func putInlinedFunc(ctxt Context, s *FnState, callersym Sym, callIdx int) error {
ic := s.InlCalls.Calls[callIdx]
callee := ic.AbsFunSym
Uleb128put(ctxt, s.Info, int64(abbrev))
if logDwarf {
- ctxt.Logf("PutInlinedFunc(caller=%v,callee=%v,abbrev=%d)\n", callersym, callee, abbrev)
+ ctxt.Logf("putInlinedFunc(caller=%v,callee=%v,abbrev=%d)\n", callersym, callee, abbrev)
}
// Abstract origin.
// Children of this inline.
for _, sib := range inlChildren(callIdx, &s.InlCalls) {
absfn := s.InlCalls.Calls[sib].AbsFunSym
- err := PutInlinedFunc(ctxt, s, absfn, sib)
+ err := putInlinedFunc(ctxt, s, absfn, sib)
if err != nil {
return err
}
// Inlined subroutines.
for _, sib := range inlChildren(-1, &s.InlCalls) {
absfn := s.InlCalls.Calls[sib].AbsFunSym
- err := PutInlinedFunc(ctxt, s, absfn, sib)
+ err := putInlinedFunc(ctxt, s, absfn, sib)
if err != nil {
return err
}
// Inlined subroutines.
for _, sib := range inlChildren(-1, &s.InlCalls) {
absfn := s.InlCalls.Calls[sib].AbsFunSym
- err := PutInlinedFunc(ctxt, s, absfn, sib)
+ err := putInlinedFunc(ctxt, s, absfn, sib)
if err != nil {
return err
}
// Var has no children => no terminator
}
-// VarsByOffset attaches the methods of sort.Interface to []*Var,
-// sorting in increasing StackOffset.
-type VarsByOffset []*Var
-
-func (s VarsByOffset) Len() int { return len(s) }
-func (s VarsByOffset) Less(i, j int) bool { return s[i].StackOffset < s[j].StackOffset }
-func (s VarsByOffset) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-
// byChildIndex implements sort.Interface for []*dwarf.Var by child index.
type byChildIndex []*Var