Changeset 16505


Ignore:
Timestamp:
Aug 17, 2015, 12:03:30 AM (4 years ago)
Author:
gb
Message:

rewrite labels/flet bodies and self-calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/lscan/source/compiler/acode-rewrite.lisp

    r16264 r16505  
    454454
    455455(def-acode-rewrite acode-rewrite-lambda lambda-list asserted-type  (&whole whole req opt rest keys auxen body p2-decls &optional code-note)
    456   (declare (ignore code-note req rest))
     456  (declare (ignore code-note))
    457457  (with-acode-declarations p2-decls
     458    (unless (or opt rest keys)
     459      (setf (afunc-vars *nx-current-function*) req))
    458460    (dolist (optinit (cadr opt))
    459461      (rewrite-acode-form optinit))
     
    659661
    660662(def-acode-rewrite acode-rewrite-self-call self-call asserted-type (arglist &optional spread-p)
    661   (declare (ignore spread-p))
    662   (dolist (arg (car arglist))
    663     (rewrite-acode-form arg))
    664   (dolist (arg (cadr arglist))
    665     (rewrite-acode-form arg)))
     663  (let* ((vars (afunc-vars *nx-current-function*)))
     664    (if (or spread-p (not (eql (length vars) (+ (length (car arglist)) (length (cadr arglist))))))
     665      (setq vars nil))
     666   
     667    (dolist (arg (car arglist))
     668      (let* ((v (pop vars)))
     669        (if v
     670          (rewrite-acode-form arg (var-declared-type v))
     671          (rewrite-acode-forn arg))))
     672    (setq vars (reverse vars))
     673    (dolist (arg (cadr arglist))
     674      (let* ((v (pop vars)))
     675        (if v
     676          (rewrite-acode-form arg (var-declared-type v))
     677          (rewrite-acode-forn arg))
     678      ))))
    666679
    667680
     
    700713
    701714
     715
    702716(def-acode-rewrite acode-rewrite-labels-flet (labels flet)  asserted-type (vars funcs body p2decls)
    703   (declare (ignore vars funcs))
     717  (declare (ignore vars))
     718  (dolist (func funcs)
     719    (let* ((*nx-current-function* func))
     720      (rewrite-acode-form (afunc-acode func))))
    704721  (with-acode-declarations p2decls (rewrite-acode-form body asserted-type)))
    705722
Note: See TracChangeset for help on using the changeset viewer.