From 8787e482bacd50c41168eaf2d27bbb2d2bc1e827 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Mon, 17 May 2010 17:20:20 +0200 Subject: [PATCH] C2FMLA-AND reduced to the simplest form. --- src/cmp/cmpif.lsp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/cmp/cmpif.lsp b/src/cmp/cmpif.lsp index eb29d6a50..59c282a7c 100644 --- a/src/cmp/cmpif.lsp +++ b/src/cmp/cmpif.lsp @@ -225,21 +225,25 @@ *destination*)) (close-inline-blocks)))))) +(defun jump-true-destination? () + (let ((dest *destination*)) + (and (consp dest) (eq (car dest) 'JUMP-TRUE)))) + +(defun jump-false-destination? () + (let ((dest *destination*)) + (and (consp dest) (eq (car dest) 'JUMP-FALSE)))) + (defun c2fmla-and (butlast last) - (with-exit-label (normal-exit) - (let* ((dest *destination*)) - (cond ((and (consp dest) (eq (car dest) 'JUMP-TRUE)) - (CJT *current-c2form* (second dest) normal-exit)) - ((and (consp dest) (eq (car dest) 'JUMP-FALSE)) - (mapc #'c2expr* butlast) - (c2expr last)) - (t - (with-exit-label (false-label) - (let ((*destination* `(JUMP-FALSE ,false-label))) - (mapc #'c2expr* butlast)) - (c2expr last) - (wt-nl) (wt-go normal-exit)) - (unwind-exit nil)))))) + (if (jump-false-destination?) + (progn + (mapc #'c2expr* butlast) + (c2expr last)) + (with-exit-label (normal-exit) + (with-exit-label (false-label) + (let ((*destination* `(JUMP-FALSE ,false-label))) + (mapc #'c2expr* butlast)) + (c2expr last)) + (unwind-exit nil)))) (defun c2fmla-or (butlast last) (let* ((normal-exit (next-label))