summaryrefslogtreecommitdiffstats
path: root/autoload.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-20 17:00:17 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-20 17:00:17 -0700
commita3a1d75a0fa8e5db8eee9b59285251b6368530ac (patch)
tree936266109645859ab2f2ecac0b4e5057c6987e1b /autoload.c
parent253d449a394e4e05999c09f0f0d6396c2d9f032b (diff)
downloadtxr-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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/autoload.c b/autoload.c
index 745df8e9..accead94 100644
--- a/autoload.c
+++ b/autoload.c
@@ -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;
}