Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
740f228b
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,发现更多精彩内容 >>
提交
740f228b
编写于
4月 21, 2020
作者:
D
Dylan MacKenzie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove `predecessors_for`
There is no `Arc::map` equivalent to `LockGuard::map`
上级
db9b05ae
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
5 addition
and
16 deletion
+5
-16
src/librustc_codegen_ssa/mir/mod.rs
src/librustc_codegen_ssa/mir/mod.rs
+1
-1
src/librustc_middle/mir/mod.rs
src/librustc_middle/mir/mod.rs
+1
-12
src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
+1
-1
src/librustc_mir/borrow_check/region_infer/values.rs
src/librustc_mir/borrow_check/region_infer/values.rs
+1
-1
src/librustc_mir/borrow_check/type_check/liveness/trace.rs
src/librustc_mir/borrow_check/type_check/liveness/trace.rs
+1
-1
未找到文件。
src/librustc_codegen_ssa/mir/mod.rs
浏览文件 @
740f228b
...
...
@@ -155,7 +155,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
let
cleanup_kinds
=
analyze
::
cleanup_kinds
(
&
mir
);
// Allocate a `Block` for every basic block, except
// the start block, if nothing loops back to it.
let
reentrant_start_block
=
!
mir
.predecessors
_for
(
mir
::
START_BLOCK
)
.is_empty
();
let
reentrant_start_block
=
!
mir
.predecessors
()[
mir
::
START_BLOCK
]
.is_empty
();
let
block_bxs
:
IndexVec
<
mir
::
BasicBlock
,
Bx
::
BasicBlock
>
=
mir
.basic_blocks
()
.indices
()
...
...
src/librustc_middle/mir/mod.rs
浏览文件 @
740f228b
...
...
@@ -23,14 +23,12 @@
use
rustc_data_structures
::
fx
::
FxHashSet
;
use
rustc_data_structures
::
graph
::
dominators
::{
dominators
,
Dominators
};
use
rustc_data_structures
::
graph
::{
self
,
GraphSuccessors
};
use
rustc_data_structures
::
sync
::
MappedLockGuard
;
use
rustc_index
::
bit_set
::
BitMatrix
;
use
rustc_index
::
vec
::{
Idx
,
IndexVec
};
use
rustc_macros
::
HashStable
;
use
rustc_serialize
::{
Decodable
,
Encodable
};
use
rustc_span
::
symbol
::
Symbol
;
use
rustc_span
::{
Span
,
DUMMY_SP
};
use
smallvec
::
SmallVec
;
use
std
::
borrow
::
Cow
;
use
std
::
fmt
::{
self
,
Debug
,
Display
,
Formatter
,
Write
};
use
std
::
ops
::{
Index
,
IndexMut
};
...
...
@@ -392,15 +390,6 @@ pub fn terminator_loc(&self, bb: BasicBlock) -> Location {
Location
{
block
:
bb
,
statement_index
:
self
[
bb
]
.statements
.len
()
}
}
#[inline]
pub
fn
predecessors_for
(
&
self
,
bb
:
BasicBlock
,
)
->
impl
std
::
ops
::
Deref
<
Target
=
SmallVec
<
[
BasicBlock
;
4
]
>>
+
'_
{
let
predecessors
=
self
.predecessor_cache
.compute
(
&
self
.basic_blocks
);
MappedLockGuard
::
map
(
predecessors
,
|
preds
|
&
mut
preds
[
bb
])
}
#[inline]
pub
fn
predecessors
(
&
self
)
->
impl
std
::
ops
::
Deref
<
Target
=
Predecessors
>
+
'_
{
self
.predecessor_cache
.compute
(
&
self
.basic_blocks
)
...
...
@@ -2676,7 +2665,7 @@ impl graph::GraphPredecessors<'graph> for Body<'tcx> {
impl
graph
::
WithPredecessors
for
Body
<
'tcx
>
{
#[inline]
fn
predecessors
(
&
self
,
node
:
Self
::
Node
)
->
<
Self
as
graph
::
GraphPredecessors
<
'_
>>
::
Iter
{
self
.predecessors
_for
(
node
)
.clone
()
.into_iter
()
self
.predecessors
()[
node
]
.clone
()
.into_iter
()
}
}
...
...
src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
浏览文件 @
740f228b
...
...
@@ -1268,7 +1268,7 @@ fn predecessor_locations(
location
:
Location
,
)
->
impl
Iterator
<
Item
=
Location
>
+
'a
{
if
location
.statement_index
==
0
{
let
predecessors
=
body
.predecessors
_for
(
location
.block
)
.to_vec
();
let
predecessors
=
body
.predecessors
()[
location
.block
]
.to_vec
();
Either
::
Left
(
predecessors
.into_iter
()
.map
(
move
|
bb
|
body
.terminator_loc
(
bb
)))
}
else
{
Either
::
Right
(
std
::
iter
::
once
(
Location
{
...
...
src/librustc_mir/borrow_check/region_infer/values.rs
浏览文件 @
740f228b
...
...
@@ -89,7 +89,7 @@ impl RegionValueElements {
// If this is a basic block head, then the predecessors are
// the terminators of other basic blocks
stack
.extend
(
body
.predecessors
_for
(
block
)
body
.predecessors
()[
block
]
.iter
()
.map
(|
&
pred_bb
|
body
.terminator_loc
(
pred_bb
))
.map
(|
pred_loc
|
self
.point_from_location
(
pred_loc
)),
...
...
src/librustc_mir/borrow_check/type_check/liveness/trace.rs
浏览文件 @
740f228b
...
...
@@ -303,7 +303,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
_for
(
block
)
.iter
()
{
for
&
pred_block
in
body
.predecessors
()[
block
]
.iter
()
{
debug!
(
"compute_drop_live_points_for_block: pred_block = {:?}"
,
pred_block
,);
// Check whether the variable is (at least partially)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录