Skip to content

Commit

Permalink
Merge branch 'imcc_cleanups'
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Jan 18, 2011
2 parents f99c01f + 0e3282c commit 7e33ed2
Show file tree
Hide file tree
Showing 20 changed files with 1,488 additions and 1,389 deletions.
1 change: 0 additions & 1 deletion MANIFEST
Expand Up @@ -952,7 +952,6 @@ include/parrot/global_setup.h [main]include
include/parrot/hash.h [main]include
include/parrot/hll.h [main]include
include/parrot/imageio.h [main]include
include/parrot/imcc.h [main]include
include/parrot/interpreter.h [main]include
include/parrot/io.h [main]include
include/parrot/io_portable.h [main]include
Expand Down
3 changes: 2 additions & 1 deletion compilers/imcc/Rules.in
Expand Up @@ -154,11 +154,12 @@ compilers/imcc/main$(O) : \
compilers/imcc/symreg.h \
compilers/imcc/unit.h \
$(INC_DIR)/embed.h \
$(INC_DIR)/imcc.h \
$(INC_DIR)/oplib/ops.h \
$(INC_DIR)/runcore_api.h \
$(INC_DIR)/api.h \
$(INC_DIR)/longopt.h \
include/pmc/pmc_sub.h \
include/pmc/pmc_callcontext.h \
$(PARROT_H_HEADERS)

## SUFFIX OVERRIDE - Warnings (This is generated code)
Expand Down
3 changes: 0 additions & 3 deletions compilers/imcc/debug.c
Expand Up @@ -115,9 +115,6 @@ IMCC_warning(PARROT_INTERP, ARGIN(const char *fmt), ...)
{
ASSERT_ARGS(IMCC_warning)
va_list ap;
if (IMCC_INFO(interp)->imcc_warn)
return;

va_start(ap, fmt);
imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
va_end(ap);
Expand Down
217 changes: 108 additions & 109 deletions compilers/imcc/imc.h
Expand Up @@ -61,6 +61,114 @@ enum {

#define N_ELEMENTS(x) (sizeof (x)/sizeof ((x)[0]))

/* HEADERIZER BEGIN: compilers/imcc/main.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * imcc_compile_file(PARROT_INTERP,
ARGIN(const char *fullname),
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);

PARROT_EXPORT
int imcc_run_api(
ARGMOD(PMC * interp_pmc),
ARGIN(const char *sourcefile),
int argc,
ARGIN_NULLOK(const char **argv),
ARGOUT(PMC **pbcpmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(5)
FUNC_MODIFIES(* interp_pmc)
FUNC_MODIFIES(*pbcpmc);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile(PARROT_INTERP,
ARGIN(const char *s),
int pasm_file,
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(4)
FUNC_MODIFIES(*error_message);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile_pasm_ex(PARROT_INTERP, ARGIN(const char *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * IMCC_compile_pasm_s(PARROT_INTERP,
ARGIN(const char *s),
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile_pir_ex(PARROT_INTERP, ARGIN(const char *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * IMCC_compile_pir_s(PARROT_INTERP,
ARGIN(const char *s),
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);

void imcc_destroy(PARROT_INTERP)
__attribute__nonnull__(1);

void imcc_init(PARROT_INTERP)
__attribute__nonnull__(1);

#define ASSERT_ARGS_imcc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(fullname) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_run_api __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp_pmc) \
, PARROT_ASSERT_ARG(sourcefile) \
, PARROT_ASSERT_ARG(pbcpmc))
#define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_compile_pasm_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_IMCC_compile_pasm_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_compile_pir_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_IMCC_compile_pir_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_imcc_init __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: compilers/imcc/main.c */

/* HEADERIZER BEGIN: compilers/imcc/imcc.y */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

Expand Down Expand Up @@ -183,16 +291,6 @@ Instruction * INS_LABEL(PARROT_INTERP,
/* HEADERIZER BEGIN: compilers/imcc/parser_util.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * imcc_compile_file(PARROT_INTERP,
ARGIN(const char *fullname),
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);

void check_op(PARROT_INTERP,
ARGOUT(op_info_t **op_info),
ARGOUT(char *fullname),
Expand All @@ -208,67 +306,6 @@ void check_op(PARROT_INTERP,
FUNC_MODIFIES(*op_info)
FUNC_MODIFIES(*fullname);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile(PARROT_INTERP,
ARGIN(const char *s),
int pasm_file,
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(4)
FUNC_MODIFIES(*error_message);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile_pasm(PARROT_INTERP, ARGIN(const char *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile_pasm_ex(PARROT_INTERP, ARGIN(const char *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * IMCC_compile_pasm_s(PARROT_INTERP,
ARGIN(const char *s),
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile_pir(PARROT_INTERP, ARGIN(const char *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * imcc_compile_pir_ex(PARROT_INTERP, ARGIN(const char *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * IMCC_compile_pir_s(PARROT_INTERP,
ARGIN(const char *s),
ARGOUT(STRING **error_message))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);

void imcc_destroy(PARROT_INTERP)
__attribute__nonnull__(1);

void imcc_init(PARROT_INTERP)
__attribute__nonnull__(1);

PARROT_IGNORABLE_RESULT
int /*@alt void@*/
imcc_vfprintf(PARROT_INTERP,
Expand Down Expand Up @@ -312,47 +349,12 @@ void op_fullname(
__attribute__nonnull__(3)
FUNC_MODIFIES(*dest);

void register_compilers(PARROT_INTERP)
__attribute__nonnull__(1);

#define ASSERT_ARGS_imcc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(fullname) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_check_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(op_info) \
, PARROT_ASSERT_ARG(fullname) \
, PARROT_ASSERT_ARG(name) \
, PARROT_ASSERT_ARG(r))
#define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_compile_pasm __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_imcc_compile_pasm_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_IMCC_compile_pasm_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_compile_pir __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_imcc_compile_pir_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_IMCC_compile_pir_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_imcc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_imcc_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_imcc_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(io) \
Expand All @@ -369,8 +371,6 @@ void register_compilers(PARROT_INTERP)
PARROT_ASSERT_ARG(dest) \
, PARROT_ASSERT_ARG(name) \
, PARROT_ASSERT_ARG(args))
#define ASSERT_ARGS_register_compilers __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: compilers/imcc/parser_util.c */

Expand Down Expand Up @@ -548,7 +548,6 @@ typedef struct _imc_info_t {
int emitter;
int error_code; /* The Error code. */
int expect_pasm;
int gc_off;
int imcc_warn;
int in_pod;
int ins_line;
Expand Down

0 comments on commit 7e33ed2

Please sign in to comment.