[svn:parrot] r38479 - in trunk: compilers/pirc/src config/gen/makefiles include/parrot tools/build

petdance at svn.parrot.org petdance at svn.parrot.org
Tue May 5 04:15:33 UTC 2009


Author: petdance
Date: Tue May  5 04:15:26 2009
New Revision: 38479
URL: https://trac.parrot.org/parrot/changeset/38479

Log:
Added some more splint instrumentation in the headerizer

Modified:
   trunk/compilers/pirc/src/bcgen.h
   trunk/compilers/pirc/src/pirerr.h
   trunk/compilers/pirc/src/pirop.h
   trunk/config/gen/makefiles/root.in
   trunk/include/parrot/call.h
   trunk/include/parrot/debugger.h
   trunk/include/parrot/gc_pools.h
   trunk/include/parrot/io.h
   trunk/include/parrot/string_funcs.h
   trunk/tools/build/headerizer.pl

Modified: trunk/compilers/pirc/src/bcgen.h
==============================================================================
--- trunk/compilers/pirc/src/bcgen.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/compilers/pirc/src/bcgen.h	Tue May  5 04:15:26 2009	(r38479)
@@ -145,11 +145,13 @@
         __attribute__nonnull__(1);
 
 PARROT_IGNORABLE_RESULT
-opcode_t emit_int_arg(ARGIN(bytecode * const bc), int intval)
+opcode_t /*@alt void@*/
+emit_int_arg(ARGIN(bytecode * const bc), int intval)
         __attribute__nonnull__(1);
 
 PARROT_IGNORABLE_RESULT
-opcode_t emit_opcode(ARGIN(bytecode * const bc), opcode_t op)
+opcode_t /*@alt void@*/
+emit_opcode(ARGIN(bytecode * const bc), opcode_t op)
         __attribute__nonnull__(1);
 
 FLOATVAL get_num_const(ARGIN(bytecode * const bc), unsigned index)

Modified: trunk/compilers/pirc/src/pirerr.h
==============================================================================
--- trunk/compilers/pirc/src/pirerr.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/compilers/pirc/src/pirerr.h	Tue May  5 04:15:26 2009	(r38479)
@@ -19,7 +19,8 @@
         __attribute__nonnull__(2);
 
 PARROT_IGNORABLE_RESULT
-int yypirerror(
+int /*@alt void@*/
+yypirerror(
     yyscan_t yyscanner,
     ARGIN(lexer_state * const lexer),
     ARGIN(char const * const message),

Modified: trunk/compilers/pirc/src/pirop.h
==============================================================================
--- trunk/compilers/pirc/src/pirop.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/compilers/pirc/src/pirop.h	Tue May  5 04:15:26 2009	(r38479)
@@ -12,7 +12,8 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_IGNORABLE_RESULT
-int get_opinfo(ARGIN(lexer_state * const lexer))
+int /*@alt void@*/
+get_opinfo(ARGIN(lexer_state * const lexer))
         __attribute__nonnull__(1);
 
 #define ASSERT_ARGS_get_opinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/config/gen/makefiles/root.in	Tue May  5 04:15:26 2009	(r38479)
@@ -2070,6 +2070,7 @@
 # ex: make SPLINTFLAGS_TEST='-posixstrictlib +posixlib' splint
 SPLINTFLAGS_TEST := \
     +partial \
+    -memchecks \
 
 splint : $(PARROT)
 	$(MKPATH) $(SPLINT_TMP)
@@ -2079,7 +2080,7 @@
 splint-andy :
 	$(MKPATH) $(SPLINT_TMP)
 	splint $(CC_INC) @cc_hasjit@ -DNDEBUG "-Isrc/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
-	src/string/*.c \
+	src/d*.c \
     | grep -v 'Source code error generation point'
 
 COVER_FLAGS := -fprofile-arcs -ftest-coverage

Modified: trunk/include/parrot/call.h
==============================================================================
--- trunk/include/parrot/call.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/include/parrot/call.h	Tue May  5 04:15:26 2009	(r38479)
@@ -403,7 +403,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-FLOATVAL Parrot_run_meth_fromc_arglist_retf(PARROT_INTERP,
+FLOATVAL /*@alt void@*/
+Parrot_run_meth_fromc_arglist_retf(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN_NULLOK(PMC *obj),
     ARGIN(STRING *meth),
@@ -417,7 +418,8 @@
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
 PARROT_CAN_RETURN_NULL
-INTVAL Parrot_run_meth_fromc_arglist_reti(PARROT_INTERP,
+INTVAL /*@alt void@*/
+Parrot_run_meth_fromc_arglist_reti(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN_NULLOK(PMC *obj),
     ARGIN(STRING *meth),
@@ -444,7 +446,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-FLOATVAL Parrot_run_meth_fromc_args_retf(PARROT_INTERP,
+FLOATVAL /*@alt void@*/
+Parrot_run_meth_fromc_args_retf(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN_NULLOK(PMC *obj),
     ARGIN(STRING *meth),
@@ -457,7 +460,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-INTVAL Parrot_run_meth_fromc_args_reti(PARROT_INTERP,
+INTVAL /*@alt void@*/
+Parrot_run_meth_fromc_args_reti(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN_NULLOK(PMC *obj),
     ARGIN(STRING *meth),
@@ -488,7 +492,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-FLOATVAL Parrot_runops_fromc_arglist_retf(PARROT_INTERP,
+FLOATVAL /*@alt void@*/
+Parrot_runops_fromc_arglist_retf(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN(const char *sig),
     va_list args)
@@ -498,7 +503,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-INTVAL Parrot_runops_fromc_arglist_reti(PARROT_INTERP,
+INTVAL /*@alt void@*/
+Parrot_runops_fromc_arglist_reti(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN(const char *sig),
     va_list args)
@@ -530,7 +536,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-FLOATVAL Parrot_runops_fromc_args_retf(PARROT_INTERP,
+FLOATVAL /*@alt void@*/
+Parrot_runops_fromc_args_retf(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN(const char *sig),
     ...)
@@ -540,7 +547,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-INTVAL Parrot_runops_fromc_args_reti(PARROT_INTERP,
+INTVAL /*@alt void@*/
+Parrot_runops_fromc_args_reti(PARROT_INTERP,
     ARGIN(PMC *sub),
     ARGIN(const char *sig),
     ...)

Modified: trunk/include/parrot/debugger.h
==============================================================================
--- trunk/include/parrot/debugger.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/include/parrot/debugger.h	Tue May  5 04:15:26 2009	(r38479)
@@ -333,7 +333,9 @@
         __attribute__nonnull__(1);
 
 PARROT_IGNORABLE_RESULT
-int PDB_run_command(PARROT_INTERP, ARGIN(const char *command))
+int /*@alt void@*/
+PDB_run_command(PARROT_INTERP,
+    ARGIN(const char *command))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 

Modified: trunk/include/parrot/gc_pools.h
==============================================================================
--- trunk/include/parrot/gc_pools.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/include/parrot/gc_pools.h	Tue May  5 04:15:26 2009	(r38479)
@@ -109,7 +109,8 @@
         __attribute__nonnull__(1);
 
 PARROT_IGNORABLE_RESULT
-int Parrot_forall_header_pools(PARROT_INTERP,
+int /*@alt void@*/
+Parrot_forall_header_pools(PARROT_INTERP,
     int flag,
     ARGIN_NULLOK(void *arg),
     NOTNULL(pool_iter_fn func))

Modified: trunk/include/parrot/io.h
==============================================================================
--- trunk/include/parrot/io.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/include/parrot/io.h	Tue May  5 04:15:26 2009	(r38479)
@@ -160,7 +160,11 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-INTVAL Parrot_io_eprintf(NULLOK(PARROT_INTERP), ARGIN(const char *s), ...)
+INTVAL /*@alt void@*/
+Parrot_io_eprintf(
+    NULLOK(PARROT_INTERP),
+    ARGIN(const char *s),
+    ...)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT

Modified: trunk/include/parrot/string_funcs.h
==============================================================================
--- trunk/include/parrot/string_funcs.h	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/include/parrot/string_funcs.h	Tue May  5 04:15:26 2009	(r38479)
@@ -262,7 +262,8 @@
 
 PARROT_EXPORT
 PARROT_IGNORABLE_RESULT
-INTVAL Parrot_str_length(PARROT_INTERP, ARGMOD(STRING *s))
+INTVAL /*@alt void@*/
+Parrot_str_length(PARROT_INTERP, ARGMOD(STRING *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*s);

Modified: trunk/tools/build/headerizer.pl
==============================================================================
--- trunk/tools/build/headerizer.pl	Tue May  5 03:26:30 2009	(r38478)
+++ trunk/tools/build/headerizer.pl	Tue May  5 04:15:26 2009	(r38479)
@@ -183,6 +183,13 @@
     return @func_declarations;
 }
 
+=head2 function_components_from_declaration( $file, $proto )
+
+Takes a declaration of a function and returns an ad-hoc hashref of
+properties for use elsewhere.
+
+=cut
+
 sub function_components_from_declaration {
     my $file  = shift;
     my $proto = shift;
@@ -226,6 +233,7 @@
             or die "Bad args in $proto";
     }
 
+    my $is_ignorable = 0;
     my $is_static = 0;
     $is_static = $2 if $return_type =~ s/^((static)\s+)?//i;
 
@@ -237,6 +245,9 @@
         if ( not $valid_macros{$macro} ) {
             squawk( $file, $name, "Invalid macro $macro" );
         }
+        if ( $macro eq 'PARROT_IGNORABLE_RESULT' ) {
+            $is_ignorable = 1;
+        }
     }
     if ( $return_type =~ /\*/ ) {
         if ( !$macros{PARROT_CAN_RETURN_NULL} && !$macros{PARROT_CANNOT_RETURN_NULL} ) {
@@ -250,14 +261,15 @@
     }
 
     return {
-        file        => $file,
-        name        => $name,
-        args        => \@args,
-        macros      => \@macros,
-        is_static   => $is_static,
-        is_inline   => $parrot_inline,
-        is_api      => $parrot_api,
-        return_type => $return_type,
+        file         => $file,
+        name         => $name,
+        args         => \@args,
+        macros       => \@macros,
+        is_static    => $is_static,
+        is_inline    => $parrot_inline,
+        is_api       => $parrot_api,
+        is_ignorable => $is_ignorable,
+        return_type  => $return_type,
     };
 }
 
@@ -332,7 +344,13 @@
     foreach my $func (@funcs) {
         my $multiline = 0;
 
-        my $decl = sprintf( "%s %s(", $func->{return_type}, $func->{name} );
+        my $return = $func->{return_type};
+        my $alt_void = ' ';
+        if ( $func->{is_ignorable} && ($return ne 'void') && ($return !~ /\*/) ) {
+            $alt_void = " /*\@alt void@*/\n";
+        }
+
+        my $decl = sprintf( "%s%s%s(", $return, $alt_void, $func->{name} );
         $decl = "static $decl" if $func->{is_static};
 
         my @args    = @{ $func->{args} };


More information about the parrot-commits mailing list