Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
993e4717
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,发现更多精彩内容 >>
提交
993e4717
编写于
6月 29, 2011
作者:
L
Lindsey Kuper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Comments and cleanup.
上级
f279e0d7
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
6 deletion
+13
-6
src/comp/middle/trans.rs
src/comp/middle/trans.rs
+13
-6
未找到文件。
src/comp/middle/trans.rs
浏览文件 @
993e4717
...
...
@@ -180,8 +180,16 @@
// env*, int, int). These are also available via
// llvm::LLVMGetParam(llfn, uint) where uint = 1, 2, 0 respectively,
// but we unpack them into these fields for convenience.
// Points to the current task.
ValueRef
lltaskptr
,
// Points to the current environment (bindings of variables to
// values), if this is a regular function; points to the current
// object, if this is a method.
ValueRef
llenv
,
// Points to where the return value of this function should end up.
ValueRef
llretptr
,
// The next three elements: "hoisted basic blocks" containing
...
...
@@ -1726,19 +1734,19 @@ fn get_derived_tydesc(&@block_ctxt cx, &ty::t t, bool escapes,
fn
get_tydesc
(
&@
block_ctxt
cx
,
&
ty
::
t
t
,
bool
escapes
,
&
mutable
option
::
t
[
@
tydesc_info
]
static_ti
)
->
result
{
// Is the supplied type a type param? If so, return the passed-in tydesc.
// Is the supplied type a type param? If so, return the passed-in tydesc.
alt
(
ty
::
type_param
(
cx
.fcx.lcx.ccx.tcx
,
t
))
{
case
(
some
(
?
id
))
{
ret
rslt
(
cx
,
cx
.fcx.lltydescs
.
(
id
));
}
case
(
none
)
{
/* fall through */
}
}
// Does it contain a type param? If so, generate a derived tydesc.
// Does it contain a type param? If so, generate a derived tydesc.
if
(
ty
::
type_contains_params
(
cx
.fcx.lcx.ccx.tcx
,
t
))
{
ret
get_derived_tydesc
(
cx
,
t
,
escapes
,
static_ti
);
}
// Otherwise, generate a tydesc if necessary, and return it.
// Otherwise, generate a tydesc if necessary, and return it.
auto
info
=
get_static_tydesc
(
cx
,
t
,
[]);
static_ti
=
some
[
@
tydesc_info
](
info
);
ret
rslt
(
cx
,
info
.tydesc
);
...
...
@@ -5003,8 +5011,8 @@ fn trans_field(&@block_ctxt cx, &span sp, ValueRef v, &ty::t t0,
r
.bcx.build
.GEP
(
r
.val
,
[
C_int
(
0
),
C_int
(
abi
::
obj_field_vtbl
)]);
vtbl
=
r
.bcx.build
.Load
(
vtbl
);
// +1 because slot #0 contains the destructor
// +1 because slot #0 contains the destructor
auto
v
=
r
.bcx.build
.GEP
(
vtbl
,
[
C_int
(
0
),
C_int
(
ix
+
1u
as
int
)]);
auto
lvo
=
lval_mem
(
r
.bcx
,
v
);
let
ty
::
t
fn_ty
=
...
...
@@ -7760,11 +7768,10 @@ fn trans_fn(@local_ctxt cx, &span sp, &ast::_fn f, ValueRef llfndecl,
if
(
!
is_terminated
(
rslt
.bcx
))
{
// FIXME: until LLVM has a unit type, we are moving around
// C_nil values rather than their void type.
rslt
.bcx.build
.RetVoid
();
}
// Insert the mandatory first few basic blocks before lltop.
// Insert the mandatory first few basic blocks before lltop.
finish_fn
(
fcx
,
lltop
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录