develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34043 - trunk/compilers/pirc/new

From:
kjs
Date:
December 17, 2008 12:17
Subject:
[svn:parrot] r34043 - trunk/compilers/pirc/new
Message ID:
20081217201703.3ADE6CBA12@x12.develooper.com
Author: kjs
Date: Wed Dec 17 12:17:02 2008
New Revision: 34043

Modified:
   trunk/compilers/pirc/new/pir.y
   trunk/compilers/pirc/new/piremit.c

Log:
[pirc] Remove duplicate code.
+ remove a XXX and whiteline in .y file.

Modified: trunk/compilers/pirc/new/pir.y
==============================================================================
--- trunk/compilers/pirc/new/pir.y	(original)
+++ trunk/compilers/pirc/new/pir.y	Wed Dec 17 12:17:02 2008
@@ -740,7 +740,7 @@
                   ;
 
 parameter_list    : parameters
-                         { /* XXX */
+                         {
                            /* if there are parameters, then emit a get_params instruction. */
                            if ($1 > 0) {
 
@@ -753,7 +753,6 @@
                                update_op(lexer, CURRENT_INSTRUCTION(lexer),
                                          PARROT_OP_get_params_pc);
                            }
-
                          }
                   ;
 

Modified: trunk/compilers/pirc/new/piremit.c
==============================================================================
--- trunk/compilers/pirc/new/piremit.c	(original)
+++ trunk/compilers/pirc/new/piremit.c	Wed Dec 17 12:17:02 2008
@@ -92,15 +92,7 @@
 */
 void
 print_target(lexer_state *lexer, target * const t) {
-
-    if (TEST_FLAG(t->flags, TARGET_FLAG_IS_REG)) {
-        if (t->info == NULL)
-            fprintf(stderr, "reg target has no pir_reg ptr!\n");
-
-        fprintf(out, "%c%d", pir_register_types[t->info->type], t->info->color);
-    }
-    else
-        fprintf(out, "%c%d", pir_register_types[t->info->type], t->info->color);
+    fprintf(out, "%c%d", pir_register_types[t->info->type], t->info->color);
 
     /* if the target has a key, print that too */
     if (t->key)
@@ -431,10 +423,7 @@
 */
 static void
 emit_pbc_target_arg(lexer_state * const lexer, target * const t) {
-    if (TEST_FLAG(t->flags, TARGET_FLAG_IS_REG))
-        emit_int_arg(lexer->bc, t->info->color);
-    else
-        emit_int_arg(lexer->bc, t->info->color);
+    emit_int_arg(lexer->bc, t->info->color);
 }
 
 /*



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About