adapt to latest firm (no need to explicitely invoke switch lowerer, backend does...
[cparser] / main.c
diff --git a/main.c b/main.c
index 7e3f45e..5e3e769 100644 (file)
--- a/main.c
+++ b/main.c
 #endif
 #endif
 
-/** The current c mode/dialect. */
-unsigned int c_mode = _C89 | _ANSI | _C99 | _GNUC;
-
-/** The 'machine size', 16, 32 or 64 bit, 32bit is the default. */
-unsigned int machine_size = 32;
-
-/** true if the char type is signed. */
-bool char_is_signed = true;
-
-/** true for strict language checking. */
-bool strict_mode = false;
-
-/** use builtins for some libc functions */
-bool use_builtins = false;
-
-/** we have extern function with const attribute. */
-bool have_const_functions = false;
-
-atomic_type_kind_t wchar_atomic_kind = ATOMIC_TYPE_INT;
+unsigned int       c_mode                = _C89 | _ANSI | _C99 | _GNUC;
+unsigned int       machine_size          = 32;
+bool               byte_order_big_endian = false;
+bool               char_is_signed        = true;
+bool               strict_mode           = false;
+bool               use_builtins          = false;
+bool               have_const_functions  = false;
+atomic_type_kind_t wchar_atomic_kind     = ATOMIC_TYPE_INT;
 
 /* to switch on printing of implicit casts */
 extern bool print_implicit_casts;
@@ -888,6 +877,8 @@ int main(int argc, char **argv)
                                                        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, "message-length=")) {
+                                                       /* ignore: would only affect error message format */
                                        } else if (streq(opt, "fast-math")               ||
                                                   streq(opt, "jump-tables")             ||
                                                   streq(opt, "expensive-optimizations") ||
@@ -1134,14 +1125,9 @@ int main(int argc, char **argv)
                                                        streq(suffix, "o")   ? FILETYPE_OBJECT                 :
                                                        streq(suffix, "s")   ? FILETYPE_PREPROCESSED_ASSEMBLER :
                                                        streq(suffix, "so")  ? FILETYPE_OBJECT                 :
-                                                       FILETYPE_AUTODETECT;
+                                                       FILETYPE_OBJECT; /* gcc behavior: unknown file extension means object file */
                                        }
                                }
-
-                               if (type == FILETYPE_AUTODETECT) {
-                                       fprintf(stderr, "'%s': file format not recognized\n", arg);
-                                       continue;
-                               }
                        }
 
                        file_list_entry_t *entry
@@ -1185,6 +1171,7 @@ int main(int argc, char **argv)
        c_mode &= ~features_off;
 
        gen_firm_init();
+       byte_order_big_endian = be_get_backend_param()->byte_order_big_endian;
        init_symbol_table();
        init_types();
        init_typehash();