address returns the synthetic address for loc, creating one if needed.
(loc *profile.Location)
| 23 | |
| 24 | // address returns the synthetic address for loc, creating one if needed. |
| 25 | func (s *synthCode) address(loc *profile.Location) uint64 { |
| 26 | if loc.Address != 0 { |
| 27 | panic("can only synthesize addresses for locations without an address") |
| 28 | } |
| 29 | if addr, ok := s.addr[loc]; ok { |
| 30 | return addr |
| 31 | } |
| 32 | if s.addr == nil { |
| 33 | s.addr = map[*profile.Location]uint64{} |
| 34 | } |
| 35 | addr := s.next |
| 36 | s.next++ |
| 37 | s.addr[loc] = addr |
| 38 | return addr |
| 39 | } |
no outgoing calls