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:
parent
2dbb0e212d
commit
3b2cd09fe2
3 changed files with 18 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue