public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: cgen@sources.redhat.com
Subject: PATCH: Handle symbols in messages
Date: Thu, 20 Jan 2005 22:59:00 -0000	[thread overview]
Message-ID: <vt2fz0vvhjm.fsf@zenia.home> (raw)


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  <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.

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 "#<object "
! 				      (object-class-name rtx)
! 				      " "
! 				      (obj:name rtx)
! 				      ">"))
  	(else rtx))
  )
  
--- 786,796 ----
  
  (define (rtx-dump rtx)
    (cond ((list? rtx) (map rtx-dump rtx))
! 	((object? rtx) (concat "#<object "
! 			       (object-class-name rtx)
! 			       " "
! 			       (obj:name rtx)
! 			       ">"))
  	(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))))

             reply	other threads:[~2005-01-20 22:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20 22:59 Jim Blandy [this message]
2005-01-21  0:26 ` Doug Evans
2005-01-22  2:44   ` Jim Blandy
2005-01-27 20:38     ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vt2fz0vvhjm.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=cgen@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).