#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include "parser.h"
#include "ast2firm.h"
#include "adt/error.h"
+#include "write_fluffy.h"
#ifndef PREPROCESSOR
#define PREPROCESSOR "cpp"
#define pclose(file) _pclose(file)
#endif /* _WIN32 */
-static int verbose;
+static int verbose;
+static bool do_dump;
static const ir_settings_if_conv_t *if_conv_info = NULL;
static const backend_params *be_params = NULL;
params.arch_op_settings = be_params->arch_op_settings;
if_conv_info = be_params->if_conv_info;
+ (void) if_conv_info; /* avoid unused warning */
+
/* intialize firm itself */
init_firm(¶ms);
dbg_init(NULL, NULL, dbg_snprint);
static void dump(ir_graph *irg, const char *suffix)
{
-#if 0
- dump_ir_block_graph(irg, suffix);
-#else
- (void)irg;
- (void)suffix;
-#endif
+ if(do_dump) {
+ dump_ir_block_graph(irg, suffix);
+ }
}
static void get_output_name(char *buf, size_t buflen, const char *inputname,
dump(irg, "-start");
}
+ lower_params_t params;
+
+ params.def_ptr_alignment = 4;
+ params.flags = LF_COMPOUND_RETURN | LF_RETURN_HIDDEN;
+ params.hidden_params = ADD_HIDDEN_ALWAYS_IN_FRONT;
+ params.find_pointer_type = NULL;
+ params.ret_compound_in_regs = NULL;
+ lower_calls_with_compounds(¶ms);
+
lower_highlevel();
for(int i = 0; i < n_irgs; ++i) {
ir_graph *const irg = get_irp_irg(i);
}
}
-void write_fluffy_decls(translation_unit_t *unit);
-
typedef enum compile_mode_t {
Compile,
CompileAssemble,
mode = PrintAst;
} else if(strcmp(arg, "--print-fluffy") == 0) {
mode = PrintFluffy;
+ } else if(strcmp(arg, "--dump") == 0) {
+ do_dump = true;
} else if(strcmp(arg, "-v") == 0) {
verbose = 1;
} else if(arg[0] == '-' && arg[1] == 'f') {