[svn:parrot] r43971 - trunk/compilers/pirc/src

bacek at svn.parrot.org bacek at svn.parrot.org
Mon Feb 15 21:26:21 UTC 2010


Author: bacek
Date: Mon Feb 15 21:26:20 2010
New Revision: 43971
URL: https://trac.parrot.org/parrot/changeset/43971

Log:
Add more headerizer directives into PIRC and rerun headerizer

Modified:
   trunk/compilers/pirc/src/main.c
   trunk/compilers/pirc/src/pir.y
   trunk/compilers/pirc/src/pircompiler.c
   trunk/compilers/pirc/src/pircompunit.c
   trunk/compilers/pirc/src/piremit.c
   trunk/compilers/pirc/src/pirparser.c
   trunk/compilers/pirc/src/pirpcc.c
   trunk/compilers/pirc/src/pirregalloc.c
   trunk/compilers/pirc/src/pirsymbol.c

Modified: trunk/compilers/pirc/src/main.c
==============================================================================
--- trunk/compilers/pirc/src/main.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/main.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -27,7 +27,7 @@
 
 #endif
 
-
+/* HEADERIZER HFILE: none */
 
 /* XXX use pthreads library to test thread safety.
    does not work currently on windows.
@@ -49,6 +49,19 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void print_help(char const * const program_name);
+static void runcode(PARROT_INTERP, int argc, char *argv[])
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_print_help __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_runcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 /*
 
 =head1 FUNCTIONS

Modified: trunk/compilers/pirc/src/pir.y
==============================================================================
--- trunk/compilers/pirc/src/pir.y	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pir.y	Mon Feb 15 21:26:20 2010	(r43971)
@@ -90,6 +90,12 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 char *expand_macro(yyscan_t yyscanner, macro_def * const macro, macro_param * args);
 
 /* Enumeration of mathematical operator types; these are used to index the opnames array. */

Modified: trunk/compilers/pirc/src/pircompiler.c
==============================================================================
--- trunk/compilers/pirc/src/pircompiler.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pircompiler.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -17,6 +17,18 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_MALLOC
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+static allocated_mem_ptrs * new_mem_ptrs_block(void);
+
+#define ASSERT_ARGS_new_mem_ptrs_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 /* XXX count memory, so we can check out mem. savings of string reuse
  * Only temporarily used, so no need to "fix" this.
  */

Modified: trunk/compilers/pirc/src/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/src/pircompunit.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pircompunit.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -46,6 +46,14 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void add_self_parameter(lexer_state * const lexer);
+#define ASSERT_ARGS_add_self_parameter __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 static unsigned const prime_numbers[] = {113 /* XXX think of more primes */ };
 
 /*

Modified: trunk/compilers/pirc/src/piremit.c
==============================================================================
--- trunk/compilers/pirc/src/piremit.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/piremit.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -16,6 +16,55 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void emit_pbc_annotations(lexer_state * const lexer);
+static void emit_pbc_const_arg(
+    lexer_state * const lexer,
+    constant * const c);
+
+static void emit_pbc_expr(
+    lexer_state * const lexer,
+    expression * const operand);
+
+static void emit_pbc_instr(
+    lexer_state * const lexer,
+    instruction * const instr);
+
+static void emit_pbc_label_arg(lexer_state * const lexer, label * const l);
+static void emit_pbc_sub(lexer_state * const lexer, subroutine * const sub);
+static void emit_pbc_target_arg(lexer_state * const lexer, target * const t);
+static void emit_pir_instruction(
+    lexer_state * const lexer,
+    instruction * const instr);
+
+static void emit_pir_statement(
+    lexer_state * const lexer,
+    subroutine * const sub);
+
+static void optimize_instr(
+    lexer_state * const lexer,
+    instruction * const instr);
+
+static void print_sub_flags(
+    lexer_state * const lexer,
+    subroutine * const subiter);
+
+#define ASSERT_ARGS_emit_pbc_annotations __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_const_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_expr __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_instr __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_label_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_target_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pir_instruction __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pir_statement __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_optimize_instr __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_print_sub_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 /*
 
 =head1 DESCRIPTION

Modified: trunk/compilers/pirc/src/pirparser.c
==============================================================================
--- trunk/compilers/pirc/src/pirparser.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pirparser.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -407,6 +407,109 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void check_first_arg_direction(
+    lexer_state * const lexer,
+    NOTNULL(char const * const opname))
+        __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static char * concat_strings(
+    NOTNULL(lexer_state * const lexer),
+    NOTNULL(char const * a),
+    NOTNULL(char const * b))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+static void create_if_instr(
+    NOTNULL(lexer_state * const lexer),
+    int invert,
+    int hasnull,
+    NOTNULL(char const * const name),
+    NOTNULL(char const * const label))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5);
+
+static void do_strength_reduction(lexer_state * const lexer);
+PARROT_WARN_UNUSED_RESULT
+static int evaluate_i_i(int a, pir_rel_operator op, int b);
+
+PARROT_WARN_UNUSED_RESULT
+static int evaluate_i_n(int a, pir_rel_operator op, double b);
+
+PARROT_WARN_UNUSED_RESULT
+static int evaluate_n_i(double a, pir_rel_operator op, int b);
+
+static void undeclared_symbol(
+    lexer_state * const lexer,
+    char const * const symbol);
+
+static void yy_reduce_print (
+    YYSTYPE *yyvsp,
+    int yyrule,
+    yyscan_t yyscanner,
+    struct lexer_state * const lexer);
+
+static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top);
+static void yy_symbol_print (
+    FILE *yyoutput,
+    int yytype,
+    YYSTYPE const * const yyvaluep,
+    yyscan_t yyscanner,
+    struct lexer_state * const lexer);
+
+static void yy_symbol_value_print (
+    FILE *yyoutput,
+    int yytype,
+    YYSTYPE const * const yyvaluep,
+    yyscan_t yyscanner,
+    struct lexer_state * const lexer);
+
+static void yydestruct (
+    const char *yymsg,
+    int yytype,
+    YYSTYPE *yyvaluep,
+    yyscan_t yyscanner,
+    struct lexer_state * const lexer);
+
+static int YYID (int i);
+static char * yystpcpy (char *yydest, const char *yysrc);
+static YYSIZE_T yystrlen (const char *yystr);
+static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar);
+static YYSIZE_T yytnamerr (char *yyres, const char *yystr);
+#define ASSERT_ARGS_check_first_arg_direction __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(opname))
+#define ASSERT_ARGS_concat_strings __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(lexer) \
+    , PARROT_ASSERT_ARG(a) \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_create_if_instr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(lexer) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(label))
+#define ASSERT_ARGS_do_strength_reduction __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_evaluate_i_i __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_evaluate_i_n __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_evaluate_n_i __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_undeclared_symbol __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yy_reduce_print  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yy_stack_print  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yy_symbol_print  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yy_symbol_value_print  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yydestruct  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_YYID  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yystpcpy  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yystrlen  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yysyntax_error  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_yytnamerr  __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 char *expand_macro(yyscan_t yyscanner, macro_def * const macro, macro_param * args);
 
 /* Enumeration of mathematical operator types; these are used to index the opnames array. */

Modified: trunk/compilers/pirc/src/pirpcc.c
==============================================================================
--- trunk/compilers/pirc/src/pirpcc.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pirpcc.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -27,6 +27,79 @@
 
 /* HEADERIZER HFILE: none */
 
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void add_alias_operand(
+    lexer_state * const lexer,
+    PMC *array,
+    int index,
+    char const * const alias);
+
+static void arguments_to_operands(
+    lexer_state * const lexer,
+    argument * const args,
+    unsigned num_arguments);
+
+static void convert_nci_call(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static void convert_pcc_call(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static void convert_pcc_methodcall(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static void convert_pcc_methodtailcall(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static void convert_pcc_return(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static void convert_pcc_tailcall(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static void convert_pcc_yield(
+    lexer_state * const lexer,
+    invocation * const inv);
+
+static int generate_signature_pmc(lexer_state * const lexer, unsigned size);
+static target * generate_unique_pir_reg(
+    lexer_state * const lexer,
+    pir_type type);
+
+static void save_global_reference(
+    lexer_state * const lexer,
+    instruction * const instr,
+    char const * const label);
+
+static void targets_to_operands(
+    lexer_state * const lexer,
+    target * const targets,
+    unsigned num_targets);
+
+#define ASSERT_ARGS_add_alias_operand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_arguments_to_operands __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_nci_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_pcc_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_pcc_methodcall __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_pcc_methodtailcall __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_pcc_return __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_pcc_tailcall __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_convert_pcc_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_generate_signature_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_generate_unique_pir_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_save_global_reference __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_targets_to_operands __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 
 /*
 

Modified: trunk/compilers/pirc/src/pirregalloc.c
==============================================================================
--- trunk/compilers/pirc/src/pirregalloc.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pirregalloc.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -7,8 +7,6 @@
 #include "pirregalloc.h"
 #include "parrot/parrot.h"
 
-/* HEADERIZER HFILE: none */
-
 /*
 
 =head1 DESCRIPTION
@@ -72,6 +70,26 @@
         lsr->r[i] = 1;
 }
 
+/* HEADERIZER HFILE: none */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void add_free_reg(
+    lsr_allocator * const lsr,
+    unsigned regno,
+    pir_type type);
+
+static void expire_old_intervals(
+    lsr_allocator * const lsr,
+    live_interval * const i,
+    pir_type type);
+
+#define ASSERT_ARGS_add_free_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_expire_old_intervals __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
 /*
 
 =item C<lsr_allocator *

Modified: trunk/compilers/pirc/src/pirsymbol.c
==============================================================================
--- trunk/compilers/pirc/src/pirsymbol.c	Mon Feb 15 21:25:53 2010	(r43970)
+++ trunk/compilers/pirc/src/pirsymbol.c	Mon Feb 15 21:26:20 2010	(r43971)
@@ -11,8 +11,6 @@
 #include <string.h>
 #include <stdio.h>
 
-/* HEADERIZER HFILE: none */
-
 /*
 
 =head1 NAME
@@ -50,6 +48,40 @@
 */
 
 
+/* HEADERIZER HFILE: none */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static local_label * new_local_label(
+    NOTNULL(lexer_state * const lexer),
+    NOTNULL(char const * const name),
+    unsigned offset)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static int next_register(NOTNULL(lexer_state * const lexer), pir_type type)
+        __attribute__nonnull__(1);
+
+static int use_register(
+    NOTNULL(lexer_state * const lexer),
+    pir_type type,
+    int regno,
+    int pasmregno)
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_new_local_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(lexer) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_next_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(lexer))
+#define ASSERT_ARGS_use_register __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: static */
+
 
 
 /* Conversion Look-Up Table (CLUT) for pir_type and value_type enums.


More information about the parrot-commits mailing list