changeset 15479:3f447bcc8488

set Venable_jit_debugging and Venable_jit_compiler variables directly from command line options * octave.cc (octave_process_command_line): Call Fenable_jit_debugging and Fenable_jit_compiler directly. (octave_initialize_interpreter): Don't call bind_internal_variable to set Venable_jit_debugging and Venable_jit_compiler (no_jit_compiler_option, jit_debug_option): Delete unused static variables. * octave.cc, pt-jit.h, pt-jit.cc: Use jit_debugging consistently instead of mixing jit_debug and jit_debugging.
author John W. Eaton <jwe@octave.org>
date Wed, 03 Oct 2012 03:07:22 -0400
parents b1ff8c83e232
children c7d7d43f26bb
files libinterp/interp-core/pt-jit.cc libinterp/interp-core/pt-jit.h libinterp/octave.cc
diffstat 3 files changed, 22 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/interp-core/pt-jit.cc	Wed Oct 03 02:51:04 2012 -0400
+++ b/libinterp/interp-core/pt-jit.cc	Wed Oct 03 03:07:22 2012 -0400
@@ -34,7 +34,7 @@
 #include "symtab.h"
 #include "variables.h"
 
-bool Venable_jit_debug = false;
+bool Venable_jit_debugging = false;
 
 bool Venable_jit_compiler = true;
 
@@ -1865,13 +1865,13 @@
 void
 tree_jit::optimize (llvm::Function *fn)
 {
-  if (Venable_jit_debug)
+  if (Venable_jit_debugging)
     llvm::verifyModule (*module);
 
   module_pass_manager->run (*module);
   pass_manager->run (*fn);
 
-  if (Venable_jit_debug)
+  if (Venable_jit_debugging)
     {
       std::string error;
       llvm::raw_fd_ostream fout ("test.bc", error,
@@ -1900,7 +1900,7 @@
                        conv.get_variable_map ());
       infer.infer ();
 
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           jit_block_list& blocks = infer.get_blocks ();
           jit_block *entry_block = blocks.front ();
@@ -1922,7 +1922,7 @@
                                          factory.constants (), fcn,
                                          argument_types);
 
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           std::cout << "-------------------- raw function ";
           std::cout << "--------------------\n";
@@ -1970,7 +1970,7 @@
       llvm::Function *llvm_function = wrapper.to_llvm ();
       tjit.optimize (llvm_function);
 
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           std::cout << "-------------------- optimized and wrapped ";
           std::cout << "--------------------\n";
@@ -1986,7 +1986,7 @@
     {
       argument_types.clear ();
 
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           if (e.known ())
             std::cout << "jit fail: " << e.what () << std::endl;
@@ -2120,7 +2120,7 @@
 
       infer.infer ();
 
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           jit_block_list& blocks = infer.get_blocks ();
           jit_block *entry_block = blocks.front ();
@@ -2140,7 +2140,7 @@
     }
   catch (const jit_fail_exception& e)
     {
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           if (e.known ())
             std::cout << "jit fail: " << e.what () << std::endl;
@@ -2149,7 +2149,7 @@
 
   if (llvm_function)
     {
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           std::cout << "-------------------- llvm ir --------------------";
           std::cout << *llvm_function << std::endl;
@@ -2158,7 +2158,7 @@
 
       tjit.optimize (llvm_function);
 
-      if (Venable_jit_debug)
+      if (Venable_jit_debugging)
         {
           std::cout << "-------------------- optimized llvm ir "
                     << "--------------------\n";
@@ -2180,17 +2180,17 @@
 
 #endif
 
-DEFUN (enable_jit_debug, args, nargout,
+DEFUN (enable_jit_debugging, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} enable_jit_debug ()\n\
+@deftypefn {Built-in Function} {} enable_jit_debugging ()\n\
 Query or set the internal variable that determines whether\n\
 debugging/tracing is enabled for Octave's JIT compiler.\n\
 @end deftypefn")
 {
 #if defined (HAVE_LLVM)
-  return SET_INTERNAL_VARIABLE (enable_jit_debug);
+  return SET_INTERNAL_VARIABLE (enable_jit_debugging);
 #else
-  warning ("enable_jit_debug: JIT compiling not available in this version of Octave");
+  warning ("enable_jit_debugging: JIT compiling not available in this version of Octave");
   return octave_value ();
 #endif
 }
--- a/libinterp/interp-core/pt-jit.h	Wed Oct 03 02:51:04 2012 -0400
+++ b/libinterp/interp-core/pt-jit.h	Wed Oct 03 03:07:22 2012 -0400
@@ -441,7 +441,7 @@
 #endif
 
 // If TRUE, enable JIT compiler debugging/tracing.
-extern bool Venable_jit_debug;
+extern bool Venable_jit_debugging;
 
 // If TRUE, enable JIT compiler.
 extern bool Venable_jit_compiler;
--- a/libinterp/octave.cc	Wed Oct 03 02:51:04 2012 -0400
+++ b/libinterp/octave.cc	Wed Oct 03 03:07:22 2012 -0400
@@ -126,14 +126,6 @@
 // (--no-gui)
 static bool no_gui_option = false;
 
-// If TRUE, disable the JIT compiler.
-// (--no-jit-compiler)
-static bool no_jit_compiler_option = false;
-
-// If TRUE, enable JIT compiler debugging/tracing.
-// (--jit-debug)
-static bool jit_debug_option = false;
-
 // If TRUE, force readline command line editing.
 // (--line-editing)
 static bool forced_line_editing = false;
@@ -163,7 +155,7 @@
   "octave [-HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\
        [--exec-path path] [--force-gui] [--help] [--image-path path]\n\
        [--info-file file] [--info-program prog] [--interactive]\n\
-       [--jit-debug] [--line-editing] [--no-gui] [--no-history]\n\
+       [--jit-debugging] [--line-editing] [--no-gui] [--no-history]\n\
        [--no-init-file] [--no-init-path] [--no-jit-compiler]\n\
        [--no-line-editing] [--no-site-file] [--no-window-system]\n\
        [-p path] [--path path] [--silent] [--traditional]\n\
@@ -190,7 +182,7 @@
 #define IMAGE_PATH_OPTION 6
 #define INFO_FILE_OPTION 7
 #define INFO_PROG_OPTION 8
-#define JIT_DEBUG_OPTION 9
+#define JIT_DEBUGGING_OPTION 9
 #define LINE_EDITING_OPTION 10
 #define NO_GUI_OPTION 11
 #define NO_INIT_FILE_OPTION 12
@@ -216,7 +208,7 @@
   { "info-file",                required_argument, 0, INFO_FILE_OPTION },
   { "info-program",             required_argument, 0, INFO_PROG_OPTION },
   { "interactive",              no_argument,       0, 'i' },
-  { "jit-debug",                no_argument,       0, JIT_DEBUG_OPTION },
+  { "jit-debugging",            no_argument,       0, JIT_DEBUGGING_OPTION },
   { "line-editing",             no_argument,       0, LINE_EDITING_OPTION },
   { "no-gui",                   no_argument,       0, NO_GUI_OPTION },
   { "no-history",               no_argument,       0, 'H' },
@@ -802,8 +794,8 @@
             Vinfo_program = optarg;
           break;
 
-        case JIT_DEBUG_OPTION:
-          jit_debug_option = true;
+        case JIT_DEBUGGING_OPTION:
+          Fenable_jit_debugging (octave_value (true));
           break;
 
         case LINE_EDITING_OPTION:
@@ -823,7 +815,7 @@
           break;
 
         case NO_JIT_COMPILER_OPTION:
-          no_jit_compiler_option = true;
+          Fenable_jit_compiler (octave_value (false));
           break;
 
         case NO_LINE_EDITING_OPTION:
@@ -883,11 +875,6 @@
 
   octave_thread::init ();
 
-  // The order of these calls is important.  The call to
-  // install_builtins must come before the option settings are processed
-  // because some command line options override defaults by calling
-  // bind_internal_variable.
-
   init_signals ();
 
   sysdep_init ();
@@ -934,12 +921,6 @@
   if (no_window_system)
     display_info::no_window_system ();
 
-  if (jit_debug_option)
-    bind_internal_variable ("enable_jit_debugging", true);
-
-  if (no_jit_compiler_option)
-    bind_internal_variable ("enable_jit_compiler", false);
-
   // Make sure we clean up when we exit.  Also allow users to register
   // functions.  If we don't have atexit or on_exit, we're going to
   // leave some junk files around if we exit abnormally.