|
280 | 280 | (loop for a in annotations
|
281 | 281 | do (start-annotation a inserter context)))
|
282 | 282 |
|
283 |
| -(defun annotation< (annot1 annot2) |
284 |
| - ;; We keep ANNOTS sorted by end IP. |
285 |
| - ;; If they tie on end IP, we use the reverse order of the starts. |
286 |
| - ;; Imagine we have an annotation 5-13 and another 11-13. |
287 |
| - ;; We want to start the 5-13, then start the 11-13, then end the 11-13. |
288 |
| - ;; That's why we reverse order of the starts. |
289 |
| - ;; If two annotations start and end at the same point there may be a |
290 |
| - ;; problem. I don't think this can actually arise. |
291 |
| - (let ((end1 (core:bytecode-debug-info/end annot1)) |
292 |
| - (end2 (core:bytecode-debug-info/end annot2))) |
293 |
| - (cond ((< end1 end2) t) |
294 |
| - ((= end1 end2) |
295 |
| - (> (core:bytecode-debug-info/start annot1) |
296 |
| - (core:bytecode-debug-info/start annot2))) |
297 |
| - (t nil)))) |
298 |
| - |
299 | 283 | (defun add-annotations (annots next-annots)
|
300 | 284 | ;; We keep ANNOTS sorted by end IP.
|
301 | 285 | ;; FIXME? This could be done without consing, but it would be uglier.
|
302 |
| - (let ((sna (sort (copy-list next-annots) #'annotation<))) |
303 |
| - (merge 'list annots sna #'annotation<))) |
| 286 | + (let ((sna (sort (copy-list next-annots) #'< |
| 287 | + :key #'core:bytecode-debug-info/end))) |
| 288 | + (merge 'list annots sna #'< :key #'core:bytecode-debug-info/end))) |
304 | 289 |
|
305 | 290 | (defun end-annotations (ip annots inserter context)
|
306 | 291 | ;; ANNOTS are kept sorted by bdi/end, so this is easy.
|
|
0 commit comments