Fix C/gnu99/typeof.c: revert_automatic_type_conversion() was missing in the default...
[cparser] / main.c
diff --git a/main.c b/main.c
index c8b5878..36e2962 100644 (file)
--- a/main.c
+++ b/main.c
@@ -862,11 +862,7 @@ int main(int argc, char **argv)
                                char const *orig_opt;
                                GET_ARG_AFTER(orig_opt, "-f");
 
-                               if (strstart(orig_opt, "align-loops=") ||
-                                   strstart(orig_opt, "align-jumps=") ||
-                                   strstart(orig_opt, "align-functions=")) {
-                                       fprintf(stderr, "ignoring gcc option '-f%s'\n", orig_opt);
-                               } else if (strstart(orig_opt, "input-charset=")) {
+                               if (strstart(orig_opt, "input-charset=")) {
                                        char const* const encoding = strchr(orig_opt, '=') + 1;
                                        select_input_encoding(encoding);
                                } else if (streq(orig_opt, "verbose-asm")) {
@@ -896,14 +892,23 @@ int main(int argc, char **argv)
                                                mode = truth_value ? ParseOnly : CompileAssembleLink;
                                        } else if (streq(opt, "unsigned-char")) {
                                                char_is_signed = !truth_value;
+                                       } else if (truth_value == false &&
+                                                  streq(opt, "asynchronous-unwind-tables")) {
+                                           /* nothing todo, a gcc feature which we don't support
+                                            * anyway was deactivated */
+                                       } else if (strstart(orig_opt, "align-loops=") ||
+                                                       strstart(orig_opt, "align-jumps=") ||
+                                                       strstart(orig_opt, "align-functions=")) {
+                                               fprintf(stderr, "ignoring gcc option '-f%s'\n", orig_opt);
                                        } else if (streq(opt, "fast-math")               ||
                                                   streq(opt, "jump-tables")             ||
                                                   streq(opt, "expensive-optimizations") ||
                                                   streq(opt, "common")                  ||
-                                                  streq(opt, "PIC")                     ||
+                                                  streq(opt, "optimize-sibling-calls")  ||
                                                   streq(opt, "align-loops")             ||
                                                   streq(opt, "align-jumps")             ||
-                                                  streq(opt, "align-functions")) {
+                                                  streq(opt, "align-functions")         ||
+                                                  streq(opt, "PIC")) {
                                                fprintf(stderr, "ignoring gcc option '-f%s'\n", orig_opt);
                                        } else {
                                                int res = firm_option(orig_opt);
@@ -931,7 +936,9 @@ int main(int argc, char **argv)
                                        strncpy(cpu_arch, opt, sizeof(cpu_arch));
                                }
                        } else if (option[0] == 'W') {
-                               if (strstart(option + 1, "p,")) {
+                               if (option[1] == '\0') {
+                                       /* ignore -W, out defaults are already quiet verbose */
+                               } else if (strstart(option + 1, "p,")) {
                                        // pass options directly to the preprocessor
                                        const char *opt;
                                        GET_ARG_AFTER(opt, "-Wp,");
@@ -1006,6 +1013,12 @@ int main(int argc, char **argv)
                                        set_be_option("omitleaffp=0");
                                } else if (streq(opt, "rtd")) {
                                        default_calling_convention = CC_STDCALL;
+                               } else if (strstart(opt, "regparm=")) {
+                                       fprintf(stderr, "error: regparm convention not supported yet\n");
+                                       argument_errors = true;
+                               } else if (streq(opt, "soft-float")) {
+                                       fprintf(stderr, "error: software floatingpoint not supported yet\n");
+                                       argument_errors = true;
                                } else {
                                        char *endptr;
                                        long int value = strtol(opt, &endptr, 10);
@@ -1261,6 +1274,7 @@ int main(int argc, char **argv)
        }
 
        file_list_entry_t *file;
+       bool               already_constructed_firm = false;
        for (file = files; file != NULL; file = file->next) {
                char        asm_tempfile[1024];
                const char *filename = file->name;
@@ -1423,7 +1437,11 @@ do_parsing:
                        ir_timer_t *t_construct = ir_timer_new();
                        timer_register(t_construct, "Frontend: Graph construction");
                        timer_push(t_construct);
+                       if (already_constructed_firm) {
+                               panic("compiling multiple files/translation units not possible");
+                       }
                        translation_unit_to_firm(unit);
+                       already_constructed_firm = true;
                        timer_pop(t_construct);
 
 graph_built: