1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

Better char<? compilation

* module/language/tree-il/primitives.scm
  (character-comparison-expander): Expand out char<? and friends to <,
  unboxing the char arguments.
* module/language/cps/types.scm:
* module/language/cps/effects-analysis.scm: Remove mention of char<? and
  friends as we won't see them any more.  Also fixes #24318.
This commit is contained in:
Andy Wingo 2016-09-02 10:02:54 +02:00
parent 2dbb0e212d
commit 3b2cd09fe2
3 changed files with 18 additions and 8 deletions

View file

@ -549,6 +549,24 @@
(chained-comparison-expander prim-name)))
'(< > <= >= =))
(define (character-comparison-expander char< <)
(lambda (src . args)
(expand-primcall
(make-primcall src <
(map (lambda (arg)
(make-primcall src 'char->integer (list arg)))
args)))))
(for-each (match-lambda
((char< . <)
(hashq-set! *primitive-expand-table* char<
(character-comparison-expander char< <))))
'((char<? . <)
(char>? . >)
(char<=? . <=)
(char>=? . >=)
(char=? . =)))
;; Appropriate for use with either 'eqv?' or 'equal?'.
(define (maybe-simplify-to-eq prim)
(case-lambda