Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
61edb0cc
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
61edb0cc
编写于
11月 27, 2014
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Separate the driver into its own crate that uses trans, typeck.
上级
93eb4333
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
100 addition
and
61 deletion
+100
-61
mk/crates.mk
mk/crates.mk
+10
-7
src/driver/driver.rs
src/driver/driver.rs
+1
-1
src/librustc_driver/driver.rs
src/librustc_driver/driver.rs
+15
-16
src/librustc_driver/lib.rs
src/librustc_driver/lib.rs
+48
-10
src/librustc_driver/mod.rs
src/librustc_driver/mod.rs
+10
-0
src/librustc_driver/pretty.rs
src/librustc_driver/pretty.rs
+12
-13
src/librustc_driver/test.rs
src/librustc_driver/test.rs
+0
-0
src/librustc_trans/lib.rs
src/librustc_trans/lib.rs
+0
-11
src/librustdoc/core.rs
src/librustdoc/core.rs
+1
-1
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+2
-1
src/librustdoc/test.rs
src/librustdoc/test.rs
+1
-1
未找到文件。
mk/crates.mk
浏览文件 @
61edb0cc
...
@@ -53,8 +53,8 @@ TARGET_CRATES := libc std flate arena term \
...
@@ -53,8 +53,8 @@ TARGET_CRATES := libc std flate arena term \
serialize
getopts
collections
test time
rand
\
serialize
getopts
collections
test time
rand
\
log regex graphviz core rbml alloc rustrt
\
log regex graphviz core rbml alloc rustrt
\
unicode
unicode
HOST_CRATES
:=
syntax rustc rustc_typeck rustc_trans rustdoc regex_macros fmt_macros
\
RUSTC_CRATES
:=
rustc rustc_typeck rustc_driver rustc_trans rustc_back rustc_llvm
rustc_llvm rustc_back
HOST_CRATES
:=
syntax
$(RUSTC_CRATES)
rustdoc regex_macros fmt_macros
CRATES
:=
$(TARGET_CRATES)
$(HOST_CRATES)
CRATES
:=
$(TARGET_CRATES)
$(HOST_CRATES)
TOOLS
:=
compiletest rustdoc rustc
TOOLS
:=
compiletest rustdoc rustc
...
@@ -67,14 +67,16 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
...
@@ -67,14 +67,16 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
native:rust_builtin native:backtrace
native:rust_builtin native:backtrace
DEPS_graphviz
:=
std
DEPS_graphviz
:=
std
DEPS_syntax
:=
std term serialize log fmt_macros arena libc
DEPS_syntax
:=
std term serialize log fmt_macros arena libc
DEPS_rustc_driver
:=
arena flate
getopts
graphviz libc rustc rustc_back
\
rustc_typeck log syntax serialize rustc_llvm rustc_trans
DEPS_rustc_trans
:=
arena flate
getopts
graphviz libc rustc rustc_back
\
DEPS_rustc_trans
:=
arena flate
getopts
graphviz libc rustc rustc_back
\
rustc_typeck
log syntax serialize rustc_llvm
log syntax serialize rustc_llvm
DEPS_rustc_typeck
:=
rustc syntax
DEPS_rustc_typeck
:=
rustc syntax
DEPS_rustc
:=
syntax flate arena serialize
getopts
rbml
\
DEPS_rustc
:=
syntax flate arena serialize
getopts
rbml
\
time
log graphviz rustc_llvm rustc_back
time
log graphviz rustc_llvm rustc_back
DEPS_rustc_llvm
:=
native:rustllvm libc std
DEPS_rustc_llvm
:=
native:rustllvm libc std
DEPS_rustc_back
:=
std syntax rustc_llvm flate log libc
DEPS_rustc_back
:=
std syntax rustc_llvm flate log libc
DEPS_rustdoc
:=
rustc rustc_
trans
native:hoedown serialize
getopts
\
DEPS_rustdoc
:=
rustc rustc_
driver
native:hoedown serialize
getopts
\
test time
test time
DEPS_flate
:=
std native:miniz
DEPS_flate
:=
std native:miniz
DEPS_arena
:=
std
DEPS_arena
:=
std
...
@@ -96,7 +98,7 @@ DEPS_fmt_macros = std
...
@@ -96,7 +98,7 @@ DEPS_fmt_macros = std
TOOL_DEPS_compiletest
:=
test getopts
TOOL_DEPS_compiletest
:=
test getopts
TOOL_DEPS_rustdoc
:=
rustdoc
TOOL_DEPS_rustdoc
:=
rustdoc
TOOL_DEPS_rustc
:=
rustc_
trans
TOOL_DEPS_rustc
:=
rustc_
driver
TOOL_SOURCE_compiletest
:=
$(S)
src/compiletest/compiletest.rs
TOOL_SOURCE_compiletest
:=
$(S)
src/compiletest/compiletest.rs
TOOL_SOURCE_rustdoc
:=
$(S)
src/driver/driver.rs
TOOL_SOURCE_rustdoc
:=
$(S)
src/driver/driver.rs
TOOL_SOURCE_rustc
:=
$(S)
src/driver/driver.rs
TOOL_SOURCE_rustc
:=
$(S)
src/driver/driver.rs
...
@@ -115,8 +117,9 @@ ONLY_RLIB_unicode := 1
...
@@ -115,8 +117,9 @@ ONLY_RLIB_unicode := 1
DOC_CRATES
:=
$(
filter-out
rustc,
\
DOC_CRATES
:=
$(
filter-out
rustc,
\
$(
filter-out
rustc_trans,
\
$(
filter-out
rustc_trans,
\
$(
filter-out
rustc_typeck,
\
$(
filter-out
rustc_typeck,
\
$(
filter-out
syntax,
$(CRATES)
))))
$(
filter-out
rustc_driver,
\
COMPILER_DOC_CRATES
:=
rustc rustc_trans rustc_typeck syntax
$(
filter-out
syntax,
$(CRATES)
)))))
COMPILER_DOC_CRATES
:=
rustc rustc_trans rustc_typeck rustc_driver syntax
# This macro creates some simple definitions for each crate being built, just
# This macro creates some simple definitions for each crate being built, just
# some munging of all of the parameters above.
# some munging of all of the parameters above.
...
...
src/driver/driver.rs
浏览文件 @
61edb0cc
...
@@ -12,6 +12,6 @@
...
@@ -12,6 +12,6 @@
extern
crate
"rustdoc"
as
this
;
extern
crate
"rustdoc"
as
this
;
#[cfg(rustc)]
#[cfg(rustc)]
extern
crate
"rustc_
trans
"
as
this
;
extern
crate
"rustc_
driver
"
as
this
;
fn
main
()
{
this
::
main
()
}
fn
main
()
{
this
::
main
()
}
src/librustc_
trans/
driver/driver.rs
→
src/librustc_driver/driver.rs
浏览文件 @
61edb0cc
...
@@ -8,22 +8,22 @@
...
@@ -8,22 +8,22 @@
// option. This file may not be copied, modified, or distributed
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// except according to those terms.
use
back
::
link
;
use
rustc
::
session
::
Session
;
use
back
::
write
;
use
rustc
::
session
::
config
::{
mod
,
Input
,
OutputFilenames
};
use
session
::
Session
;
use
rustc
::
lint
;
use
session
::
config
::{
mod
,
Input
,
OutputFilenames
};
use
rustc
::
metadata
::
creader
;
use
lint
;
use
rustc
::
middle
::{
stability
,
ty
,
reachable
};
use
metadata
::
creader
;
use
rustc
::
middle
::
dependency_format
;
use
middle
::{
stability
,
ty
,
reachable
};
use
rustc
::
middle
;
use
middle
::
dependency_format
;
use
rustc
::
plugin
::
load
::
Plugins
;
use
middle
;
use
rustc
::
plugin
::
registry
::
Registry
;
use
plugin
::
load
::
Plugins
;
use
rustc
::
plugin
;
use
plugin
::
registry
::
Registry
;
use
rustc
::
util
::
common
::
time
;
use
plugin
;
use
rustc_trans
::
back
::
link
;
use
rustc_trans
::
back
::
write
;
use
rustc_trans
::
save
;
use
rustc_trans
::
trans
;
use
rustc_typeck
as
typeck
;
use
rustc_typeck
as
typeck
;
use
trans
;
use
util
::
common
::
time
;
use
serialize
::{
json
,
Encodable
};
use
serialize
::{
json
,
Encodable
};
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
use
std
::
io
::
fs
;
use
std
::
io
::
fs
;
use
std
::
os
;
use
std
::
os
;
use
arena
::
TypedArena
;
use
arena
::
TypedArena
;
use
save
;
use
syntax
::
ast
;
use
syntax
::
ast
;
use
syntax
::
ast_map
;
use
syntax
::
ast_map
;
use
syntax
::
attr
;
use
syntax
::
attr
;
...
...
src/librustc_
trans/driver/mod
.rs
→
src/librustc_
driver/lib
.rs
浏览文件 @
61edb0cc
// Copyright 201
2
The Rust Project Developers. See the COPYRIGHT
// Copyright 201
4
The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
// http://rust-lang.org/COPYRIGHT.
//
//
...
@@ -8,15 +8,46 @@
...
@@ -8,15 +8,46 @@
// option. This file may not be copied, modified, or distributed
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// except according to those terms.
pub
use
syntax
::
diagnostic
;
//! The Rust compiler.
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
#![crate_name
=
"rustc_driver"
]
#![experimental]
#![crate_type
=
"dylib"
]
#![crate_type
=
"rlib"
]
#![doc(html_logo_url
=
"http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png"
,
html_favicon_url
=
"http://www.rust-lang.org/favicon.ico"
,
html_root_url
=
"http://doc.rust-lang.org/nightly/"
)]
#![feature(default_type_params,
globs,
if_let,
import_shadowing,
macro_rules,
phase,
quote)]
#![feature(slicing_syntax,
unsafe_destructor)]
#![feature(rustc_diagnostic_macros)]
extern
crate
arena
;
extern
crate
flate
;
extern
crate
getopts
;
extern
crate
graphviz
;
extern
crate
libc
;
extern
crate
rustc
;
extern
crate
rustc_typeck
;
extern
crate
rustc_back
;
extern
crate
rustc_trans
;
#[phase(plugin,
link)]
extern
crate
log
;
#[phase(plugin,
link)]
extern
crate
syntax
;
extern
crate
serialize
;
extern
crate
"rustc_llvm"
as
llvm
;
use
back
::
link
;
pub
use
syntax
::
diagnostic
;
use
session
::{
config
,
Session
,
build_session
};
use
session
::
config
::
Input
;
use
lint
::
Lint
;
use
lint
;
use
metadata
;
use
rustc_trans
::
back
::
link
;
use
rustc
::
session
::{
config
,
Session
,
build_session
};
use
rustc
::
session
::
config
::
Input
;
use
rustc
::
lint
::
Lint
;
use
rustc
::
lint
;
use
rustc
::
metadata
;
use
rustc
::
DIAGNOSTICS
;
use
rustc
::
DIAGNOSTICS
;
use
std
::
any
::
AnyRefExt
;
use
std
::
any
::
AnyRefExt
;
...
@@ -24,14 +55,15 @@
...
@@ -24,14 +55,15 @@
use
std
::
os
;
use
std
::
os
;
use
std
::
task
::
TaskBuilder
;
use
std
::
task
::
TaskBuilder
;
use
session
::
early_error
;
use
rustc
::
session
::
early_error
;
use
syntax
::
ast
;
use
syntax
::
ast
;
use
syntax
::
parse
;
use
syntax
::
parse
;
use
syntax
::
diagnostic
::
Emitter
;
use
syntax
::
diagnostic
::
Emitter
;
use
syntax
::
diagnostics
;
use
syntax
::
diagnostics
;
use
getopts
;
#[cfg(test)]
pub
mod
test
;
pub
mod
driver
;
pub
mod
driver
;
pub
mod
pretty
;
pub
mod
pretty
;
...
@@ -507,3 +539,9 @@ pub fn monitor(f: proc():Send) {
...
@@ -507,3 +539,9 @@ pub fn monitor(f: proc():Send) {
}
}
}
}
pub
fn
main
()
{
let
args
=
std
::
os
::
args
();
let
result
=
run
(
args
);
std
::
os
::
set_exit_status
(
result
);
}
src/librustc_driver/mod.rs
0 → 100644
浏览文件 @
61edb0cc
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
src/librustc_
trans/
driver/pretty.rs
→
src/librustc_driver/pretty.rs
浏览文件 @
61edb0cc
...
@@ -15,19 +15,18 @@
...
@@ -15,19 +15,18 @@
pub
use
self
::
PpMode
::
*
;
pub
use
self
::
PpMode
::
*
;
use
self
::
NodesMatchingUII
::
*
;
use
self
::
NodesMatchingUII
::
*
;
use
back
::
link
;
use
rustc_trans
::
back
::
link
;
use
session
::
Session
;
use
driver
;
use
session
::
config
::{
mod
,
Input
};
use
driver
::
driver
::{
mod
};
use
rustc
::
middle
::
ty
;
use
rustc
::
middle
::
borrowck
::{
mod
,
FnPartsWithCFG
};
use
middle
::
ty
;
use
rustc
::
middle
::
borrowck
::
graphviz
as
borrowck_dot
;
use
middle
::
borrowck
::{
mod
,
FnPartsWithCFG
};
use
rustc
::
middle
::
cfg
;
use
middle
::
borrowck
::
graphviz
as
borrowck_dot
;
use
rustc
::
middle
::
cfg
::
graphviz
::
LabelledCFG
;
use
middle
::
cfg
;
use
rustc
::
session
::
Session
;
use
middle
::
cfg
::
graphviz
::
LabelledCFG
;
use
rustc
::
session
::
config
::{
mod
,
Input
};
use
rustc
::
util
::
ppaux
;
use
util
::
ppaux
;
use
syntax
::
ast
;
use
syntax
::
ast
;
use
syntax
::
ast_map
::{
mod
,
blocks
,
NodePrinter
};
use
syntax
::
ast_map
::{
mod
,
blocks
,
NodePrinter
};
...
...
src/librustc_
trans
/test.rs
→
src/librustc_
driver
/test.rs
浏览文件 @
61edb0cc
文件已移动
src/librustc_trans/lib.rs
浏览文件 @
61edb0cc
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
extern
crate
graphviz
;
extern
crate
graphviz
;
extern
crate
libc
;
extern
crate
libc
;
extern
crate
rustc
;
extern
crate
rustc
;
extern
crate
rustc_typeck
;
extern
crate
rustc_back
;
extern
crate
rustc_back
;
#[phase(plugin,
link)]
extern
crate
log
;
#[phase(plugin,
link)]
extern
crate
log
;
#[phase(plugin,
link)]
extern
crate
syntax
;
#[phase(plugin,
link)]
extern
crate
syntax
;
...
@@ -66,17 +65,7 @@ pub mod back {
...
@@ -66,17 +65,7 @@ pub mod back {
pub
mod
trans
;
pub
mod
trans
;
pub
mod
save
;
pub
mod
save
;
pub
mod
driver
;
pub
mod
lib
{
pub
mod
lib
{
pub
use
llvm
;
pub
use
llvm
;
}
}
pub
fn
main
()
{
let
args
=
std
::
os
::
args
();
let
result
=
driver
::
run
(
args
);
std
::
os
::
set_exit_status
(
result
);
}
#[cfg(test)]
pub
mod
test
;
src/librustdoc/core.rs
浏览文件 @
61edb0cc
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
// except according to those terms.
// except according to those terms.
pub
use
self
::
MaybeTyped
::
*
;
pub
use
self
::
MaybeTyped
::
*
;
use
rustc_
trans
::
driver
::
driver
;
use
rustc_driver
::
driver
;
use
rustc
::
session
::{
mod
,
config
};
use
rustc
::
session
::{
mod
,
config
};
use
rustc
::
middle
::{
privacy
,
ty
};
use
rustc
::
middle
::{
privacy
,
ty
};
use
rustc
::
lint
;
use
rustc
::
lint
;
...
...
src/librustdoc/lib.rs
浏览文件 @
61edb0cc
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
extern
crate
libc
;
extern
crate
libc
;
extern
crate
rustc
;
extern
crate
rustc
;
extern
crate
rustc_trans
;
extern
crate
rustc_trans
;
extern
crate
rustc_driver
;
extern
crate
serialize
;
extern
crate
serialize
;
extern
crate
syntax
;
extern
crate
syntax
;
extern
crate
"test"
as
testing
;
extern
crate
"test"
as
testing
;
...
@@ -163,7 +164,7 @@ pub fn main_args(args: &[String]) -> int {
...
@@ -163,7 +164,7 @@ pub fn main_args(args: &[String]) -> int {
usage
(
args
[
0
]
.as_slice
());
usage
(
args
[
0
]
.as_slice
());
return
0
;
return
0
;
}
else
if
matches
.opt_present
(
"version"
)
{
}
else
if
matches
.opt_present
(
"version"
)
{
match
rustc_
trans
::
driver
::
version
(
"rustdoc"
,
&
matches
)
{
match
rustc_driver
::
version
(
"rustdoc"
,
&
matches
)
{
Some
(
err
)
=>
{
Some
(
err
)
=>
{
println!
(
"{}"
,
err
);
println!
(
"{}"
,
err
);
return
1
return
1
...
...
src/librustdoc/test.rs
浏览文件 @
61edb0cc
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
use
std
::
collections
::{
HashSet
,
HashMap
};
use
std
::
collections
::{
HashSet
,
HashMap
};
use
testing
;
use
testing
;
use
rustc
::
session
::{
mod
,
config
};
use
rustc
::
session
::{
mod
,
config
};
use
rustc_
trans
::
driver
::
driver
;
use
rustc_driver
::
driver
;
use
syntax
::
ast
;
use
syntax
::
ast
;
use
syntax
::
codemap
::{
CodeMap
,
dummy_spanned
};
use
syntax
::
codemap
::{
CodeMap
,
dummy_spanned
};
use
syntax
::
diagnostic
;
use
syntax
::
diagnostic
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录