OSDN Git Service

* utils.scm (concat): New function.
authorjimb <jimb>
Thu, 20 Jan 2005 22:57:10 +0000 (22:57 +0000)
committerjimb <jimb>
Thu, 20 Jan 2005 22:57:10 +0000 (22:57 +0000)
* insn.scm (-sub-insn-make!): Use concat instead of string-map.
* rtl.scm (rtx-dump): Same.
* semantics.scm (semantic-compile): Same.

cgen/ChangeLog
cgen/insn.scm
cgen/rtl.scm
cgen/semantics.scm
cgen/utils.scm

index 93e6bfb..cefc380 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-20  Jim Blandy  <jimb@redhat.com>
+
+       * utils.scm (concat): New function.
+       * insn.scm (-sub-insn-make!): Use concat instead of string-map.
+       * rtl.scm (rtx-dump): Same.
+       * semantics.scm (semantic-compile): Same.
+
 2004-12-16  Jim Blandy  <jimb@redhat.com>
 
        * utils-cgen.scm (parse-name): Don't assume that string-map can be
index 4241f77..1cdf919 100644 (file)
         (obj:name insn)
         ":"
         (string-map (lambda (op newval)
-                      (string-append " "
-                                     (obj:name op)
-                                     "="
-                                     (obj:name newval)))
+                      (concat " "
+                              (obj:name op)
+                              "="
+                              (obj:name newval)))
                     anyof-operands new-values)
         " ...\n")
 
index 9b7d4d1..77e9591 100644 (file)
 
 (define (rtx-dump rtx)
   (cond ((list? rtx) (map rtx-dump rtx))
-       ((object? rtx) (string-append "#<object "
-                                     (object-class-name rtx)
-                                     " "
-                                     (obj:name rtx)
-                                     ">"))
+       ((object? rtx) (concat "#<object "
+                              (object-class-name rtx)
+                              " "
+                              (obj:name rtx)
+                              ">"))
        (else rtx))
 )
 
index 4cca5fb..784b4ea 100644 (file)
                  sorted-outs out-op-nums)
 
        (let ((dump (lambda (op)
-                     (string-append "  "
-                                    (obj:name op)
-                                    " "
-                                    (number->string (op:num op))
-                                    "\n"))))
+                     (concat "  "
+                             (obj:name op)
+                             " "
+                             (number->string (op:num op))
+                             "\n"))))
          (logit 4
                 "Input operands:\n"
                 (map dump sorted-ins)
index 43988e6..25a0f7d 100644 (file)
     (write (spaces n) port))
 )
 
+; Concatenate all the arguments and make a string.  Symbols are
+; converted to strings.
+(define (concat . sequences)
+  (define (sequence->string o) (if (symbol? o) (symbol->string o) o))
+  (apply string-append (map sequence->string sequences)))
+
 ; Often used idiom.
 
 (define (string-map fn . args) (apply string-append (apply map (cons fn args))))