Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6bc7f419
R
Rust
项目概览
int
/
Rust
接近 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
6bc7f419
编写于
2月 26, 2018
作者:
W
Wesley Wiser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove the contains_extern_indicator query
Part of #47320
上级
5460b887
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
11 addition
and
16 deletion
+11
-16
src/librustc/dep_graph/dep_node.rs
src/librustc/dep_graph/dep_node.rs
+0
-1
src/librustc/hir/mod.rs
src/librustc/hir/mod.rs
+6
-0
src/librustc/middle/reachable.rs
src/librustc/middle/reachable.rs
+1
-1
src/librustc/ty/maps/config.rs
src/librustc/ty/maps/config.rs
+0
-1
src/librustc/ty/maps/mod.rs
src/librustc/ty/maps/mod.rs
+0
-1
src/librustc/ty/maps/on_disk_cache.rs
src/librustc/ty/maps/on_disk_cache.rs
+0
-1
src/librustc/ty/maps/plumbing.rs
src/librustc/ty/maps/plumbing.rs
+0
-4
src/librustc_trans/back/symbol_export.rs
src/librustc_trans/back/symbol_export.rs
+2
-1
src/librustc_trans_utils/symbol_names.rs
src/librustc_trans_utils/symbol_names.rs
+0
-5
src/librustc_trans_utils/trans_crate.rs
src/librustc_trans_utils/trans_crate.rs
+0
-1
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+2
-0
未找到文件。
src/librustc/dep_graph/dep_node.rs
浏览文件 @
6bc7f419
...
...
@@ -627,7 +627,6 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
[
input
]
AllCrateNums
,
[]
ExportedSymbols
(
CrateNum
),
[
eval_always
]
CollectAndPartitionTranslationItems
,
[]
ContainsExternIndicator
(
DefId
),
[]
IsTranslatedItem
(
DefId
),
[]
CodegenUnit
(
InternedString
),
[]
CompileCodegenUnit
(
InternedString
),
...
...
src/librustc/hir/mod.rs
浏览文件 @
6bc7f419
...
...
@@ -2227,6 +2227,7 @@ pub struct TransFnAttrFlags: u8 {
const
UNWIND
=
0b0000_0100
;
const
RUSTC_ALLOCATOR_NOUNWIND
=
0b0000_1000
;
const
NAKED
=
0b0001_0000
;
const
NO_MANGLE
=
0b0010_0000
;
}
}
...
...
@@ -2246,5 +2247,10 @@ pub fn requests_inline(&self) -> bool {
InlineAttr
::
None
|
InlineAttr
::
Never
=>
false
,
}
}
/// True if `#[no_mangle]` or `#[export_name(...)]` is present.
pub
fn
contains_extern_indicator
(
&
self
)
->
bool
{
self
.flags
.contains
(
TransFnAttrFlags
::
NO_MANGLE
)
||
self
.export_name
.is_some
()
}
}
src/librustc/middle/reachable.rs
浏览文件 @
6bc7f419
...
...
@@ -233,7 +233,7 @@ fn propagate_node(&mut self, node: &hir_map::Node<'tcx>,
false
};
let
def_id
=
self
.tcx.hir
.local_def_id
(
item
.id
);
let
is_extern
=
self
.tcx
.
contains_extern_indicator
(
def_id
);
let
is_extern
=
self
.tcx
.
trans_fn_attrs
(
def_id
)
.contains_extern_indicator
(
);
if
reachable
||
is_extern
{
self
.reachable_symbols
.insert
(
search_item
);
}
...
...
src/librustc/ty/maps/config.rs
浏览文件 @
6bc7f419
...
...
@@ -687,7 +687,6 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
impl_disk_cacheable_query!
(
mir_borrowck
,
|
def_id
|
def_id
.is_local
());
impl_disk_cacheable_query!
(
mir_const_qualif
,
|
def_id
|
def_id
.is_local
());
impl_disk_cacheable_query!
(
check_match
,
|
def_id
|
def_id
.is_local
());
impl_disk_cacheable_query!
(
contains_extern_indicator
,
|
_
|
true
);
impl_disk_cacheable_query!
(
def_symbol_name
,
|
_
|
true
);
impl_disk_cacheable_query!
(
type_of
,
|
def_id
|
def_id
.is_local
());
impl_disk_cacheable_query!
(
predicates_of
,
|
def_id
|
def_id
.is_local
());
...
...
src/librustc/ty/maps/mod.rs
浏览文件 @
6bc7f419
...
...
@@ -363,7 +363,6 @@
[]
fn
collect_and_partition_translation_items
:
collect_and_partition_translation_items_node
(
CrateNum
)
->
(
Arc
<
DefIdSet
>
,
Arc
<
Vec
<
Arc
<
CodegenUnit
<
'tcx
>>>>
),
[]
fn
contains_extern_indicator
:
ContainsExternIndicator
(
DefId
)
->
bool
,
[]
fn
symbol_export_level
:
GetSymbolExportLevel
(
DefId
)
->
SymbolExportLevel
,
[]
fn
is_translated_item
:
IsTranslatedItem
(
DefId
)
->
bool
,
[]
fn
codegen_unit
:
CodegenUnit
(
InternedString
)
->
Arc
<
CodegenUnit
<
'tcx
>>
,
...
...
src/librustc/ty/maps/on_disk_cache.rs
浏览文件 @
6bc7f419
...
...
@@ -217,7 +217,6 @@ pub fn serialize<'a, 'tcx, E>(&self,
encode_query_results
::
<
mir_const_qualif
,
_
>
(
tcx
,
enc
,
qri
)
?
;
encode_query_results
::
<
def_symbol_name
,
_
>
(
tcx
,
enc
,
qri
)
?
;
encode_query_results
::
<
const_is_rvalue_promotable_to_static
,
_
>
(
tcx
,
enc
,
qri
)
?
;
encode_query_results
::
<
contains_extern_indicator
,
_
>
(
tcx
,
enc
,
qri
)
?
;
encode_query_results
::
<
symbol_name
,
_
>
(
tcx
,
enc
,
qri
)
?
;
encode_query_results
::
<
check_match
,
_
>
(
tcx
,
enc
,
qri
)
?
;
}
...
...
src/librustc/ty/maps/plumbing.rs
浏览文件 @
6bc7f419
...
...
@@ -926,9 +926,6 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
DepKind
::
CollectAndPartitionTranslationItems
=>
{
force!
(
collect_and_partition_translation_items
,
LOCAL_CRATE
);
}
DepKind
::
ContainsExternIndicator
=>
{
force!
(
contains_extern_indicator
,
def_id!
());
}
DepKind
::
IsTranslatedItem
=>
{
force!
(
is_translated_item
,
def_id!
());
}
DepKind
::
OutputFilenames
=>
{
force!
(
output_filenames
,
LOCAL_CRATE
);
}
...
...
@@ -997,7 +994,6 @@ pub fn load_from_on_disk_cache(&self, tcx: TyCtxt) {
MirConstQualif
=>
mir_const_qualif
,
SymbolName
=>
def_symbol_name
,
ConstIsRvaluePromotableToStatic
=>
const_is_rvalue_promotable_to_static
,
ContainsExternIndicator
=>
contains_extern_indicator
,
CheckMatch
=>
check_match
,
TypeOfItem
=>
type_of
,
GenericsOfItem
=>
generics_of
,
...
...
src/librustc_trans/back/symbol_export.rs
浏览文件 @
6bc7f419
...
...
@@ -256,7 +256,8 @@ fn symbol_export_level_provider(tcx: TyCtxt, sym_def_id: DefId) -> SymbolExportL
// special symbols in the standard library for various plumbing between
// core/std/allocators/etc. For example symbols used to hook up allocation
// are not considered for export
let
is_extern
=
tcx
.contains_extern_indicator
(
sym_def_id
);
let
trans_fn_attrs
=
tcx
.trans_fn_attrs
(
sym_def_id
);
let
is_extern
=
trans_fn_attrs
.contains_extern_indicator
();
let
std_internal
=
attr
::
contains_name
(
&
tcx
.get_attrs
(
sym_def_id
),
"rustc_std_internal_symbol"
);
if
is_extern
&&
!
std_internal
{
...
...
src/librustc_trans_utils/symbol_names.rs
浏览文件 @
6bc7f419
...
...
@@ -120,11 +120,6 @@ pub fn provide(providers: &mut Providers) {
def_symbol_name
,
symbol_name
,
contains_extern_indicator
:
|
tcx
,
id
|
{
attr
::
contains_name
(
&
tcx
.get_attrs
(
id
),
"no_mangle"
)
||
tcx
.trans_fn_attrs
(
id
)
.export_name
.is_some
()
},
..*
providers
};
}
...
...
src/librustc_trans_utils/trans_crate.rs
浏览文件 @
6bc7f419
...
...
@@ -233,7 +233,6 @@ fn trans_crate<'a, 'tcx>(
MonoItem
::
Fn
(
inst
)
=>
{
let
def_id
=
inst
.def_id
();
if
def_id
.is_local
()
{
let
_
=
tcx
.contains_extern_indicator
(
def_id
);
let
_
=
inst
.def
.is_inline
(
tcx
);
let
_
=
tcx
.trans_fn_attrs
(
def_id
);
}
...
...
src/librustc_typeck/collect.rs
浏览文件 @
6bc7f419
...
...
@@ -1743,6 +1743,8 @@ fn trans_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> TransFnAt
trans_fn_attrs
.flags
|
=
TransFnAttrFlags
::
RUSTC_ALLOCATOR_NOUNWIND
;
}
else
if
attr
.check_name
(
"naked"
)
{
trans_fn_attrs
.flags
|
=
TransFnAttrFlags
::
NAKED
;
}
else
if
attr
.check_name
(
"no_mangle"
)
{
trans_fn_attrs
.flags
|
=
TransFnAttrFlags
::
NO_MANGLE
;
}
else
if
attr
.check_name
(
"inline"
)
{
trans_fn_attrs
.inline
=
attrs
.iter
()
.fold
(
InlineAttr
::
None
,
|
ia
,
attr
|
{
if
attr
.path
!=
"inline"
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录