From d01d509257052e694365b76be5ab597fa06764ec Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Thu, 5 Sep 2013 21:49:58 +0400 Subject: [PATCH] Add defknowns for TWO-ARG-CHAR-* functions. This avoids the checks for multiple values. --- package-data-list.lisp-expr | 4 +++- src/compiler/fndb.lisp | 8 ++++++++ src/compiler/srctran.lisp | 10 +++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index c940681..9e850e3 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -1004,7 +1004,9 @@ possibly temporariliy, because it might be used internally." "SEQUENCE-BOUNDING-INDICES-BAD-ERROR" "SPECIAL-FORM-FUNCTION" "STYLE-WARN" "SIMPLE-COMPILER-NOTE" - + "TWO-ARG-CHAR-EQUAL" "TWO-ARG-CHAR-NOT-EQUAL" + "TWO-ARG-CHAR-LESSP" "TWO-ARG-CHAR-NOT-LESSP" + "TWO-ARG-CHAR-GREATERP" "TWO-ARG-CHAR-NOT-GREATERP" ;; FIXME: potential SB!EXT exports "CHARACTER-CODING-ERROR" "CHARACTER-DECODING-ERROR" "CHARACTER-DECODING-ERROR-OCTETS" diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 433b153..3578f2f 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -418,6 +418,14 @@ char-lessp char-greaterp char-not-greaterp char-not-lessp) (character &rest character) boolean (movable foldable flushable)) +(defknown (two-arg-char-equal + two-arg-char-not-equal + two-arg-char-lessp + two-arg-char-not-lessp + two-arg-char-greaterp + two-arg-char-not-greaterp) + (character character) boolean (movable foldable flushable)) + (defknown character (t) character (movable foldable unsafely-flushable)) (defknown char-code (character) char-code (movable foldable flushable)) (defknown (char-upcase char-downcase) (character) character diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index 7384efa..b66f0f4 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -4054,15 +4054,15 @@ 'character)) (define-source-transform char-equal (&rest args) - (multi-compare 'sb!impl::two-arg-char-equal args nil 'character t)) + (multi-compare 'two-arg-char-equal args nil 'character t)) (define-source-transform char-lessp (&rest args) - (multi-compare 'sb!impl::two-arg-char-lessp args nil 'character t)) + (multi-compare 'two-arg-char-lessp args nil 'character t)) (define-source-transform char-greaterp (&rest args) - (multi-compare 'sb!impl::two-arg-char-greaterp args nil 'character t)) + (multi-compare 'two-arg-char-greaterp args nil 'character t)) (define-source-transform char-not-greaterp (&rest args) - (multi-compare 'sb!impl::two-arg-char-greaterp args t 'character t)) + (multi-compare 'two-arg-char-greaterp args t 'character t)) (define-source-transform char-not-lessp (&rest args) - (multi-compare 'sb!impl::two-arg-char-lessp args t 'character t)) + (multi-compare 'two-arg-char-lessp args t 'character t)) ;;; This function does source transformation of N-arg inequality ;;; functions such as /=. This is similar to MULTI-COMPARE in the <3 -- 1.7.10.4