# New Ticket Created by "Paul Cochrane"
# Please include the string: [perl #40479]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40479 >
Hi,
This patch adds the C-code coda to the autogenerated C language code,
and fixes a couple of pre-existing codas for autogenerated code. This
gets more of the coda tests to pass, especially after making parrot.
HTH!
Regards,
Paul
files affected:
tools/build/jit2c.pl
tools/build/ops2pm.pl
tools/build/nativecall.pl
tools/build/vtable_h.pl
tools/build/vtable_extend.pl
tools/build/ops2c.pl
tools/build/fingerprint_c.pl
tools/build/c2str.pl
tools/build/parrot_config_c.pl
tools/build/revision_c.pl
lib/Parrot/Pmc2c/Library.pm
config/gen/core_pmcs.pm
config/gen/config_h.pm
config/gen/platform.pm
config/gen/config_h/config_h.in
config/gen/config_h/feature_h.in
Index: tools/build/jit2c.pl
===================================================================
--- tools/build/jit2c.pl (revision 14845)
+++ tools/build/jit2c.pl (working copy)
@@ -456,6 +456,17 @@
EOC
}
+# append the C code coda
+print JITCPU <<"EOC";
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOC
+
print("jit2c: JITed $njit (+ $vjit vtable) of $core_numops ops\n");
sub make_subs {
Index: tools/build/ops2pm.pl
===================================================================
--- tools/build/ops2pm.pl (revision 14845)
+++ tools/build/ops2pm.pl (working copy)
@@ -298,6 +298,16 @@
#endif
END_C
+
+# append the C code coda
+print OUT <<END_C;
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+END_C
close OUT;
Index: tools/build/nativecall.pl
===================================================================
--- tools/build/nativecall.pl (revision 14845)
+++ tools/build/nativecall.pl (working copy)
@@ -243,6 +243,17 @@
print_tail( [EMAIL PROTECTED] );
+# append the C code coda
+print NCI << "EOC";
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOC
+
close NCI;
Index: tools/build/vtable_h.pl
===================================================================
--- tools/build/vtable_h.pl (revision 14845)
+++ tools/build/vtable_h.pl (working copy)
@@ -63,7 +63,17 @@
print OUT "\n#endif\n";
+# append the C code coda
+print OUT <<"EOC";
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOC
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Index: tools/build/vtable_extend.pl
===================================================================
--- tools/build/vtable_extend.pl (revision 14845)
+++ tools/build/vtable_extend.pl (working copy)
@@ -41,6 +41,17 @@
#endif
EOF
+# append the C code coda
+print OUT <<'EOF';
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOF
+
close OUT or die $!;
open OUT, '>', 'src/extend_vtable.c' or die $!;
@@ -132,11 +143,8 @@
/*
* Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
+ * c-file-style: "parrot"
* End:
- *
* vim: expandtab shiftwidth=4:
*/
EOF
Index: tools/build/ops2c.pl
===================================================================
--- tools/build/ops2c.pl (revision 14845)
+++ tools/build/ops2c.pl (working copy)
@@ -281,6 +281,17 @@
}
my $bs = "${base}${suffix}_";
+# append the C code coda
+print HEADER <<END_C;
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+END_C
+
print SOURCE $preamble;
print SOURCE <<END_C;
#include "$include"
@@ -724,6 +735,17 @@
}
+# append the C code coda
+print SOURCE <<END_C;
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+END_C
+
close SOURCE;
my $final = $source;
$final =~ s/\.temp//;
Index: tools/build/fingerprint_c.pl
===================================================================
--- tools/build/fingerprint_c.pl (revision 14845)
+++ tools/build/fingerprint_c.pl (working copy)
@@ -96,6 +96,17 @@
} # endif DEVELOPING
+# append the C code coda
+print << "EOF";
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOF
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Index: tools/build/c2str.pl
===================================================================
--- tools/build/c2str.pl (revision 14845)
+++ tools/build/c2str.pl (working copy)
@@ -174,6 +174,18 @@
};
HEADER
+
+ # append the C code coda
+ print OUT <<HEADER;
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+HEADER
+
close OUT;
}
Index: tools/build/parrot_config_c.pl
===================================================================
--- tools/build/parrot_config_c.pl (revision 14845)
+++ tools/build/parrot_config_c.pl (working copy)
@@ -103,6 +103,17 @@
}
EOF
+# append the C code coda
+print << "EOC";
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOC
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Index: tools/build/revision_c.pl
===================================================================
--- tools/build/revision_c.pl (revision 14845)
+++ tools/build/revision_c.pl (working copy)
@@ -50,6 +50,12 @@
return ${Parrot::Revision::config};
}
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
EOF
# Local Variables:
Index: lib/Parrot/Pmc2c/Library.pm
===================================================================
--- lib/Parrot/Pmc2c/Library.pm (revision 14845)
+++ lib/Parrot/Pmc2c/Library.pm (working copy)
@@ -120,6 +120,7 @@
$hout .= <<"EOH";
Parrot_PMC Parrot_lib_${lc_libname}_load(Parrot_INTERP interpreter);
EOH
+ $hout .= $self->c_code_coda;
return $hout;
}
@@ -138,6 +139,7 @@
$cout .= dynext_load_code($self->{opt}{library},
map { $_->{class} => $_ }
values %{$self->{pmcs}} );
+ $cout .= $self->c_code_coda;
return $cout;
}
@@ -166,6 +168,26 @@
"$cout\n";
}
+=item C<c_code_coda()>
+
+Returns the Parrot C code coda
+
+=cut
+
+sub c_code_coda() {
+ my $self = shift;
+ my $cout = "";
+ $cout .= <<"EOC";
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOC
+ "$cout\n";
+}
+
=back
=head1 SEE ALSO
Index: config/gen/core_pmcs.pm
===================================================================
--- config/gen/core_pmcs.pm (revision 14845)
+++ config/gen/core_pmcs.pm (working copy)
@@ -64,6 +64,13 @@
};
/* &end_gen */
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
END_H
close OUT;
@@ -132,6 +139,13 @@
print OUT " register_pmc(interp, registry, enum_class_$_);\n" foreach (@pmcs);
print OUT <<'END_C';
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
END_C
close OUT;
Index: config/gen/config_h.pm
===================================================================
--- config/gen/config_h.pm (revision 14845)
+++ config/gen/config_h.pm (working copy)
@@ -118,6 +118,17 @@
}
}
+ # append the C code coda
+ print HH <<EOF;
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+EOF
+
close HH;
move_if_diff("$hh.tmp", $hh);
Index: config/gen/platform.pm
===================================================================
--- config/gen/platform.pm (revision 14845)
+++ config/gen/platform.pm (working copy)
@@ -129,6 +129,17 @@
#endif
END_HERE
+ # append the C code coda
+ print PLATFORM_H <<"END_HERE";
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+END_HERE
+
close PLATFORM_H;
# implementation files are merged into platform.c
Index: config/gen/config_h/config_h.in
===================================================================
--- config/gen/config_h/config_h.in (revision 14845)
+++ config/gen/config_h/config_h.in (working copy)
@@ -146,10 +146,8 @@
/*
* Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
+ * c-file-style: "parrot"
* End:
- *
* vim: expandtab shiftwidth=4:
*/
+
Index: config/gen/config_h/feature_h.in
===================================================================
--- config/gen/config_h/feature_h.in (revision 14845)
+++ config/gen/config_h/feature_h.in (working copy)
@@ -146,8 +146,18 @@
#define PARROT_HAS_SOCKLEN_T $has_socklen_t
END_PRINT
-print OUT <<'END_PRINT'
+print OUT <<'END_PRINT';
#endif
END_PRINT
+
+print OUT <<"END_PRINT";
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+END_PRINT