[svn:parrot] r44799 - branches/ops_pct/compilers/opsc/src/Ops/Trans

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Mar 9 09:58:38 UTC 2010


Author: bacek
Date: Tue Mar  9 09:58:36 2010
New Revision: 44799
URL: https://trac.parrot.org/parrot/changeset/44799

Log:
Generate code close to ops2c.pl

Modified:
   branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm

Modified: branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm
==============================================================================
--- branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm	Tue Mar  9 08:20:45 2010	(r44798)
+++ branches/ops_pct/compilers/opsc/src/Ops/Trans/C.pm	Tue Mar  9 09:58:36 2010	(r44799)
@@ -52,7 +52,7 @@
         my $func_name := $op.func_name( self );
         my $definition := "opcode_t *\n$func_name (opcode_t *cur_opcode, PARROT_INTERP)";
         my $prototype := $emitter.sym_export
-                ~ "opcode_t * $func_name (opcode_t *cur_opcode, PARROT_INTERP);\n";
+                ~ " opcode_t * $func_name (opcode_t *, PARROT_INTERP);\n";
 
         my $src := $op.source( self );
 
@@ -188,7 +188,7 @@
     my $index := 0;
 
     for $emitter.ops_file.ops -> $op {
-        my $type := sprintf( "PARROT_%s_OP", uc(~$op.type) );
+        my $type := sprintf( "PARROT_%s_OP", uc($op.type ?? 'INLINE' !! 'FUNCTION') );
         my $name := $op.name;
         %names{$name} := 1;
         my $full_name := $op.full_name;
@@ -214,7 +214,7 @@
             ) ~ ' }'
             !! '{ 0 }';
 
-        $fh.print('{ ' ~ qq|/* $index */
+        $fh.print('  { ' ~ qq|/* $index */
     /* type $type, */
     "$name",
     "$full_name",


More information about the parrot-commits mailing list