aboutsummaryrefslogtreecommitdiff
path: root/src/comp/driver/session.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-05-04 16:53:42 -0700
committerGraydon Hoare <[email protected]>2011-05-04 16:59:21 -0700
commitcdb68224054eddddb0c1d2519f9c12b654a6ff8f (patch)
treecf2adf7393a984ca1a96c73eddb43270aba1cca2 /src/comp/driver/session.rs
parentAdd *.pyc to .gitignore (diff)
downloadrust-cdb68224054eddddb0c1d2519f9c12b654a6ff8f.tar.xz
rust-cdb68224054eddddb0c1d2519f9c12b654a6ff8f.zip
Add a structure for passing option flags around the compiler, put it in session, and use it.
Diffstat (limited to 'src/comp/driver/session.rs')
-rw-r--r--src/comp/driver/session.rs31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/comp/driver/session.rs b/src/comp/driver/session.rs
index 501b50b1..ec924f51 100644
--- a/src/comp/driver/session.rs
+++ b/src/comp/driver/session.rs
@@ -19,11 +19,21 @@ tag arch {
arch_arm;
}
-type cfg = rec(os os,
- arch arch,
- ty_mach int_type,
- ty_mach uint_type,
- ty_mach float_type);
+type config = rec(os os,
+ arch arch,
+ ty_mach int_type,
+ ty_mach uint_type,
+ ty_mach float_type);
+
+type options = rec(bool shared,
+ bool optimize,
+ bool debuginfo,
+ bool verify,
+ bool run_typestate,
+ bool save_temps,
+ bool time_passes,
+ middle.trans.output_type output_type,
+ vec[str] library_search_paths);
type crate_metadata = rec(str name,
vec[u8] data);
@@ -47,13 +57,18 @@ fn emit_diagnostic(span sp, str msg, str kind, u8 color, codemap.codemap cm) {
io.stdout().write_str(#fmt(" %s\n", msg));
}
-state obj session(ast.crate_num cnum, cfg targ,
+state obj session(ast.crate_num cnum,
+ @config targ_cfg, @options opts,
map.hashmap[int, crate_metadata] crates,
mutable vec[@ast.meta_item] metadata,
codemap.codemap cm) {
- fn get_targ_cfg() -> cfg {
- ret targ;
+ fn get_targ_cfg() -> @config {
+ ret targ_cfg;
+ }
+
+ fn get_opts() -> @options {
+ ret opts;
}
fn get_targ_crate_num() -> ast.crate_num {