Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
39d9c1cb
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,发现更多精彩内容 >>
提交
39d9c1cb
编写于
7月 05, 2022
作者:
T
Tomasz Miąsko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move `predecessors` from Body to BasicBlocks
上级
2446b177
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
10 addition
and
16 deletion
+10
-16
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
+1
-1
compiler/rustc_borrowck/src/type_check/liveness/trace.rs
compiler/rustc_borrowck/src/type_check/liveness/trace.rs
+2
-2
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/mir/mod.rs
+1
-7
compiler/rustc_mir_dataflow/src/framework/direction.rs
compiler/rustc_mir_dataflow/src/framework/direction.rs
+1
-1
compiler/rustc_mir_transform/src/add_call_guards.rs
compiler/rustc_mir_transform/src/add_call_guards.rs
+1
-1
compiler/rustc_mir_transform/src/coverage/graph.rs
compiler/rustc_mir_transform/src/coverage/graph.rs
+1
-1
compiler/rustc_mir_transform/src/nrvo.rs
compiler/rustc_mir_transform/src/nrvo.rs
+1
-1
compiler/rustc_mir_transform/src/separate_const_switch.rs
compiler/rustc_mir_transform/src/separate_const_switch.rs
+1
-1
src/tools/clippy/clippy_lints/src/redundant_clone.rs
src/tools/clippy/clippy_lints/src/redundant_clone.rs
+1
-1
未找到文件。
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
浏览文件 @
39d9c1cb
...
...
@@ -1628,7 +1628,7 @@ fn predecessor_locations<'tcx, 'a>(
location
:
Location
,
)
->
impl
Iterator
<
Item
=
Location
>
+
Captures
<
'tcx
>
+
'a
{
if
location
.statement_index
==
0
{
let
predecessors
=
body
.predecessors
()[
location
.block
]
.to_vec
();
let
predecessors
=
body
.
basic_blocks
.
predecessors
()[
location
.block
]
.to_vec
();
Either
::
Left
(
predecessors
.into_iter
()
.map
(
move
|
bb
|
body
.terminator_loc
(
bb
)))
}
else
{
Either
::
Right
(
std
::
iter
::
once
(
Location
{
...
...
compiler/rustc_borrowck/src/type_check/liveness/trace.rs
浏览文件 @
39d9c1cb
...
...
@@ -258,7 +258,7 @@ fn compute_use_live_points_for(&mut self, local: Local) {
let
block
=
self
.cx.elements
.to_location
(
block_start
)
.block
;
self
.stack
.extend
(
self
.cx.body
.predecessors
()[
block
]
self
.cx.body.
basic_blocks
.
predecessors
()[
block
]
.iter
()
.map
(|
&
pred_bb
|
self
.cx.body
.terminator_loc
(
pred_bb
))
.map
(|
pred_loc
|
self
.cx.elements
.point_from_location
(
pred_loc
)),
...
...
@@ -354,7 +354,7 @@ fn compute_drop_live_points_for_block(&mut self, mpi: MovePathIndex, term_point:
}
let
body
=
self
.cx.body
;
for
&
pred_block
in
body
.predecessors
()[
block
]
.iter
()
{
for
&
pred_block
in
body
.
basic_blocks
.
predecessors
()[
block
]
.iter
()
{
debug!
(
"compute_drop_live_points_for_block: pred_block = {:?}"
,
pred_block
,);
// Check whether the variable is (at least partially)
...
...
compiler/rustc_middle/src/mir/mod.rs
浏览文件 @
39d9c1cb
...
...
@@ -41,7 +41,6 @@
use
std
::
ops
::{
ControlFlow
,
Index
,
IndexMut
};
use
std
::{
iter
,
mem
};
use
self
::
predecessors
::
Predecessors
;
pub
use
self
::
query
::
*
;
use
self
::
switch_sources
::
SwitchSources
;
pub
use
basic_blocks
::
BasicBlocks
;
...
...
@@ -449,11 +448,6 @@ pub fn stmt_at(&self, location: Location) -> Either<&Statement<'tcx>, &Terminato
.unwrap_or_else
(||
Either
::
Right
(
block_data
.terminator
()))
}
#[inline]
pub
fn
predecessors
(
&
self
)
->
&
Predecessors
{
self
.basic_blocks
.predecessors
()
}
/// `body.switch_sources()[&(target, switch)]` returns a list of switch
/// values that lead to a `target` block from a `switch` block.
#[inline]
...
...
@@ -2837,7 +2831,7 @@ pub fn is_predecessor_of<'tcx>(&self, other: Location, body: &Body<'tcx>) -> boo
return
true
;
}
let
predecessors
=
body
.predecessors
();
let
predecessors
=
body
.
basic_blocks
.
predecessors
();
// If we're in another block, then we want to check that block is a predecessor of `other`.
let
mut
queue
:
Vec
<
BasicBlock
>
=
predecessors
[
other
.block
]
.to_vec
();
...
...
compiler/rustc_mir_dataflow/src/framework/direction.rs
浏览文件 @
39d9c1cb
...
...
@@ -228,7 +228,7 @@ fn join_state_into_successors_of<'tcx, A>(
)
where
A
:
Analysis
<
'tcx
>
,
{
for
pred
in
body
.predecessors
()[
bb
]
.iter
()
.copied
()
{
for
pred
in
body
.
basic_blocks
.
predecessors
()[
bb
]
.iter
()
.copied
()
{
match
body
[
pred
]
.terminator
()
.kind
{
// Apply terminator-specific edge effects.
//
...
...
compiler/rustc_mir_transform/src/add_call_guards.rs
浏览文件 @
39d9c1cb
...
...
@@ -39,7 +39,7 @@ fn run_pass(&self, _tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
impl
AddCallGuards
{
pub
fn
add_call_guards
(
&
self
,
body
:
&
mut
Body
<
'_
>
)
{
let
mut
pred_count
:
IndexVec
<
_
,
_
>
=
body
.predecessors
()
.iter
()
.map
(|
ps
|
ps
.len
())
.collect
();
body
.
basic_blocks
.
predecessors
()
.iter
()
.map
(|
ps
|
ps
.len
())
.collect
();
pred_count
[
START_BLOCK
]
+=
1
;
// We need a place to store the new blocks generated
...
...
compiler/rustc_mir_transform/src/coverage/graph.rs
浏览文件 @
39d9c1cb
...
...
@@ -95,7 +95,7 @@ fn compute_basic_coverage_blocks(
let
mut
basic_blocks
=
Vec
::
new
();
for
(
bb
,
data
)
in
mir_cfg_without_unwind
{
if
let
Some
(
last
)
=
basic_blocks
.last
()
{
let
predecessors
=
&
mir_body
.predecessors
()[
bb
];
let
predecessors
=
&
mir_body
.
basic_blocks
.
predecessors
()[
bb
];
if
predecessors
.len
()
>
1
||
!
predecessors
.contains
(
last
)
{
// The `bb` has more than one _incoming_ edge, and should start its own
// `BasicCoverageBlockData`. (Note, the `basic_blocks` vector does not yet
...
...
compiler/rustc_mir_transform/src/nrvo.rs
浏览文件 @
39d9c1cb
...
...
@@ -133,7 +133,7 @@ fn find_local_assigned_to_return_place(
return
local
;
}
match
body
.predecessors
()[
block
]
.as_slice
()
{
match
body
.
basic_blocks
.
predecessors
()[
block
]
.as_slice
()
{
&
[
pred
]
=>
block
=
pred
,
_
=>
return
None
,
}
...
...
compiler/rustc_mir_transform/src/separate_const_switch.rs
浏览文件 @
39d9c1cb
...
...
@@ -61,7 +61,7 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
/// Returns the amount of blocks that were duplicated
pub
fn
separate_const_switch
(
body
:
&
mut
Body
<
'_
>
)
->
usize
{
let
mut
new_blocks
:
SmallVec
<
[(
BasicBlock
,
BasicBlock
);
6
]
>
=
SmallVec
::
new
();
let
predecessors
=
body
.predecessors
();
let
predecessors
=
body
.
basic_blocks
.
predecessors
();
'block_iter
:
for
(
block_id
,
block
)
in
body
.basic_blocks
()
.iter_enumerated
()
{
if
let
TerminatorKind
::
SwitchInt
{
discr
:
Operand
::
Copy
(
switch_place
)
|
Operand
::
Move
(
switch_place
),
...
...
src/tools/clippy/clippy_lints/src/redundant_clone.rs
浏览文件 @
39d9c1cb
...
...
@@ -161,7 +161,7 @@ fn check_fn(
// `arg` is a reference as it is `.deref()`ed in the previous block.
// Look into the predecessor block and find out the source of deref.
let
ps
=
&
mir
.predecessors
()[
bb
];
let
ps
=
&
mir
.
basic_blocks
.
predecessors
()[
bb
];
if
ps
.len
()
!=
1
{
continue
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录