From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23247 invoked by alias); 20 Jan 2005 22:59:30 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 23194 invoked from network); 20 Jan 2005 22:59:27 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 20 Jan 2005 22:59:27 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0KMxQTL025570 for ; Thu, 20 Jan 2005 17:59:26 -0500 Received: from zenia.home.redhat.com (sebastian-int.corp.redhat.com [172.16.52.221]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0KMxKO11195; Thu, 20 Jan 2005 17:59:21 -0500 To: cgen@sources.redhat.com Subject: PATCH: Handle symbols in messages From: Jim Blandy Date: Thu, 20 Jan 2005 22:59:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-q1/txt/msg00003.txt.bz2 I've committed the following. There are many more places where concat is needed, but cgen now runs with '-v -v -v -v'; we can fix others as we find them. 2005-01-20 Jim Blandy * 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. Index: cgen/insn.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/insn.scm,v retrieving revision 1.58 diff -c -p -r1.58 insn.scm *** cgen/insn.scm 20 Jul 2003 18:06:02 -0000 1.58 --- cgen/insn.scm 20 Jan 2005 22:52:04 -0000 *************** *** 271,280 **** (obj:name insn) ":" (string-map (lambda (op newval) ! (string-append " " ! (obj:name op) ! "=" ! (obj:name newval))) anyof-operands new-values) " ...\n") --- 271,280 ---- (obj:name insn) ":" (string-map (lambda (op newval) ! (concat " " ! (obj:name op) ! "=" ! (obj:name newval))) anyof-operands new-values) " ...\n") Index: cgen/rtl.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/rtl.scm,v retrieving revision 1.53 diff -c -p -r1.53 rtl.scm *** cgen/rtl.scm 20 Jul 2003 18:06:02 -0000 1.53 --- cgen/rtl.scm 20 Jan 2005 22:52:04 -0000 *************** *** 786,796 **** (define (rtx-dump rtx) (cond ((list? rtx) (map rtx-dump rtx)) ! ((object? rtx) (string-append "#")) (else rtx)) ) --- 786,796 ---- (define (rtx-dump rtx) (cond ((list? rtx) (map rtx-dump rtx)) ! ((object? rtx) (concat "#")) (else rtx)) ) Index: cgen/semantics.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/semantics.scm,v retrieving revision 1.19 diff -c -p -r1.19 semantics.scm *** cgen/semantics.scm 20 Jul 2003 18:06:02 -0000 1.19 --- cgen/semantics.scm 20 Jan 2005 22:52:04 -0000 *************** *** 798,808 **** sorted-outs out-op-nums) (let ((dump (lambda (op) ! (string-append " " ! (obj:name op) ! " " ! (number->string (op:num op)) ! "\n")))) (logit 4 "Input operands:\n" (map dump sorted-ins) --- 798,808 ---- sorted-outs out-op-nums) (let ((dump (lambda (op) ! (concat " " ! (obj:name op) ! " " ! (number->string (op:num op)) ! "\n")))) (logit 4 "Input operands:\n" (map dump sorted-ins) Index: cgen/utils.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/utils.scm,v retrieving revision 1.82 diff -c -p -r1.82 utils.scm *** cgen/utils.scm 16 Dec 2004 21:52:37 -0000 1.82 --- cgen/utils.scm 20 Jan 2005 22:52:04 -0000 *************** *** 85,90 **** --- 85,96 ---- (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))))