Mercurial > hg > octave-nkf
changeset 16877:5482cd26311a
Rename enable_jit_compiler to jit_enable, enable_jit_debugging to debug_jit.
Rename command line option --debug-jit to --jit-debug.
* doc/interpreter/basics.txi: Rename command line option --jit-debug to --debug-jit.
* libinterp/interp-core/pt-jit.cc(Fenable_jit_debugging, Fenable_jit_compiler): Rename
functions and all references to new names.
*libinterp/octave.cc(octave_process_command_line): Update references to Fenable_jit_debugging.
Update long_opts struct and usage_string to refer to debug-jit rather than jit-debug.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 30 Jun 2013 15:16:06 -0700 |
parents | 9e0618443c2b |
children | 011119bf4868 |
files | doc/interpreter/basics.txi libinterp/interp-core/pt-jit.cc libinterp/octave.cc |
diffstat | 3 files changed, 40 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/basics.txi +++ b/doc/interpreter/basics.txi @@ -82,6 +82,10 @@ parser to print a lot of information about the commands it reads, and is probably only useful if you are actually trying to debug the parser. +@item --debug-jit +@cindex @code{--debug-jit} +Enable JIT compiler debugging and tracing. + @item --doc-cache-file @var{filename} @cindex @code{--doc-cache-file @var{filename}} Specify the name of the doc cache file to use. The value of @var{filename} @@ -152,10 +156,6 @@ remote shell command or inside an Emacs shell buffer. For another way to run Octave within Emacs, see @ref{Emacs Octave Support}. -@item --jit-debug -@cindex @code{--jit-debug} -Enable JIT compiler debugging and tracing. - @item --line-editing @cindex @code{--line-editing} Force readline use for command-line editing.
--- a/libinterp/interp-core/pt-jit.cc +++ b/libinterp/interp-core/pt-jit.cc @@ -40,9 +40,9 @@ #ifdef HAVE_LLVM -static bool Venable_jit_debugging = false; - -static bool Venable_jit_compiler = true; +static bool Vdebug_jit = false; + +static bool Vjit_enable = true; #include <llvm/Analysis/CallGraph.h> #include <llvm/Analysis/Passes.h> @@ -1944,7 +1944,7 @@ // Ideally, we should only disable JIT if there is a breakpoint in the code we // are about to run. However, we can't figure this out in O(1) time, so we // conservatively check for the existence of any breakpoints. - return Venable_jit_compiler && ! bp_table::have_breakpoints () + return Vjit_enable && ! bp_table::have_breakpoints () && ! Vdebug_on_interrupt && ! Vdebug_on_error; } @@ -1965,13 +1965,13 @@ void tree_jit::optimize (llvm::Function *fn) { - if (Venable_jit_debugging) + if (Vdebug_jit) llvm::verifyModule (*module); module_pass_manager->run (*module); pass_manager->run (*fn); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::string error; llvm::raw_fd_ostream fout ("test.bc", error, @@ -2000,7 +2000,7 @@ conv.get_variable_map ()); infer.infer (); - if (Venable_jit_debugging) + if (Vdebug_jit) { jit_block_list& blocks = infer.get_blocks (); blocks.label (); @@ -2021,7 +2021,7 @@ factory.constants (), fcn, argument_types); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- raw function "; std::cout << "--------------------\n"; @@ -2069,7 +2069,7 @@ llvm::Function *llvm_function = wrapper.to_llvm (); tjit.optimize (llvm_function); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- optimized and wrapped "; std::cout << "--------------------\n"; @@ -2085,7 +2085,7 @@ { argument_types.clear (); - if (Venable_jit_debugging) + if (Vdebug_jit) { if (e.known ()) std::cout << "jit fail: " << e.what () << std::endl; @@ -2223,7 +2223,7 @@ infer.infer (); - if (Venable_jit_debugging) + if (Vdebug_jit) { jit_block_list& blocks = infer.get_blocks (); blocks.label (); @@ -2242,7 +2242,7 @@ } catch (const jit_fail_exception& e) { - if (Venable_jit_debugging) + if (Vdebug_jit) { if (e.known ()) std::cout << "jit fail: " << e.what () << std::endl; @@ -2251,7 +2251,7 @@ if (llvm_function) { - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- llvm ir --------------------"; std::cout << *llvm_function << std::endl; @@ -2260,7 +2260,7 @@ tjit.optimize (llvm_function); - if (Venable_jit_debugging) + if (Vdebug_jit) { std::cout << "-------------------- optimized llvm ir " << "--------------------\n"; @@ -2282,45 +2282,45 @@ #endif -DEFUN (enable_jit_debugging, args, nargout, +DEFUN (debug_jit, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {@var{val} =} enable_jit_debugging ()\n\ -@deftypefnx {Built-in Function} {@var{old_val} =} enable_jit_debugging (@var{new_val})\n\ -@deftypefnx {Built-in Function} {} enable_jit_debugging (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} debug_jit ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} debug_jit (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} debug_jit (@var{new_val}, \"local\")\n\ Query or set the internal variable that determines whether\n\ debugging/tracing is enabled for Octave's JIT compiler.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{enable_jit_compiler}\n\ +@seealso{jit_enable}\n\ @end deftypefn") { #if defined (HAVE_LLVM) - return SET_INTERNAL_VARIABLE (enable_jit_debugging); + return SET_INTERNAL_VARIABLE (debug_jit); #else - warning ("enable_jit_debugging: JIT compiling not available in this version of Octave"); + warning ("debug_jit: JIT compiling not available in this version of Octave"); return octave_value (); #endif } -DEFUN (enable_jit_compiler, args, nargout, +DEFUN (jit_enable, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {@var{val} =} enable_jit_compiler ()\n\ -@deftypefnx {Built-in Function} {@var{old_val} =} enable_jit_compiler (@var{new_val})\n\ -@deftypefnx {Built-in Function} {} enable_jit_compiler (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} jit_enable ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} jit_enable (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} jit_enable (@var{new_val}, \"local\")\n\ Query or set the internal variable that enables Octave's JIT compiler.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{enable_jit_debugging}\n\ +@seealso{debug_jit}\n\ @end deftypefn") { #if defined (HAVE_LLVM) - return SET_INTERNAL_VARIABLE (enable_jit_compiler); + return SET_INTERNAL_VARIABLE (jit_enable); #else - warning ("enable_jit_compiler: JIT compiling not available in this version of Octave"); + warning ("jit_enable: JIT compiling not available in this version of Octave"); return octave_value (); #endif }
--- a/libinterp/octave.cc +++ b/libinterp/octave.cc @@ -155,11 +155,11 @@ // Usage message static const char *usage_string = - "octave [-HVWdfhiqvx] [--debug] [--doc-cache-file file]\n\ + "octave [-HVWdfhiqvx] [--debug] [--debug-jit] [--doc-cache-file file]\n\ [--echo-commands] [--eval CODE] [--exec-path path]\n\ [--force-gui] [--help] [--image-path path]\n\ [--info-file file] [--info-program prog] [--interactive]\n\ - [--jit-debug] [--line-editing] [--no-gui] [--no-history]\n\ + [--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\ [--norc] [-p path] [--path path] [--persist] [--silent]\n\ @@ -192,7 +192,7 @@ #define IMAGE_PATH_OPTION 6 #define INFO_FILE_OPTION 7 #define INFO_PROG_OPTION 8 -#define JIT_DEBUG_OPTION 9 +#define DEBUG_JIT_OPTION 9 #define LINE_EDITING_OPTION 10 #define NO_GUI_OPTION 11 #define NO_INIT_FILE_OPTION 12 @@ -207,6 +207,7 @@ { "braindead", no_argument, 0, TRADITIONAL_OPTION }, { "built-in-docstrings-file", required_argument, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION }, { "debug", no_argument, 0, 'd' }, + { "debug-jit", no_argument, 0, DEBUG_JIT_OPTION }, { "doc-cache-file", required_argument, 0, DOC_CACHE_FILE_OPTION }, { "echo-commands", no_argument, 0, 'x' }, { "eval", required_argument, 0, EVAL_OPTION }, @@ -217,7 +218,6 @@ { "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 }, { "line-editing", no_argument, 0, LINE_EDITING_OPTION }, { "no-gui", no_argument, 0, NO_GUI_OPTION }, { "no-history", no_argument, 0, 'H' }, @@ -524,6 +524,7 @@ \n\ --built-in-docstrings-file FILE Use docs for built-ins from FILE.\n\ --debug, -d Enter parser debugging mode.\n\ + --debug-jit Enable JIT compiler debugging/tracing.\n\ --doc-cache-file FILE Use doc cache file FILE.\n\ --echo-commands, -x Echo commands as they are executed.\n\ --eval CODE Evaluate CODE. Exit when done unless --persist.\n\ @@ -534,7 +535,6 @@ --info-file FILE Use top-level info file FILE.\n\ --info-program PROGRAM Use PROGRAM for reading info files.\n\ --interactive, -i Force interactive behavior.\n\ - --jit-debug Enable JIT compiler debugging/tracing.\n\ --line-editing Force readline use for command-line editing.\n\ --no-gui Disable the graphical user interface.\n\ --no-history, -H Don't save commands to the history list\n\ @@ -776,8 +776,8 @@ Finfo_program (octave_value (optarg)); break; - case JIT_DEBUG_OPTION: - Fenable_jit_debugging (octave_value (true)); + case DEBUG_JIT_OPTION: + Fdebug_jit (octave_value (true)); break; case LINE_EDITING_OPTION: @@ -797,7 +797,7 @@ break; case NO_JIT_COMPILER_OPTION: - Fenable_jit_compiler (octave_value (false)); + Fjit_enable (octave_value (false)); break; case NO_LINE_EDITING_OPTION: