[svn:parrot] r37925 - in trunk: compilers/pirc/src config/gen/makefiles t/codingstd

coke at svn.parrot.org coke at svn.parrot.org
Mon Apr 6 18:00:29 UTC 2009


Author: coke
Date: Mon Apr  6 18:00:28 2009
New Revision: 37925
URL: https://trac.parrot.org/parrot/changeset/37925

Log:
[cage] headerize compilers/pirc/src/pirop compilers/pirc/src/pirerr

(pass an additional test in t/codingstd/c_function_docs.t)

Modified:
   trunk/compilers/pirc/src/pirerr.c
   trunk/compilers/pirc/src/pirerr.h
   trunk/compilers/pirc/src/pirop.c
   trunk/compilers/pirc/src/pirop.h
   trunk/config/gen/makefiles/root.in
   trunk/t/codingstd/c_function_docs.t

Modified: trunk/compilers/pirc/src/pirerr.c
==============================================================================
--- trunk/compilers/pirc/src/pirerr.c	Mon Apr  6 17:11:17 2009	(r37924)
+++ trunk/compilers/pirc/src/pirerr.c	Mon Apr  6 18:00:28 2009	(r37925)
@@ -11,6 +11,11 @@
 #include "pirlexer.h"
 #include "pirerr.h"
 
+/* HEADERIZER HFILE: compilers/pirc/src/pirerr.h */
+
+/* HEADERIZER BEGIN: static */
+
+
 /*
 
 =head1 FUNCTIONS
@@ -18,8 +23,7 @@
 =over 4
 
 
-=item C<void
-panic(lexer_state * lexer, char const * const message)>
+=item C<void panic(lexer_state * lexer, char const * const message, ...)>
 
 Function to emit a final last cry that something's wrong and exit.
 
@@ -27,7 +31,9 @@
 
 */
 void
-panic(lexer_state * lexer, char const * const message, ...) {
+panic(ARGIN(lexer_state * lexer), ARGIN(char const * const message), ...)
+{
+    ASSERT_ARGS(panic)
     va_list arg_ptr;
     fprintf(stderr, "Fatal: ");
     va_start(arg_ptr, message);
@@ -40,8 +46,8 @@
 
 /*
 
-=item C<int
-yypirerror(yyscan_t yyscanner, lexer_state * const lexer, char const * const message, ...)>
+=item C<int yypirerror(yyscan_t yyscanner, lexer_state * const lexer, char const
+* const message, ...)>
 
 Default parse error handling routine, that is invoked when the bison-generated
 parser finds a syntax error.
@@ -51,9 +57,10 @@
 */
 PARROT_IGNORABLE_RESULT
 int
-yypirerror(yyscan_t yyscanner, NOTNULL(lexer_state * const lexer),
-        NOTNULL(char const * const message), ...)
+yypirerror(yyscan_t yyscanner, ARGIN(lexer_state * const lexer),
+        ARGIN(char const * const message), ...)
 {
+    ASSERT_ARGS(yypirerror)
     char const * const current_token = yypirget_text(yyscanner);
     va_list arg_ptr;
 
@@ -75,6 +82,8 @@
     return 0;
 }
 
+/* HEADERIZER END: static */
+
 /*
 
 =back

Modified: trunk/compilers/pirc/src/pirerr.h
==============================================================================
--- trunk/compilers/pirc/src/pirerr.h	Mon Apr  6 17:11:17 2009	(r37924)
+++ trunk/compilers/pirc/src/pirerr.h	Mon Apr  6 18:00:28 2009	(r37925)
@@ -8,10 +8,33 @@
 
 #include "piryy.h"
 
-void panic(lexer_state * lexer, char const * const message, ...);
+/* HEADERIZER BEGIN: compilers/pirc/src/pirerr.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-int yypirerror(yyscan_t yyscanner, struct lexer_state * const lexer,
-               char const * const message, ...);
+void panic(
+    ARGIN(lexer_state * lexer),
+    ARGIN(char const * const message),
+    ...)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_IGNORABLE_RESULT
+int yypirerror(
+    yyscan_t yyscanner,
+    ARGIN(lexer_state * const lexer),
+    ARGIN(char const * const message),
+    ...)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+#define ASSERT_ARGS_panic __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(lexer) \
+    || PARROT_ASSERT_ARG(message)
+#define ASSERT_ARGS_yypirerror __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(lexer) \
+    || PARROT_ASSERT_ARG(message)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: compilers/pirc/src/pirerr.c */
 
 #endif /* PARROT_PIR_PIRERR_H_GUARD */
 

Modified: trunk/compilers/pirc/src/pirop.c
==============================================================================
--- trunk/compilers/pirc/src/pirop.c	Mon Apr  6 17:11:17 2009	(r37924)
+++ trunk/compilers/pirc/src/pirop.c	Mon Apr  6 18:00:28 2009	(r37925)
@@ -43,6 +43,11 @@
     's'    /* USTRING_VAL  */
 };
 
+
+/* HEADERIZER HFILE: compilers/pirc/src/pirop.h */
+
+/* HEADERIZER BEGIN: static */
+
 /*
 
 =item C<static int
@@ -269,8 +274,7 @@
 
 /*
 
-=item C<int
-get_opinfo(lexer_state * const lexer)>
+=item C<int get_opinfo(lexer_state * const lexer)>
 
 Compute the signatured opname from the instruction name and its arguments.
 Based on this signature, the opcode is retrieved. If the opcode cannot
@@ -284,7 +288,9 @@
 */
 PARROT_IGNORABLE_RESULT
 int
-get_opinfo(lexer_state * const lexer) {
+get_opinfo(ARGIN(lexer_state * const lexer))
+{
+    ASSERT_ARGS(get_opinfo)
     instruction * const instr = CURRENT_INSTRUCTION(lexer);
 
     char * const fullopname   = get_signatured_opname(lexer, instr);
@@ -302,6 +308,8 @@
 
 }
 
+/* HEADERIZER END: static */
+
 /*
 
 =back

Modified: trunk/compilers/pirc/src/pirop.h
==============================================================================
--- trunk/compilers/pirc/src/pirop.h	Mon Apr  6 17:11:17 2009	(r37924)
+++ trunk/compilers/pirc/src/pirop.h	Mon Apr  6 18:00:28 2009	(r37925)
@@ -8,7 +8,17 @@
 
 #include "pircompiler.h"
 
-int get_opinfo(lexer_state * const lexer);
+/* HEADERIZER BEGIN: compilers/pirc/src/pirop.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_IGNORABLE_RESULT
+int get_opinfo(ARGIN(lexer_state * const lexer))
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_get_opinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(lexer)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: compilers/pirc/src/pirop.c */
 
 #endif /* PARROT_PIR_PIROP_H_GUARD */
 

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Mon Apr  6 17:11:17 2009	(r37924)
+++ trunk/config/gen/makefiles/root.in	Mon Apr  6 18:00:28 2009	(r37925)
@@ -348,7 +348,9 @@
 # these are private to the PIRC subsystem
 PIRC_O_FILES := \
     $(PIRC_DIR)/bcgen$(O) \
-    $(PIRC_DIR)/pircapi$(O)
+    $(PIRC_DIR)/pircapi$(O) \
+    $(PIRC_DIR)/pirerr$(O) \
+    $(PIRC_DIR)/pirop$(O)
 
 # generated list of header files
 GENERAL_H_FILES   := $(NONGEN_HEADERS) $(GEN_HEADERS) @TEMP_cg_h@

Modified: trunk/t/codingstd/c_function_docs.t
==============================================================================
--- trunk/t/codingstd/c_function_docs.t	Mon Apr  6 17:11:17 2009	(r37924)
+++ trunk/t/codingstd/c_function_docs.t	Mon Apr  6 18:00:28 2009	(r37925)
@@ -101,7 +101,6 @@
 compilers/pirc/src/pircapi.c
 compilers/pirc/src/pircompiler.c
 compilers/pirc/src/piremit.c
-compilers/pirc/src/pirerr.c
 compilers/pirc/src/pirmacro.c
 compilers/pirc/src/pirpcc.c
 compilers/pirc/src/pirregalloc.c


More information about the parrot-commits mailing list