Reorganise driver code.
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... fns easier to use by tools. This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
This commit is contained in:
parent
11571cd9c1
commit
37ca36783c
27 changed files with 1447 additions and 1377 deletions
|
@ -145,7 +145,7 @@ pub fn main_args(args: &[~str]) -> int {
|
|||
usage(args[0]);
|
||||
return 0;
|
||||
} else if matches.opt_present("version") {
|
||||
rustc::version(args[0]);
|
||||
rustc::driver::version(args[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue