firm backend is not optional anymore
authorMatthias Braun <matze@braunis.de>
Fri, 28 May 2010 12:01:47 +0000 (12:01 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 28 May 2010 12:01:47 +0000 (12:01 +0000)
[r27602]

.build_plugin
Makefile
driver/firm_cmdline.c
driver/firm_cmdline.h
main.c

index 55cde41..f8128bd 100644 (file)
@@ -28,7 +28,7 @@ rule BuiltinGenerator {
 BuiltinGenerator gen_builtins.h : builtins/builtins.c : create_builtins_h.sh ;
 
 Application cparser : $(SOURCES) ;
-CppFlags cparser : -DFIRM_BACKEND -I$(top_srcdir)/libfirm/include ;
+CppFlags cparser : -I$(top_srcdir)/libfirm/include ;
 IncludeDir cparser : . ;
 CFlags cparser : -std=c99 ;
 LinkWith cparser : firm ;
index 2f20c40..80ec0bb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,7 @@ BUILDDIR ?= build
 FIRM_CFLAGS ?= `pkg-config --cflags libfirm`
 FIRM_LIBS   ?= `pkg-config --libs libfirm`
 
-CPPFLAGS  = -DHAVE_CONFIG_H -DFIRM_BACKEND
-CPPFLAGS += -I.
+CPPFLAGS  = -I.
 CPPFLAGS += $(FIRM_CFLAGS)
 
 CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes -std=c99 -pedantic
index 95ffa90..ccc5766 100644 (file)
@@ -169,9 +169,7 @@ static const struct params {
   { X("no-grs-create-pattern"),  &firm_ext_grs.create_pattern, 0, "firm: create patterns for simd optimization" },
 #endif
 
-#ifdef FIRM_BACKEND
   { X("be-firm"),                &firm_be_opt.selection,     BE_FIRM_BE, "backend: firm backend facility" },
-#endif /* FIRM_BACKEND */
 #ifdef FIRM2C_BACKEND
   { X("be-firm2c"),              &firm_be_opt.selection,     BE_FIRM2C, "backend: firm2C" },
 #endif /* FIRM2C_BACKEND */
@@ -285,8 +283,8 @@ int firm_option(const char *opt)
         if (firm_opt.debug_mode == DBG_MODE_FULL)
           disable_opts();
         res = 1;
-        res &= firm_be_option("omitfp=0");
-        res &= firm_be_option("stabs");
+        res &= be_parse_arg("omitfp=0");
+        res &= be_parse_arg("stabs");
         return res;
       }
       break;
@@ -303,20 +301,6 @@ int firm_option(const char *opt)
   return 0;
 }  /* firm_option */
 
-/**
- * Handles a firm backend option.
- *
- * The options are here only checked for validity and later transmitted
- * to the firm backend (in the hope they do not fail ...)
- */
-int firm_be_option(const char *opt) {
-#ifdef FIRM_BACKEND
-  return be_parse_arg(opt);
-#else
-  return 0;
-#endif /* FIRM_BACKEND */
-}  /* firm_be_option */
-
 /**
  * prints the firm version number
  */
index 20e9871..3011316 100644 (file)
@@ -123,10 +123,4 @@ void print_firm_version(FILE *f);
  */
 int firm_option(const char *opt);
 
-/**
- * called by the generic command line parser
- * to handle the --backend= or -b options
- */
-int firm_be_option(const char *opt);
-
-#endif /* FIRM_CMDLINE_H */
+#endif
diff --git a/main.c b/main.c
index 36e2962..2ca0828 100644 (file)
--- a/main.c
+++ b/main.c
@@ -585,7 +585,7 @@ static void print_cparser_version(void)
 
 static void set_be_option(const char *arg)
 {
-       int res = firm_be_option(arg);
+       int res = be_parse_arg(arg);
        (void) res;
        assert(res);
 }
@@ -925,7 +925,7 @@ int main(int argc, char **argv)
                        } else if (option[0] == 'b') {
                                const char *opt;
                                GET_ARG_AFTER(opt, "-b");
-                               int res = firm_be_option(opt);
+                               int res = be_parse_arg(opt);
                                if (res == 0) {
                                        fprintf(stderr, "error: unknown Firm backend option '-b %s'\n",
                                                opt);
@@ -963,26 +963,26 @@ int main(int argc, char **argv)
                                if (strstart(opt, "arch=")) {
                                        GET_ARG_AFTER(opt, "-march=");
                                        snprintf(arch_opt, sizeof(arch_opt), "%s-arch=%s", cpu_arch, opt);
-                                       int res = firm_be_option(arch_opt);
+                                       int res = be_parse_arg(arch_opt);
                                        if (res == 0) {
                                                fprintf(stderr, "Unknown architecture '%s'\n", arch_opt);
                                                argument_errors = true;
                                        } else {
                                                snprintf(arch_opt, sizeof(arch_opt), "%s-opt=%s", cpu_arch, opt);
-                                               int res = firm_be_option(arch_opt);
+                                               int res = be_parse_arg(arch_opt);
                                                if (res == 0)
                                                        argument_errors = true;
                                        }
                                } else if (strstart(opt, "tune=")) {
                                        GET_ARG_AFTER(opt, "-mtune=");
                                        snprintf(arch_opt, sizeof(arch_opt), "%s-opt=%s", cpu_arch, opt);
-                                       int res = firm_be_option(arch_opt);
+                                       int res = be_parse_arg(arch_opt);
                                        if (res == 0)
                                                argument_errors = true;
                                } else if (strstart(opt, "cpu=")) {
                                        GET_ARG_AFTER(opt, "-mcpu=");
                                        snprintf(arch_opt, sizeof(arch_opt), "%s-arch=%s", cpu_arch, opt);
-                                       int res = firm_be_option(arch_opt);
+                                       int res = be_parse_arg(arch_opt);
                                        if (res == 0)
                                                argument_errors = true;
                                } else if (strstart(opt, "fpmath=")) {
@@ -997,14 +997,14 @@ int main(int argc, char **argv)
                                        }
                                        if (!argument_errors) {
                                                snprintf(arch_opt, sizeof(arch_opt), "%s-fpunit=%s", cpu_arch, opt);
-                                               int res = firm_be_option(arch_opt);
+                                               int res = be_parse_arg(arch_opt);
                                                if (res == 0)
                                                        argument_errors = true;
                                        }
                                } else if (strstart(opt, "preferred-stack-boundary=")) {
                                        GET_ARG_AFTER(opt, "-mpreferred-stack-boundary=");
                                        snprintf(arch_opt, sizeof(arch_opt), "%s-stackalign=%s", cpu_arch, opt);
-                                       int res = firm_be_option(arch_opt);
+                                       int res = be_parse_arg(arch_opt);
                                        if (res == 0)
                                                argument_errors = true;
                                } else if (streq(opt, "omit-leaf-frame-pointer")) {