Author: tewk
Date: Fri Jan 26 17:24:07 2007
New Revision: 16811

Modified:
   trunk/   (props changed)
   trunk/lib/Parrot/Pmc2c.pm
   trunk/lib/Parrot/Pmc2c/Utils.pm

Log:
[imcc] Automatically add fixedintetgerarray.h to PMCs with PMETHODS


Modified: trunk/lib/Parrot/Pmc2c.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c.pm   (original)
+++ trunk/lib/Parrot/Pmc2c.pm   Fri Jan 26 17:24:07 2007
@@ -525,23 +525,20 @@
 sub includes {
     my $self = shift;
 
-    my $cout = "";
-    $cout .= <<"EOC";
+    my $cout .= <<"EOC";
 #include "parrot/parrot.h"
 #include "parrot/extend.h"
 #include "parrot/dynext.h"
 EOC
+
+    $cout .= qq{#include "pmc_fixedintegerarray.h"\n} if 
($self->{flags}->{pmethod_present});
     foreach my $parents ( $self->{class}, @{ $self->{parents} } ) {
         my $name = lc $parents;
-        $cout .= <<"EOC";
-#include "pmc_$name.h"
-EOC
+        $cout .= qq{#include "pmc_$name.h"\n};
     }
     if ( !$self->{flags}{dynpmc} ) {
         my $name = lc $self->{class};
-        $cout .= <<"EOC";
-#include "$name.str"
-EOC
+        $cout .= qq{#include "$name.str"\n};
     }
     "$cout\n";
 }

Modified: trunk/lib/Parrot/Pmc2c/Utils.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Utils.pm     (original)
+++ trunk/lib/Parrot/Pmc2c/Utils.pm     Fri Jan 26 17:24:07 2007
@@ -713,6 +713,7 @@
 
         if ($flag and $flag =~ /PMETHOD/) {
             rewrite_pmethod($method_hash);
+            $flags_ref->{pmethod_present} = 1;
         }
 
 
@@ -883,10 +884,10 @@
   }
 }
 
-=head3 C<rewrite_pmethod($class, $method, $body)>
+=head3 C<rewrite_pmethod_returns($class, $method, $body)>
 
-Rewrites the method body performing the various macro substitutions for
-pmethod bodies (see F<tools/build/pmc2c.pl>).
+Rewrites the method body returns performing the various macro substitutions for
+pmethod returns.
 
 =cut
 
@@ -1028,7 +1029,7 @@
 
 =head3 C<rewrite_pmethod()>
 
-    rewrite_pmethod($method_hash);
+    rewrite_pmethod($pmc2c_instance);
 
 =cut
 

Reply via email to