// with many calls that share the same auto-generated pos.
type CallSiteTab map[*ir.CallExpr]*CallSite
-// Package-level table of callsites.
-var cstab = CallSiteTab{}
-
type CSPropBits uint32
const (
return sb.String()
}
-func encodeCallSiteKey(cs *CallSite) string {
+func EncodeCallSiteKey(cs *CallSite) string {
var sb strings.Builder
// FIXME: maybe rewrite line offsets relative to function start?
sb.WriteString(fmtFullPos(cs.Call.Pos()))
func buildEncodedCallSiteTab(tab CallSiteTab) encodedCallSiteTab {
r := make(encodedCallSiteTab)
for _, cs := range tab {
- k := encodeCallSiteKey(cs)
+ k := EncodeCallSiteKey(cs)
r[k] = propsAndScore{
props: cs.Flags,
score: cs.Score,