[前][次][番号順一覧][スレッド一覧]

ruby-changes:46739

From: nobu <ko1@a...>
Date: Tue, 23 May 2017 21:12:08 +0900 (JST)
Subject: [ruby-changes:46739] nobu:r58854 (trunk): LABEL_FORMAT

nobu	2017-05-23 21:11:57 +0900 (Tue, 23 May 2017)

  New Revision: 58854

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58854

  Log:
    LABEL_FORMAT
    
    * compile.c (LABEL_FORMAT): extract format string for labels.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 58853)
+++ compile.c	(revision 58854)
@@ -173,6 +173,7 @@ struct iseq_compile_data_ensure_node_sta https://github.com/ruby/ruby/blob/trunk/compile.c#L173
 
 /* create new label */
 #define NEW_LABEL(l) new_label_body(iseq, (l))
+#define LABEL_FORMAT "<L%03d>"
 
 #define iseq_path(iseq) ((iseq)->body->location.path)
 #define iseq_absolute_path(iseq) ((iseq)->body->location.absolute_path)
@@ -6444,7 +6445,7 @@ insn_data_to_s_detail(INSN *iobj) https://github.com/ruby/ruby/blob/trunk/compile.c#L6445
 	      case TS_OFFSET:	/* label(destination position) */
 		{
 		    LABEL *lobj = (LABEL *)OPERAND_AT(iobj, j);
-		    rb_str_catf(str, "<L%03d>", lobj->label_no);
+		    rb_str_catf(str, LABEL_FORMAT, lobj->label_no);
 		    break;
 		}
 		break;
@@ -6550,7 +6551,7 @@ dump_disasm_list_with_cursor(const LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L6551
 	  case ISEQ_ELEMENT_LABEL:
 	    {
 		lobj = (LABEL *)link;
-		printf("<L%03d>\n", lobj->label_no);
+		printf(LABEL_FORMAT"\n", lobj->label_no);
 		break;
 	    }
 	  case ISEQ_ELEMENT_NONE:

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]