diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-05-13 15:56:45 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-05-13 15:58:10 -0700 |
| commit | ecf290d448e1b46e073bd8727c04156a06948bf5 (patch) | |
| tree | 4ef3ba3be589c1ff9523b6b2845c9aa3a137d98b | |
| parent | a6b9fa0cd1a6eb29a127e05d10910d8b8f194f59 (diff) | |
| download | rust-ecf290d448e1b46e073bd8727c04156a06948bf5.tar.gz rust-ecf290d448e1b46e073bd8727c04156a06948bf5.zip | |
rustc: Be explicit about which peer modules the metadata mod can access
This is the first step in eliminating dependencies on rustc so we can extract the metadata code into its own crate.
| -rw-r--r-- | src/rustc/metadata.rs | 47 | ||||
| -rw-r--r-- | src/rustc/rustc.rc | 12 |
2 files changed, 59 insertions, 0 deletions
diff --git a/src/rustc/metadata.rs b/src/rustc/metadata.rs new file mode 100644 index 00000000000..2a789ff4ed2 --- /dev/null +++ b/src/rustc/metadata.rs @@ -0,0 +1,47 @@ +// Define the rustc API's that the metadata module has access to +// Over time we will reduce these dependencies and, once metadata has +// no dependencies on rustc it can move into its own crate. + +mod middle { + import ast_map = middle_::ast_map; + export ast_map; + import ty = middle_::ty; + export ty; + import trans = middle_::trans; + export trans; + import typeck = middle_::typeck; + export typeck; + import last_use = middle_::last_use; + export last_use; + import freevars = middle_::freevars; + export freevars; + import resolve = middle_::resolve; + export resolve; +} + +mod front { +} + +mod back { +} + +mod driver { + import session = driver_::session; + export session; + import diagnostic = rustsyntax::diagnostic; + export diagnostic; +} + +mod util { + import common = util_::common; + export common; + import ppaux = util_::ppaux; + export ppaux; + import filesearch = util_::filesearch; + export filesearch; +} + +mod lib { + import llvm = lib_::llvm; + export llvm; +} diff --git a/src/rustc/rustc.rc b/src/rustc/rustc.rc index cdfecad1b15..961b7c6c683 100644 --- a/src/rustc/rustc.rc +++ b/src/rustc/rustc.rc @@ -17,6 +17,18 @@ use rustsyntax(vers = "0.2"); import core::*; +/* +Alternate names for some modules. + +I am using this to help extract metadata into its own crate. In metadata.rs +it redefines all these modules in order to gate access from metadata to the +rest of the compiler, then uses these to access the original implementation. +*/ +import util_ = util; +import lib_ = lib; +import driver_ = driver; +import middle_ = middle; + mod middle { mod trans { mod common; |
