error out when compiling multiple source files to firm graphs - this is not supported...
authorMatthias Braun <matze@braunis.de>
Tue, 6 Apr 2010 14:45:11 +0000 (14:45 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 6 Apr 2010 14:45:11 +0000 (14:45 +0000)
[r27349]

main.c

diff --git a/main.c b/main.c
index 93b4dbe..2d1cd9c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1273,6 +1273,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;
@@ -1435,7 +1436,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: