Ticket #894: 0001-Include-debug-info-on-core-direct_call-nodes.patch

File 0001-Include-debug-info-on-core-direct_call-nodes.patch, 1.2 KB (added by evhan, 10 years ago)
  • optimizer.scm

    From 73dacfc57ec42d252f46024b6d868713f47f1e6d Mon Sep 17 00:00:00 2001
    From: Evan Hanson <evhan@foldling.org>
    Date: Sat, 27 Sep 2014 13:37:53 +1200
    Subject: [PATCH] Include debug info on ##core#direct_call nodes
    
    ---
     optimizer.scm |    9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/optimizer.scm b/optimizer.scm
    index fb41191..a687f51 100644
    a b  
    15151515           ;; Transform call-sites:
    15161516           (for-each
    15171517            (lambda (site)
    1518               (let* ([n (cdr site)]
    1519                      [nsubs (node-subexpressions n)] )
     1518              (let* ((n (cdr site))
     1519                     (nsubs (node-subexpressions n))
     1520                     (params (node-parameters n))
     1521                     (debug-info (and (pair? (cdr params))
     1522                                      (second params))))
    15201523                (unless (= argc (length (cdr nsubs)))
    15211524                  (quit
    15221525                   "known procedure called with wrong number of arguments: `~A'"
     
    15261529                 (list (second nsubs)
    15271530                       (make-node
    15281531                        '##core#direct_call
    1529                         (list #t #f id allocated)
     1532                        (list #t debug-info id allocated)
    15301533                        (cons (car nsubs) (cddr nsubs)) ) ) ) ) )
    15311534            (lset-difference (lambda (s1 s2) (eq? (cdr s1) (cdr s2))) sites ksites) )
    15321535