Browse files

re-remove include/parrot/imcc.h

  • Loading branch information...
2 parents b5e412d + d4cdba7 commit 29c4a7fc58729db2a30498da5bd548b26d046e8b @Whiteknight Whiteknight committed Jan 15, 2011
Showing with 123 additions and 158 deletions.
  1. +0 −1 MANIFEST
  2. +0 −1 compilers/imcc/Rules.in
  3. +55 −64 compilers/imcc/main.c
  4. +66 −38 frontend/parrot/main.c
  5. +1 −8 include/parrot/api.h
  6. +0 −17 include/parrot/imcc.h
  7. +0 −2 include/parrot/interpreter.h
  8. +1 −27 src/embed/api.c
View
1 MANIFEST
@@ -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
View
1 compilers/imcc/Rules.in
@@ -154,7 +154,6 @@ 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 \
View
119 compilers/imcc/main.c
@@ -31,7 +31,6 @@ IMCC helpers.
#include "imc.h"
#include "parrot/embed.h"
#include "parrot/longopt.h"
-#include "parrot/imcc.h"
#include "parrot/runcore_api.h"
#include "pmc/pmc_callcontext.h"
#include "pbc.h"
@@ -54,12 +53,10 @@ static PackFile * compile_to_bytecode(PARROT_INTERP,
__attribute__nonnull__(2)
__attribute__nonnull__(4);
-static void determine_input_file_type(PARROT_INTERP,
- ARGIN(const char * const sourcefile),
- ARGIN(yyscan_t yyscanner))
+static FILE* determine_input_file_type(PARROT_INTERP,
+ ARGIN(const char * const sourcefile))
__attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3);
+ __attribute__nonnull__(2);
static void determine_output_file_type(PARROT_INTERP,
ARGIN(const char *output_file))
@@ -76,12 +73,22 @@ static void imcc_get_optimization_description(
__attribute__nonnull__(3)
FUNC_MODIFIES(*opt_desc);
-static void imcc_parseflags(PARROT_INTERP,
+static char * imcc_parseflags(PARROT_INTERP,
int argc,
ARGIN(const char **argv))
__attribute__nonnull__(1)
__attribute__nonnull__(3);
+static int imcc_run(PARROT_INTERP,
+ ARGIN(const char *sourcefile),
+ ARGIN(const char *output_file),
+ ARGOUT(PMC **pbcpmc))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ __attribute__nonnull__(4)
+ FUNC_MODIFIES(*pbcpmc);
+
static void imcc_write_pbc(PARROT_INTERP, ARGIN(const char *output_file))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -101,8 +108,7 @@ static const struct longopt_opt_decl * Parrot_cmd_options(void);
, PARROT_ASSERT_ARG(yyscanner))
#define ASSERT_ARGS_determine_input_file_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(sourcefile) \
- , PARROT_ASSERT_ARG(yyscanner))
+ , PARROT_ASSERT_ARG(sourcefile))
#define ASSERT_ARGS_determine_output_file_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(output_file))
@@ -114,6 +120,11 @@ static const struct longopt_opt_decl * Parrot_cmd_options(void);
#define ASSERT_ARGS_imcc_parseflags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(argv))
+#define ASSERT_ARGS_imcc_run __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(sourcefile) \
+ , PARROT_ASSERT_ARG(output_file) \
+ , PARROT_ASSERT_ARG(pbcpmc))
#define ASSERT_ARGS_imcc_write_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(output_file))
@@ -211,19 +222,21 @@ Parrot_cmd_options(void)
/*
-=item C<static void imcc_parseflags(PARROT_INTERP, int argc, const char **argv)>
+=item C<static char * imcc_parseflags(PARROT_INTERP, int argc, const char
+**argv)>
Parse flags ans set approptiate state(s)
=cut
*/
-static void
+static char *
imcc_parseflags(PARROT_INTERP, int argc, ARGIN(const char **argv))
{
ASSERT_ARGS(imcc_parseflags)
struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
+ char * output_file = NULL;
/* default state: run pbc */
SET_STATE_RUN_PBC(interp);
@@ -249,14 +262,6 @@ imcc_parseflags(PARROT_INTERP, int argc, ARGIN(const char **argv))
case 'a':
SET_STATE_PASM_FILE(interp);
break;
- case 'r':
- if (STATE_RUN_PBC(interp))
- SET_STATE_RUN_FROM_FILE(interp);
- SET_STATE_RUN_PBC(interp);
- break;
- case 'c':
- SET_STATE_LOAD_PBC(interp);
- break;
case 'v':
IMCC_INFO(interp)->verbose++;
break;
@@ -268,14 +273,14 @@ imcc_parseflags(PARROT_INTERP, int argc, ARGIN(const char **argv))
break;
case 'o':
UNSET_STATE_RUN_PBC(interp);
- interp->output_file = opt.opt_arg;
+ output_file = opt.opt_arg;
break;
case OPT_PBC_OUTPUT:
UNSET_STATE_RUN_PBC(interp);
SET_STATE_WRITE_PBC(interp);
- if (!interp->output_file)
- interp->output_file = "-";
+ if (!output_file)
+ output_file = "-";
break;
case 'O':
@@ -302,6 +307,7 @@ imcc_parseflags(PARROT_INTERP, int argc, ARGIN(const char **argv))
break;
}
}
+ return output_file;
}
/*
@@ -466,7 +472,7 @@ imcc_write_pbc(PARROT_INTERP, ARGIN(const char *output_file))
size_t size;
opcode_t *packed;
FILE *fp;
- PackFile_ByteCode * interp_code = Parrot_pf_get_current_code_segment(interp);
+ PackFile_ByteCode * const interp_code = Parrot_pf_get_current_code_segment(interp);
IMCC_info(interp, 1, "Writing %s\n", output_file);
@@ -491,46 +497,28 @@ imcc_write_pbc(PARROT_INTERP, ARGIN(const char *output_file))
/*
-=item C<static void determine_input_file_type(PARROT_INTERP, const char * const
-sourcefile, yyscan_t yyscanner)>
+=item C<static FILE* determine_input_file_type(PARROT_INTERP, const char * const
+sourcefile)>
-Read in the source and determine whether it's Parrot bytecode or PASM
+Determine whether the sourcefile is a .pir or .pasm file. Sets the appropriate
+flags and returns a C<FILE*> to the opened file.
=cut
*/
-static void
-determine_input_file_type(PARROT_INTERP, ARGIN(const char * const sourcefile),
- ARGIN(yyscan_t yyscanner))
+static FILE*
+determine_input_file_type(PARROT_INTERP, ARGIN(const char * const sourcefile))
{
ASSERT_ARGS(determine_input_file_type)
- /* Read in the source and check the file extension for the input type;
- a file extension .pbc means it's parrot bytecode;
- a file extension .pasm means it's parrot assembly (PASM);
- otherwise, it's assumed to be PIR.
- */
- if (STREQ(sourcefile, "-")) {
- imc_yyin_set(stdin, yyscanner);
- }
+ if (STREQ(sourcefile, "-"))
+ return stdin;
else {
- const char * const ext = strrchr(sourcefile, '.');
-
- if (ext && (STREQ(ext, ".pbc"))) { /* a PBC file */
- SET_STATE_LOAD_PBC(interp);
- UNSET_STATE_WRITE_PBC(interp);
- }
- else if (!STATE_LOAD_PBC(interp)) {
- if (!(imc_yyin_set(fopen(sourcefile, "r"), yyscanner))) {
- IMCC_fatal_standalone(interp, EXCEPTION_EXTERNAL_ERROR,
- "Error reading source file %s.\n",
- sourcefile);
- }
-
- if (ext && STREQ(ext, ".pasm"))
- SET_STATE_PASM_FILE(interp);
- }
+ const char * ext = strrchr(sourcefile, '.');
+ if (ext && STREQ(ext, ".pasm"))
+ SET_STATE_PASM_FILE(interp);
+ return fopen(sourcefile, "r");
}
}
@@ -646,13 +634,14 @@ imcc_run_api(ARGMOD(PMC * interp_pmc), ARGIN(const char *sourcefile), int argc,
ARGIN(const char **argv), ARGOUT(PMC **pbcpmc))
{
Interp * interp = (Interp *)VTABLE_get_pointer(NULL, interp_pmc);
- return imcc_run(interp, sourcefile, argc, argv, pbcpmc);
+ const char * output_file = imcc_parseflags(interp, argc, argv);
+ return imcc_run(interp, sourcefile, output_file, pbcpmc);
}
/*
-=item C<int imcc_run(PARROT_INTERP, const char *sourcefile, int argc, const char
-**argv, PMC **pbcpmc)>
+=item C<static int imcc_run(PARROT_INTERP, const char *sourcefile, const char
+*output_file, PMC **pbcpmc)>
Entry point of IMCC, as invoked by Parrot's main function.
Compile source code (if required), write bytecode file (if required)
@@ -662,17 +651,14 @@ and run. This function always returns 0.
*/
-int
-imcc_run(PARROT_INTERP, ARGIN(const char *sourcefile), int argc,
- ARGIN(const char **argv), ARGOUT(PMC **pbcpmc))
+static int
+imcc_run(PARROT_INTERP, ARGIN(const char *sourcefile),
+ ARGIN(const char *output_file), ARGOUT(PMC **pbcpmc))
{
yyscan_t yyscanner;
- const char * const output_file = interp->output_file;
PackFile * pf_raw = NULL;
*pbcpmc = PMCNULL;
- imcc_parseflags(interp, argc, argv);
-
/* PMCs in IMCC_INFO won't get marked */
Parrot_block_GC_mark(interp);
Parrot_block_GC_sweep(interp);
@@ -682,8 +668,13 @@ imcc_run(PARROT_INTERP, ARGIN(const char *sourcefile), int argc,
/* Figure out what kind of source file we have -- if we have one */
if (!sourcefile || !*sourcefile)
IMCC_fatal_standalone(interp, 1, "main: No source file specified.\n");
- else
- determine_input_file_type(interp, sourcefile, yyscanner);
+ else {
+ FILE * const in_file = determine_input_file_type(interp, sourcefile);
+ if (!imc_yyin_set(in_file, yyscanner))
+ IMCC_fatal_standalone(interp, EXCEPTION_EXTERNAL_ERROR,
+ "Error reading source file %s.\n",
+ sourcefile);
+ }
if (STATE_PRE_PROCESS(interp)) {
do_pre_process(interp, yyscanner);
View
104 frontend/parrot/main.c
@@ -24,6 +24,14 @@ Start Parrot
#include "parrot/longopt.h"
#include "parrot/api.h"
+struct init_args_t {
+ const char *run_core_name;
+ const char *sourcefile;
+ Parrot_Int trace;
+ Parrot_Int execute_packfile;
+ Parrot_Int have_pbc_file;
+};
+
extern int Parrot_set_config_hash(Parrot_PMC interp_pmc);
/* HEADERIZER HFILE: none */
@@ -62,17 +70,14 @@ static const char * parseflags(
ARGIN(const char *argv[]),
ARGOUT(int *pgm_argc),
ARGOUT(const char ***pgm_argv),
- ARGMOD(const char **core),
- ARGMOD(Parrot_Int *trace))
+ ARGMOD(struct init_args_t * args))
__attribute__nonnull__(3)
__attribute__nonnull__(4)
__attribute__nonnull__(5)
__attribute__nonnull__(6)
- __attribute__nonnull__(7)
FUNC_MODIFIES(*pgm_argc)
FUNC_MODIFIES(*pgm_argv)
- FUNC_MODIFIES(*core)
- FUNC_MODIFIES(*trace);
+ FUNC_MODIFIES(* args);
static void parseflags_minimal(
ARGMOD(Parrot_Init_Args * initargs),
@@ -110,8 +115,7 @@ static void usage(ARGMOD(FILE *fp))
PARROT_ASSERT_ARG(argv) \
, PARROT_ASSERT_ARG(pgm_argc) \
, PARROT_ASSERT_ARG(pgm_argv) \
- , PARROT_ASSERT_ARG(core) \
- , PARROT_ASSERT_ARG(trace))
+ , PARROT_ASSERT_ARG(args))
#define ASSERT_ARGS_parseflags_minimal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(initargs) \
, PARROT_ASSERT_ARG(argv))
@@ -123,6 +127,8 @@ static void usage(ARGMOD(FILE *fp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+
+
/*
=item C<int main(int argc, const char *argv[])>
@@ -137,17 +143,14 @@ int
main(int argc, const char *argv[])
{
int stacktop;
- const char *sourcefile;
Parrot_PMC interp;
Parrot_PMC bytecodepmc;
Parrot_PMC argsarray;
int status;
int pir_argc;
const char **pir_argv;
- const char *core = "slow";
- int run_pbc = 0;
Parrot_Init_Args *initargs;
- Parrot_Int trace = 0;
+ struct init_args_t parsed_flags;
GET_INIT_STRUCT(initargs);
/* internationalization setup */
@@ -166,15 +169,23 @@ main(int argc, const char *argv[])
}
/* Parse flags */
- sourcefile = parseflags(interp, argc, argv, &pir_argc, &pir_argv, &core, &trace);
- if (!Parrot_api_set_runcore(interp, core, trace))
+ parseflags(interp, argc, argv, &pir_argc, &pir_argv, &parsed_flags);
+ if (!Parrot_api_set_runcore(interp, parsed_flags.run_core_name, parsed_flags.trace))
show_last_error_and_exit(interp);
- if (!Parrot_api_wrap_imcc_hack(
- interp, sourcefile, argc, argv, &bytecodepmc, &run_pbc, imcc_run_api))
- show_last_error_and_exit(interp);
+ if (parsed_flags.have_pbc_file) {
+ if (!Parrot_api_load_bytecode_file(interp, parsed_flags.sourcefile,
+ &bytecodepmc))
+ show_last_error_and_exit(interp);
+ }
+ else {
+ if (!Parrot_api_wrap_imcc_hack(interp, parsed_flags.sourcefile, argc, argv,
+ &bytecodepmc, &parsed_flags.execute_packfile,
+ imcc_run_api))
+ show_last_error_and_exit(interp);
+ }
- if (run_pbc) {
+ if (parsed_flags.execute_packfile) {
if (!Parrot_api_pmc_wrap_string_array(interp, pir_argc, pir_argv, &argsarray))
show_last_error_and_exit(interp);
if (!Parrot_api_run_bytecode(interp, bytecodepmc, argsarray))
@@ -436,6 +447,8 @@ Set up the const struct declaration for cmd_options
*/
+
+
/* TODO: Weed out the options that are not used by this executable */
PARROT_WARN_UNUSED_RESULT
@@ -460,14 +473,14 @@ Parrot_cmd_options(void)
{ 'X', 'X', OPTION_required_FLAG, { "--dynext" } },
{ '\0', OPT_DESTROY_FLAG, (OPTION_flags)0,
{ "--leak-test", "--destroy-at-end" } },
+ { 'o', 'o', OPTION_required_FLAG, { "--output" } },
+ { '\0', OPT_PBC_OUTPUT, (OPTION_flags)0, { "--output-pbc" } },
{ '\0', OPT_GC_DEBUG, (OPTION_flags)0, { "--gc-debug" } },
{ 'a', 'a', (OPTION_flags)0, { "--pasm" } },
{ 'c', 'c', (OPTION_flags)0, { "--pbc" } },
{ 'd', 'd', OPTION_optional_FLAG, { "--imcc-debug" } },
{ '\0', OPT_HELP_DEBUG, (OPTION_flags)0, { "--help-debug" } },
{ 'h', 'h', (OPTION_flags)0, { "--help" } },
- { 'o', 'o', OPTION_required_FLAG, { "--output" } },
- { '\0', OPT_PBC_OUTPUT, (OPTION_flags)0, { "--output-pbc" } },
{ 'r', 'r', (OPTION_flags)0, { "--run-pbc" } },
{ '\0', OPT_RUNTIME_PREFIX, (OPTION_flags)0, { "--runtime-prefix" } },
{ 't', 't', OPTION_optional_FLAG, { "--trace" } },
@@ -603,8 +616,7 @@ parseflags_minimal(ARGMOD(Parrot_Init_Args * initargs), int argc, ARGIN(const ch
/*
=item C<static const char * parseflags(Parrot_PMC interp, int argc, const char
-*argv[], int *pgm_argc, const char ***pgm_argv, const char **core, Parrot_Int
-*trace)>
+*argv[], int *pgm_argc, const char ***pgm_argv, struct init_args_t * args)>
Parse Parrot's command line for options and set appropriate flags.
@@ -614,15 +626,18 @@ Parse Parrot's command line for options and set appropriate flags.
PARROT_CAN_RETURN_NULL
static const char *
-parseflags(Parrot_PMC interp,
- int argc, ARGIN(const char *argv[]),
+parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
ARGOUT(int *pgm_argc), ARGOUT(const char ***pgm_argv),
- ARGMOD(const char **core), ARGMOD(Parrot_Int *trace))
+ ARGMOD(struct init_args_t * args))
{
ASSERT_ARGS(parseflags)
struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
int status;
int result = 1;
+ args->run_core_name = "slow";
+ args->execute_packfile = 1;
+ args->have_pbc_file = 0;
+ args->trace = 0;
if (argc == 1) {
usage(stderr);
@@ -632,7 +647,7 @@ parseflags(Parrot_PMC interp,
while ((status = longopt_get(argc, argv, Parrot_cmd_options(), &opt)) > 0) {
switch (opt.opt_id) {
case 'R':
- *core = opt.opt_arg;
+ args->run_core_name = opt.opt_arg;
break;
case 'g':
/* Handled in parseflags_minimal */
@@ -645,18 +660,18 @@ parseflags(Parrot_PMC interp,
const unsigned long _temp = strtoul(opt.opt_arg, NULL, 16);
/* const Parrot_trace_flags _temp_flag = (Parrot_trace_flags)_temp; */
const Parrot_Int _temp_flag = _temp;
- *trace = _temp_flag;
+ args->trace = _temp_flag;
}
else
- *trace = 0x01;
+ args->trace = 0x01;
/* *trace = PARROT_TRACE_OPS_FLAG; */
break;
case 'D':
if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
- Parrot_api_debug_flag(interp, strtoul(opt.opt_arg, NULL, 16), 1);
+ result = Parrot_api_debug_flag(interp, strtoul(opt.opt_arg, NULL, 16), 1);
else
/* Parrot_api_debug_flag(interp, PARROT_MEM_STAT_DEBUG_FLAG, 1); */
- Parrot_api_debug_flag(interp, 0x01, 1);
+ result = Parrot_api_debug_flag(interp, 0x01, 1);
break;
case '.': /* Give Windows Parrot hackers an opportunity to
@@ -681,11 +696,25 @@ parseflags(Parrot_PMC interp,
Parrot_api_get_runtime_path(interp, &runtimepath);
Parrot_api_string_export_ascii(interp, runtimepath, &runtimepath_c);
fprintf(stdout, "%s", runtimepath_c);
+ Parrot_api_string_free_exported_ascii(interp, runtimepath_c);
exit(EXIT_SUCCESS);
}
case 'V':
Parrot_version();
break;
+ case 'o':
+ args->execute_packfile = 0;
+ /* IMCC is going to read this option too, and handle it. */
+ /* TODO: Move this logic out of IMCC. IMCC should return a
+ packfile and we can write it out to a file ourselves. */
+ break;
+ case 'r':
+ args->execute_packfile = 1;
+ /* TODO: What else do we need to do for -r? We need to write the
+ packfile out to a file first, then open and execute it? */
+ break;
+ case 'c':
+ args->have_pbc_file = 1;
case OPT_GC_DEBUG:
/*
@@ -697,11 +726,11 @@ parseflags(Parrot_PMC interp,
#endif
*/
/* Parrot_api_flag(interp, PARROT_GC_DEBUG_FLAG, 1); */
- Parrot_api_flag(interp, 0x10, 1);
+ result = Parrot_api_flag(interp, 0x10, 1);
break;
case OPT_DESTROY_FLAG:
/* Parrot_api_flag(interp, PARROT_DESTROY_FLAG, 1); */
- Parrot_api_flag(interp, 0x200, 1);
+ result = Parrot_api_flag(interp, 0x200, 1);
break;
case 'I':
result = Parrot_api_add_include_search_path(interp, opt.opt_arg);
@@ -716,12 +745,6 @@ parseflags(Parrot_PMC interp,
/* result = Parrot_api_set_warnings(interp, PARROT_WARNINGS_ALL_FLAG); */
result = Parrot_api_set_warnings(interp, 0xFFFF);
break;
- case 'o':
- result = Parrot_api_set_output_file(interp, opt.opt_arg);
- break;
- case OPT_PBC_OUTPUT:
- result = Parrot_api_set_output_file(interp, NULL);
- break;
default:
/* languages handle their arguments later (after being initialized) */
break;
@@ -750,7 +773,12 @@ parseflags(Parrot_PMC interp,
*pgm_argc = argc - opt.opt_index;
*pgm_argv = argv + opt.opt_index;
- return (*pgm_argv)[0];
+ args->sourcefile = (*pgm_argv)[0];
+ {
+ const char * ext = strrchr(args->sourcefile, '.');
+ if (ext && !strcmp(ext, ".pbc"))
+ args->have_pbc_file = 1;
+ }
}
/*
View
9 include/parrot/api.h
@@ -215,11 +215,6 @@ Parrot_Int Parrot_api_set_executable_name(
__attribute__nonnull__(2);
PARROT_API
-Parrot_Int Parrot_api_set_output_file(
- Parrot_PMC interp_pmc,
- ARGIN_NULLOK(const char * filename));
-
-PARROT_API
Parrot_Int Parrot_api_set_runcore(
Parrot_PMC interp_pmc,
ARGIN(const char * corename),
@@ -294,7 +289,6 @@ Parrot_Int Parrot_api_wrap_imcc_hack(
#define ASSERT_ARGS_Parrot_api_set_executable_name \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(name))
-#define ASSERT_ARGS_Parrot_api_set_output_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_api_set_runcore __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(corename))
#define ASSERT_ARGS_Parrot_api_set_warnings __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
@@ -737,8 +731,7 @@ Parrot_Int Parrot_api_pmc_wrap_string_array(
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/embed/pmc.c */
-/* Forward declaration because IMCC is still part of libparrot, but we don't
- want to include parrot/imcc.h */
+/* Forward declaration because IMCC is still part of libparrot */
PARROT_API
int
View
17 include/parrot/imcc.h
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2007-2010, Parrot Foundation.
- */
-
-#ifndef PARROT_IMCC_H_GUARD
-#define PARROT_IMCC_H_GUARD
-
-PARROT_EXPORT int imcc_run(PARROT_INTERP, const char *sourcefile, int argc, const char **argv, ARGOUT(PMC **pbcpmc));
-
-#endif /* PARROT_IMCC_H_GUARD */
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
- */
View
2 include/parrot/interpreter.h
@@ -207,8 +207,6 @@ struct parrot_interp_t {
struct _imc_info_t *imc_info; /* imcc data */
Hash *op_hash; /* mapping from op names to op_info_t */
- const char *output_file; /* where to write output */
-
PDB_t *pdb; /* debug /trace system */
PMC *dynamic_env; /* Dynamic environment stack */
View
28 src/embed/api.c
@@ -317,7 +317,7 @@ returns a true value if this call is successful and false value otherwise.
*/
/* TODO: This only works with the inital bytecode. After this we should use
- Parrot_append_bytecode or something similar */
+ Parrot_append_bytecode or something similar */
PARROT_API
Parrot_Int
@@ -552,32 +552,6 @@ Parrot_api_set_warnings(Parrot_PMC interp_pmc, Parrot_Int flags)
/*
-=item C<Parrot_Int Parrot_api_set_output_file(Parrot_PMC interp_pmc, const char
-* filename)>
-
-Sets the C<interp_pmc>'s output file name specified by C<filename>. This function
-returns a true value if this call is successful and false value otherwise.
-
-=cut
-
-*/
-
-PARROT_API
-Parrot_Int
-Parrot_api_set_output_file(Parrot_PMC interp_pmc,
- ARGIN_NULLOK(const char * filename))
-{
- ASSERT_ARGS(Parrot_api_set_output_file)
- EMBED_API_CALLIN(interp_pmc, interp)
- if (!filename && !interp->output_file)
- interp->output_file = "-";
- else
- interp->output_file = filename;
- EMBED_API_CALLOUT(interp_pmc, interp)
-}
-
-/*
-
=item C<Parrot_Int Parrot_api_add_library_search_path(Parrot_PMC interp_pmc,
const char *path)>

0 comments on commit 29c4a7f

Please sign in to comment.