Show
Ignore:
Timestamp:
04/07/07 15:49:28 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/emacs-lisp/byte-opt.el

    r4190 r4200  
    535535                    ;; Detect the expansion of (pop foo). 
    536536                    ;; There is no need to compile the call to `car' there. 
     537                    (progn (setq foo (list form fn)) nil) 
    537538                    (and (eq fn 'car) 
    538539                         (eq (car-safe (cadr form)) 'prog1) 
     
    546547                                (eq (cadr (nth 2 last)) var)))) 
    547548                    (progn 
    548                       (byte-compile-warn "value returned by `%s' is not used" 
    549                                          (prin1-to-string (car form))) 
     549                      (byte-compile-warn "value returned from %s is unused" 
     550                                         (prin1-to-string form)) 
    550551                      nil))) 
    551552           (byte-compile-log "  %s called for effect; deleted" fn) 
     
    11171118        (byte-optimize-predicate form)) 
    11181119    form)) 
    1119  
    1120 (put 'concat 'byte-optimizer 'byte-optimize-pure-func) 
    1121 (put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func) 
    1122 (put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func) 
    1123 (put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func) 
    1124 (put 'string-to-syntax 'byte-optimizer 'byte-optimize-pure-func) 
    1125 (defun byte-optimize-pure-func (form) 
    1126   "Do constant folding for pure functions. 
    1127 This assumes that the function will not have any side-effects and that 
    1128 its return value depends solely on its arguments. 
    1129 If the function can signal an error, this might change the semantics 
    1130 of FORM by signaling the error at compile-time." 
    1131   (let ((args (cdr form)) 
    1132         (constant t)) 
    1133     (while (and args constant) 
    1134       (or (byte-compile-constp (car args)) 
    1135           (setq constant nil)) 
    1136       (setq args (cdr args))) 
    1137     (if constant 
    1138         (list 'quote (eval form)) 
    1139       form))) 
    11401120 
    11411121;; Avoid having to write forward-... with a negative arg for speed.