]> git.lizzy.rs Git - rust.git/commit
Reorganise driver code.
authorNick Cameron <ncameron@mozilla.com>
Tue, 6 May 2014 11:38:01 +0000 (23:38 +1200)
committerNick Cameron <ncameron@mozilla.com>
Sat, 10 May 2014 23:08:01 +0000 (11:08 +1200)
commit37ca36783c57ad8cce17f3b19fc1016202eb612c
tree1bac4c2657cceab4ccb8d0c217d2e71854e6d574
parent11571cd9c1cde63c3b46ca65e608b84647785ac8
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.
27 files changed:
src/librustc/back/arm.rs
src/librustc/back/link.rs
src/librustc/back/lto.rs
src/librustc/back/mips.rs
src/librustc/back/x86.rs
src/librustc/back/x86_64.rs
src/librustc/driver/config.rs [new file with mode: 0644]
src/librustc/driver/driver.rs
src/librustc/driver/mod.rs
src/librustc/driver/session.rs
src/librustc/front/std_inject.rs
src/librustc/lib.rs
src/librustc/metadata/creader.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/dependency_format.rs
src/librustc/middle/entry.rs
src/librustc/middle/reachable.rs
src/librustc/middle/trans/_match.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/context.rs
src/librustc/middle/trans/controlflow.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/typeck/mod.rs
src/librustdoc/core.rs
src/librustdoc/lib.rs
src/librustdoc/test.rs