Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add more headerizer directives into PIRC and rerun headerizer

git-svn-id: https://svn.parrot.org/parrot/trunk@43971 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 878c9edbc480d19db5c54901fcc3638e1a78385a 1 parent 14be40a
@bacek bacek authored
View
15 src/main.c
@@ -27,7 +27,7 @@ extern int yypirdebug = 0;
#endif
-
+/* HEADERIZER HFILE: none */
/* XXX use pthreads library to test thread safety.
does not work currently on windows.
@@ -49,6 +49,19 @@ void * process_file(void *a);
/* 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
View
6 src/pir.y
@@ -90,6 +90,12 @@ int yypirlex(YYSTYPE *yylval, yyscan_t yyscanner);
/* 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. */
View
12 src/pircompiler.c
@@ -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.
*/
View
8 src/pircompunit.c
@@ -46,6 +46,14 @@ O(c) (constant) time.
/* 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 */ };
/*
View
49 src/piremit.c
@@ -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
View
103 src/pirparser.c
@@ -407,6 +407,109 @@ int yypirlex(YYSTYPE *yylval, yyscan_t yyscanner);
/* 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. */
View
73 src/pirpcc.c
@@ -27,6 +27,79 @@ Conventions.
/* 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 */
+
/*
View
22 src/pirregalloc.c
@@ -7,8 +7,6 @@
#include "pirregalloc.h"
#include "parrot/parrot.h"
-/* HEADERIZER HFILE: none */
-
/*
=head1 DESCRIPTION
@@ -72,6 +70,26 @@ reset_register_count(lsr_allocator * const lsr) {
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 *
View
36 src/pirsymbol.c
@@ -11,8 +11,6 @@
#include <string.h>
#include <stdio.h>
-/* HEADERIZER HFILE: none */
-
/*
=head1 NAME
@@ -50,6 +48,40 @@ Globally defined constants are stored in yet another separate list.
*/
+/* 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.
Please sign in to comment.
Something went wrong with that request. Please try again.