From 397dc995d4c09c4997626326be4da3b2dd30d837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Tue, 28 Nov 2023 09:11:41 +0100 Subject: [PATCH] cmp: cosmetic changes, elaborate in a comment --- src/cmp/cmpbackend-cxx/cmppass2-call.lsp | 3 +++ src/cmp/cmppass1-call.lsp | 14 ++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/cmp/cmpbackend-cxx/cmppass2-call.lsp b/src/cmp/cmpbackend-cxx/cmppass2-call.lsp index dc0238668..6eb5919b2 100644 --- a/src/cmp/cmpbackend-cxx/cmppass2-call.lsp +++ b/src/cmp/cmpbackend-cxx/cmppass2-call.lsp @@ -36,6 +36,9 @@ ;;; FUN the function to be called ;;; ARGS is the list of arguments ;;; FUN-VAL depends on the particular call type +;;; :LOCAL structure FUN [see cmprefs.lsp] +;;; :GLOBAL function name [symbol or (SETF symbol)] +;;; :UNKNOWN the value NIL ;;; CALL-TYPE is (member :LOCAL :GLOBAL :UKNOWN) ;;; (defun c2fcall (c1form fun args fun-val call-type) diff --git a/src/cmp/cmppass1-call.lsp b/src/cmp/cmppass1-call.lsp index 37ae6c8ba..6d02ed80f 100644 --- a/src/cmp/cmppass1-call.lsp +++ b/src/cmp/cmppass1-call.lsp @@ -238,14 +238,12 @@ :args (c1expr `(function ,fname)) (c1args* args) fun :local)) (defun c1call-global (fname args) - (let* ((forms (c1args* args))) - ;; If all arguments are constants, try to precompute the function - ;; value. We abort when the function signals an error or the value - ;; is not printable. - (let ((value (c1call-constant-fold fname forms))) - (when value - (return-from c1call-global value))) - ;; Otherwise emit a global function call + (let ((forms (c1args* args))) + ;; If all arguments are constants, try to precompute the function value. We + ;; abort when the function signals an error or the value is not printable. + (ext:when-let ((value (c1call-constant-fold fname forms))) + (return-from c1call-global value)) + ;; Otherwise emit a global function call. (make-c1form* 'FCALL :sp-change (function-may-change-sp fname) :side-effects (function-may-have-side-effects fname)