diff options
| author | Andrea Corallo | 2019-07-06 09:27:45 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:33:49 +0100 |
| commit | 4992fba7c56a4e7de8af4e79305883b505a84da4 (patch) | |
| tree | ae0ec5ba4f1ac0e07e49f49719e2f9bfeea38bc3 /src/comp.c | |
| parent | 36c9295e41404f1f90a8500d46d79b0e2a53af1e (diff) | |
| download | emacs-4992fba7c56a4e7de8af4e79305883b505a84da4.tar.gz emacs-4992fba7c56a4e7de8af4e79305883b505a84da4.zip | |
rework COMP_DEBUG strategy
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/comp.c b/src/comp.c index eefe8db2e2c..0fadeaad11c 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -1931,23 +1931,22 @@ init_comp (int opt_level) | |||
| 1931 | 1931 | ||
| 1932 | if (COMP_DEBUG) | 1932 | if (COMP_DEBUG) |
| 1933 | { | 1933 | { |
| 1934 | logfile = fopen ("libgccjit.log", "w"); | ||
| 1935 | gcc_jit_context_set_logfile (comp.ctxt, | ||
| 1936 | logfile, | ||
| 1937 | 0, 0); | ||
| 1938 | gcc_jit_context_set_bool_option (comp.ctxt, | 1934 | gcc_jit_context_set_bool_option (comp.ctxt, |
| 1939 | GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES, | 1935 | GCC_JIT_BOOL_OPTION_DEBUGINFO, |
| 1940 | 1); | 1936 | 1); |
| 1941 | } | 1937 | } |
| 1942 | if (COMP_DEBUG > 1) | 1938 | if (COMP_DEBUG > 1) |
| 1943 | { | 1939 | { |
| 1940 | logfile = fopen ("libgccjit.log", "w"); | ||
| 1941 | gcc_jit_context_set_logfile (comp.ctxt, | ||
| 1942 | logfile, | ||
| 1943 | 0, 0); | ||
| 1944 | gcc_jit_context_set_bool_option (comp.ctxt, | 1944 | gcc_jit_context_set_bool_option (comp.ctxt, |
| 1945 | GCC_JIT_BOOL_OPTION_DEBUGINFO, | 1945 | GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES, |
| 1946 | 1); | 1946 | 1); |
| 1947 | gcc_jit_context_set_bool_option (comp.ctxt, | 1947 | gcc_jit_context_set_bool_option (comp.ctxt, |
| 1948 | GCC_JIT_BOOL_OPTION_DUMP_INITIAL_GIMPLE, | 1948 | GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING, |
| 1949 | 1); | 1949 | 1); |
| 1950 | |||
| 1951 | gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c"); | 1950 | gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c"); |
| 1952 | 1951 | ||
| 1953 | } | 1952 | } |
| @@ -2072,8 +2071,6 @@ init_comp (int opt_level) | |||
| 2072 | static void | 2071 | static void |
| 2073 | release_comp (void) | 2072 | release_comp (void) |
| 2074 | { | 2073 | { |
| 2075 | if (COMP_DEBUG) | ||
| 2076 | gcc_jit_context_dump_to_file (comp.ctxt, "gcc-ctxt-dump.c", 1); | ||
| 2077 | if (comp.ctxt) | 2074 | if (comp.ctxt) |
| 2078 | gcc_jit_context_release(comp.ctxt); | 2075 | gcc_jit_context_release(comp.ctxt); |
| 2079 | 2076 | ||
| @@ -3304,6 +3301,8 @@ compile_f (const char *lisp_f_name, const char *c_f_name, | |||
| 3304 | } | 3301 | } |
| 3305 | } | 3302 | } |
| 3306 | 3303 | ||
| 3304 | if (COMP_DEBUG) | ||
| 3305 | gcc_jit_context_dump_to_file (comp.ctxt, "gcc-ctxt-dump.c", 1); | ||
| 3307 | comp_res.gcc_res = gcc_jit_context_compile(comp.ctxt); | 3306 | comp_res.gcc_res = gcc_jit_context_compile(comp.ctxt); |
| 3308 | 3307 | ||
| 3309 | goto exit; | 3308 | goto exit; |
| @@ -3363,9 +3362,9 @@ emacs_native_compile (const char *lisp_f_name, const char *c_f_name, | |||
| 3363 | 3362 | ||
| 3364 | if (dump_asm) | 3363 | if (dump_asm) |
| 3365 | { | 3364 | { |
| 3366 | gcc_jit_context_compile_to_file(comp.ctxt, | 3365 | gcc_jit_context_compile_to_file (comp.ctxt, |
| 3367 | GCC_JIT_OUTPUT_KIND_ASSEMBLER, | 3366 | GCC_JIT_OUTPUT_KIND_ASSEMBLER, |
| 3368 | DISASS_FILE_NAME); | 3367 | DISASS_FILE_NAME); |
| 3369 | } | 3368 | } |
| 3370 | unblock_atimers (&oldset); | 3369 | unblock_atimers (&oldset); |
| 3371 | release_comp (); | 3370 | release_comp (); |