diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-20 17:00:17 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-20 17:00:17 -0700 |
commit | a3a1d75a0fa8e5db8eee9b59285251b6368530ac (patch) | |
tree | 936266109645859ab2f2ecac0b4e5057c6987e1b /autoload.c | |
parent | 253d449a394e4e05999c09f0f0d6396c2d9f032b (diff) | |
download | txr-a3a1d75a0fa8e5db8eee9b59285251b6368530ac.tar.gz txr-a3a1d75a0fa8e5db8eee9b59285251b6368530ac.tar.bz2 txr-a3a1d75a0fa8e5db8eee9b59285251b6368530ac.zip |
compiler: compiler options mechanism.
Introducing a compiler options system, so we can
control diagnostics and such. We begin with
three options for diagnosing shadowing.
* autoload.c (compiler_set_entries): Register a
structure name compiler-opts, a with-compile-opts
function name, *compile-opts* variable name, and
slots shadow-fun, shadow-var and shadow-cross.
* stdlib/compiler.tl (compile-opts): New struct.
(%warning-syms%): New macro.
(*compile-opts*): New special variable.
(when-opt, with-compile-opts): New macros.
(opt-controlled-diag): New function.
(env extend-var): Call extend-var* method instead of
repeating code.
(env extend-var*): Implement shadow-var and shadow-cross
diagnostic options.
(env extend-fun): Implement shadow-fun and shadow-cross
diagnostic options.
Diffstat (limited to 'autoload.c')
-rw-r--r-- | autoload.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -652,19 +652,29 @@ static val compiler_set_entries(val fun) lit("compiler"), lit("*in-compilation-unit*"), nil }; + val sname[] = { + lit("compile-opts"), + nil + }; val name[] = { lit("compile-toplevel"), lit("compile"), lit("compile-file"), lit("compile-update-file"), lit("with-compilation-unit"), lit("dump-compiled-objects"), + lit("with-compile-opts"), nil }; val vname[] = { - lit("*opt-level*"), + lit("*opt-level*"), lit("*compile-opts*"), nil }; + val slname[] = { + lit("shadow-fun"), lit("shadow-var"), lit("shadow-cross"), nil + }; autoload_sys_set(al_struct, sys_name, fun); + autoload_set(al_struct, sname, fun); autoload_set(al_fun, name, fun); autoload_set(al_var, vname, fun); + autoload_set(al_slot, slname, fun); return nil; } |