don't unlink tmp file if debug flag is used
authorDavid Schleef <ds@schleef.org>
Tue, 13 Jul 2010 20:54:10 +0000 (13:54 -0700)
committerDavid Schleef <ds@schleef.org>
Tue, 13 Jul 2010 20:54:10 +0000 (13:54 -0700)
orc/orccodemem.c
orc/orccompiler.c
orc/orcprogram-sse.c
orc/orcprogram.h

index aef02dc..d56afcd 100644 (file)
@@ -44,7 +44,9 @@ orc_compiler_allocate_codemem (OrcCompiler *compiler)
       ORC_COMPILER_ERROR (compiler, "failed to create temp file");
       return;
     }
-    unlink (filename);
+    if (!_orc_compiler_flag_debug) {
+      unlink (filename);
+    }
     free (filename);
   }
 
index 1749b29..fd8ac58 100644 (file)
@@ -36,7 +36,8 @@ int orc_compiler_dup_temporary (OrcCompiler *compiler, int var, int j);
 void orc_compiler_check_sizes (OrcCompiler *compiler);
 
 static char **_orc_compiler_flag_list;
-static int _orc_compiler_flag_backup;
+int _orc_compiler_flag_backup;
+int _orc_compiler_flag_debug;
 
 void
 _orc_compiler_init (void)
@@ -49,6 +50,7 @@ _orc_compiler_init (void)
   }
 
   _orc_compiler_flag_backup = orc_compiler_flag_check ("backup");
+  _orc_compiler_flag_debug = orc_compiler_flag_check ("debug");
 }
 
 int
index 52d308e..e4d83f2 100644 (file)
@@ -48,7 +48,6 @@ static OrcTarget sse_target = {
   sse_get_flag_name
 };
 
-static int _orc_compiler_flag_debug;
 
 
 void
@@ -68,8 +67,6 @@ orc_sse_init (void)
   orc_target_register (&sse_target);
 
   orc_compiler_sse_register_rules (&sse_target);
-
-  _orc_compiler_flag_debug = orc_compiler_flag_check ("debug");
 }
 
 unsigned int
index 15b314b..5d00ba3 100644 (file)
@@ -605,6 +605,9 @@ extern int _orc_data_cache_size_level1;
 extern int _orc_data_cache_size_level2;
 extern int _orc_data_cache_size_level3;
 
+extern int _orc_compiler_flag_backup;
+extern int _orc_compiler_flag_debug;
+
 #endif
 
 #endif