File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Define the rustc API's that the metadata module has access to
2
+ // Over time we will reduce these dependencies and, once metadata has
3
+ // no dependencies on rustc it can move into its own crate.
4
+
5
+ mod middle {
6
+ import ast_map = middle_:: ast_map;
7
+ export ast_map;
8
+ import ty = middle_:: ty;
9
+ export ty;
10
+ import trans = middle_:: trans;
11
+ export trans;
12
+ import typeck = middle_:: typeck;
13
+ export typeck;
14
+ import last_use = middle_:: last_use;
15
+ export last_use;
16
+ import freevars = middle_:: freevars;
17
+ export freevars;
18
+ import resolve = middle_:: resolve;
19
+ export resolve;
20
+ }
21
+
22
+ mod front {
23
+ }
24
+
25
+ mod back {
26
+ }
27
+
28
+ mod driver {
29
+ import session = driver_:: session;
30
+ export session;
31
+ import diagnostic = rustsyntax:: diagnostic;
32
+ export diagnostic;
33
+ }
34
+
35
+ mod util {
36
+ import common = util_:: common;
37
+ export common;
38
+ import ppaux = util_:: ppaux;
39
+ export ppaux;
40
+ import filesearch = util_:: filesearch;
41
+ export filesearch;
42
+ }
43
+
44
+ mod lib {
45
+ import llvm = lib_:: llvm;
46
+ export llvm;
47
+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,18 @@ use rustsyntax(vers = "0.2");
17
17
18
18
import core:: * ;
19
19
20
+ /*
21
+ Alternate names for some modules.
22
+
23
+ I am using this to help extract metadata into its own crate. In metadata.rs
24
+ it redefines all these modules in order to gate access from metadata to the
25
+ rest of the compiler, then uses these to access the original implementation.
26
+ */
27
+ import util_ = util;
28
+ import lib_ = lib;
29
+ import driver_ = driver;
30
+ import middle_ = middle;
31
+
20
32
mod middle {
21
33
mod trans {
22
34
mod common;
You can’t perform that action at this time.
0 commit comments