Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
104002be
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
104002be
编写于
2月 07, 2014
作者:
S
Seo Sanghyeon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Span debugger
上级
21b856d2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
0 deletion
+41
-0
src/librustc/driver/driver.rs
src/librustc/driver/driver.rs
+4
-0
src/librustc/driver/session.rs
src/librustc/driver/session.rs
+5
-0
src/librustc/front/show_span.rs
src/librustc/front/show_span.rs
+31
-0
src/librustc/lib.rs
src/librustc/lib.rs
+1
-0
未找到文件。
src/librustc/driver/driver.rs
浏览文件 @
104002be
...
...
@@ -518,6 +518,10 @@ pub fn compile_input(sess: Session, cfg: ast::CrateConfig, input: &Input,
let
(
outputs
,
trans
)
=
{
let
(
expanded_crate
,
ast_map
)
=
{
let
crate
=
phase_1_parse_input
(
sess
,
cfg
,
input
);
if
sess
.show_span
()
{
front
::
show_span
::
run
(
sess
,
&
crate
);
return
;
}
if
stop_after_phase_1
(
sess
)
{
return
;
}
let
loader
=
&
mut
Loader
::
new
(
sess
);
phase_2_configure_and_expand
(
sess
,
loader
,
crate
)
...
...
src/librustc/driver/session.rs
浏览文件 @
104002be
...
...
@@ -60,6 +60,7 @@ pub struct Config {
BORROWCK_STATS
,
NO_LANDING_PADS
,
DEBUG_LLVM
,
SHOW_SPAN
,
COUNT_TYPE_SIZES
,
META_STATS
,
NO_OPT
,
...
...
@@ -95,6 +96,7 @@ pub fn debugging_opts_map() -> ~[(&'static str, &'static str, u64)] {
(
"no-landing-pads"
,
"omit landing pads for unwinding"
,
NO_LANDING_PADS
),
(
"debug-llvm"
,
"enable debug output from LLVM"
,
DEBUG_LLVM
),
(
"show-span"
,
"show spans"
,
SHOW_SPAN
),
(
"count-type-sizes"
,
"count the sizes of aggregate types"
,
COUNT_TYPE_SIZES
),
(
"meta-stats"
,
"gather metadata statistics"
,
META_STATS
),
...
...
@@ -351,6 +353,9 @@ pub fn lto(&self) -> bool {
pub
fn
no_landing_pads
(
&
self
)
->
bool
{
self
.debugging_opt
(
NO_LANDING_PADS
)
}
pub
fn
show_span
(
&
self
)
->
bool
{
self
.debugging_opt
(
SHOW_SPAN
)
}
// DEPRECATED. This function results in a lot of allocations when they
// are not necessary.
...
...
src/librustc/front/show_span.rs
0 → 100644
浏览文件 @
104002be
// Copyright 2014 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.
use
syntax
::
ast
;
use
syntax
::
visit
;
use
syntax
::
visit
::
Visitor
;
use
driver
::
session
::
Session
;
struct
ShowSpanVisitor
{
sess
:
Session
}
impl
Visitor
<
()
>
for
ShowSpanVisitor
{
fn
visit_expr
(
&
mut
self
,
e
:
&
ast
::
Expr
,
_
:
())
{
self
.sess
.span_note
(
e
.span
,
"expression"
);
visit
::
walk_expr
(
self
,
e
,
());
}
}
pub
fn
run
(
sess
:
Session
,
crate
:
&
ast
::
Crate
)
{
let
mut
v
=
ShowSpanVisitor
{
sess
:
sess
};
visit
::
walk_crate
(
&
mut
v
,
crate
,
());
}
src/librustc/lib.rs
浏览文件 @
104002be
...
...
@@ -97,6 +97,7 @@ pub mod front {
pub
mod
std_inject
;
pub
mod
assign_node_ids_and_map
;
pub
mod
feature_gate
;
pub
mod
show_span
;
}
pub
mod
back
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录