Skip to content

Commit 69a8b4d

Browse files
committed
Rename src/rustc to src/librustc. Use the driver crate
1 parent f72ef31 commit 69a8b4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+28
-36
lines changed

Makefile.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,15 @@ STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \
216216
# rustc crate variables
217217
######################################################################
218218

219-
COMPILER_CRATE := $(S)src/rustc/rustc.rc
220-
COMPILER_INPUTS := $(filter-out $(S)src/rustc/driver/rustc.rs, \
221-
$(wildcard $(addprefix $(S)src/rustc/, \
222-
rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs)))
219+
COMPILER_CRATE := $(S)src/librustc/rustc.rc
220+
COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/librustc/, \
221+
rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs))
223222

224223
LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rc
225224
LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
226225
syntax.rc *.rs */*.rs */*/*.rs))
227226

228-
RUSTC_INPUTS := $(S)src/rustc/driver/rustc.rs
227+
DRIVER_CRATE := $(S)src/driver/driver.rs
229228

230229
######################################################################
231230
# LLVM macros

mk/target.mk

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM): \
2424
@$$(call E, cp: $$@)
2525
$$(Q)cp $$< $$@
2626

27-
$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
28-
$$(RUSTC_INPUTS) \
29-
$$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
30-
@$$(call E, compile_and_link: $$@)
31-
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$<
32-
ifdef CFG_ENABLE_PAX_FLAGS
33-
@$$(call E, apply PaX flags: $$@)
34-
@"$(CFG_PAXCTL)" -cm "$$@"
35-
endif
36-
3727
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
3828
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
3929
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX)
4030
@$$(call E, compile_and_link: $$@)
4131
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
4232

33+
$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
34+
$$(DRIVER_CRATE) \
35+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
36+
@$$(call E, compile_and_link: $$@)
37+
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$<
38+
ifdef CFG_ENABLE_PAX_FLAGS
39+
@$$(call E, apply PaX flags: $$@)
40+
@"$(CFG_PAXCTL)" -cm "$$@"
41+
endif
42+
4343
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX): \
4444
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
4545
$$(TSREQ$(1)_T_$(2)_H_$(3)) \

mk/tools.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Rules for non-core tools built with the compiler, both for target
22
# and host architectures
33

4-
TOOL_DRIVER := $(S)src/driver/driver.rs
5-
64
FUZZER_LIB := $(S)src/libfuzzer/fuzzer.rc
75
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/libfuzzer/, *.rs))
86

@@ -36,7 +34,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER): \
3634
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
3735

3836
$$(TBIN$(1)_T_$(4)_H_$(3))/fuzzer$$(X): \
39-
$$(TOOL_DRIVER) \
37+
$$(DRIVER_CRATE) \
4038
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER)
4139
@$$(call E, compile_and_link: $$@)
4240
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg fuzzer -o $$@ $$<
@@ -82,7 +80,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO): \
8280
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
8381

8482
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X): \
85-
$$(TOOL_DRIVER) \
83+
$$(DRIVER_CRATE) \
8684
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO)
8785
@$$(call E, compile_and_link: $$@)
8886
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg cargo -o $$@ $$<
@@ -111,7 +109,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC): \
111109
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
112110

113111
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X): \
114-
$$(TOOL_DRIVER) \
112+
$$(DRIVER_CRATE) \
115113
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC)
116114
@$$(call E, compile_and_link: $$@)
117115
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustdoc -o $$@ $$<
@@ -140,7 +138,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI): \
140138
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
141139

142140
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X): \
143-
$$(TOOL_DRIVER) \
141+
$$(DRIVER_CRATE) \
144142
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI)
145143
@$$(call E, compile_and_link: $$@)
146144
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rusti -o $$@ $$<

src/driver/driver.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ extern mod self(name = "rustdoc", vers = "0.5");
1313
#[cfg(rusti)]
1414
extern mod self(name = "rusti", vers = "0.5");
1515

16+
#[cfg(rustc)]
17+
extern mod self(name = "rustc", vers = "0.5");
18+
1619
fn main() { self::main() }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/rustc/driver/rustc.rs renamed to src/librustc/rustc.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
#[no_core];
2-
#[allow(vecs_implicitly_copyable)];
3-
#[allow(non_camel_case_types)];
4-
#[legacy_modes];
5-
6-
extern mod core(vers = "0.5");
7-
extern mod std(vers = "0.5");
8-
extern mod rustc(vers = "0.5");
9-
extern mod syntax(vers = "0.5");
10-
11-
use core::*;
12-
131
// -*- rust -*-
142
use result::{Ok, Err};
153
use io::ReaderUtil;
164
use std::getopts;
175
use std::map::HashMap;
186
use getopts::{opt_present};
197
use getopts::groups;
20-
use rustc::driver::driver::*;
218
use syntax::codemap;
229
use syntax::diagnostic;
23-
use rustc::driver::session;
24-
use rustc::middle::lint;
10+
use driver::driver::{host_triple, optgroups, early_error,
11+
str_input, file_input, build_session_options,
12+
build_session, build_configuration, parse_pretty,
13+
pp_mode, pretty_print_input, list_metadata,
14+
compile_input};
15+
use driver::session;
16+
use middle::lint;
2517

2618
fn version(argv0: &str) {
2719
let mut vers = ~"unknown version";
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)