Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
1bcb4df1
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,发现更多精彩内容 >>
提交
1bcb4df1
编写于
8月 21, 2018
作者:
D
Denis Merigoux
提交者:
Eduard-Mihai Burtescu
11月 16, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Generalized OperandBundleDef in BuilderMethods
上级
bc86624c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
12 deletion
+31
-12
src/librustc_codegen_llvm/builder.rs
src/librustc_codegen_llvm/builder.rs
+4
-4
src/librustc_codegen_llvm/common.rs
src/librustc_codegen_llvm/common.rs
+5
-5
src/librustc_codegen_llvm/llvm/mod.rs
src/librustc_codegen_llvm/llvm/mod.rs
+5
-0
src/librustc_codegen_llvm/traits.rs
src/librustc_codegen_llvm/traits.rs
+17
-3
未找到文件。
src/librustc_codegen_llvm/builder.rs
浏览文件 @
1bcb4df1
...
...
@@ -191,7 +191,7 @@ fn invoke(&self,
args
:
&
[
&
'll
Value
],
then
:
&
'll
BasicBlock
,
catch
:
&
'll
BasicBlock
,
bundle
:
Option
<&
OperandBundleDef
<
'll
>>
)
->
&
'll
Value
{
bundle
:
Option
<&
traits
::
OperandBundleDef
<
'll
,
&
'll
Value
>>
)
->
&
'll
Value
{
self
.count_insn
(
"invoke"
);
debug!
(
"Invoke {:?} with args ({:?})"
,
...
...
@@ -199,7 +199,7 @@ fn invoke(&self,
args
);
let
args
=
self
.check_call
(
"invoke"
,
llfn
,
args
);
let
bundle
=
bundle
.map
(|
b
|
&*
b
.raw
);
let
bundle
=
bundle
.map
(|
b
|
&*
(
OperandBundleDef
::
from_generic
(
b
))
.raw
);
unsafe
{
llvm
::
LLVMRustBuildInvoke
(
self
.llbuilder
,
...
...
@@ -1191,7 +1191,7 @@ fn call_lifetime_intrinsic(&self, intrinsic: &str, ptr: &'ll Value, size: Size)
}
fn
call
(
&
self
,
llfn
:
&
'll
Value
,
args
:
&
[
&
'll
Value
],
bundle
:
Option
<&
OperandBundleDef
<
'll
>>
)
->
&
'll
Value
{
bundle
:
Option
<&
traits
::
OperandBundleDef
<
'll
,
&
'll
Value
>>
)
->
&
'll
Value
{
self
.count_insn
(
"call"
);
debug!
(
"Call {:?} with args ({:?})"
,
...
...
@@ -1199,7 +1199,7 @@ fn call(&self, llfn: &'ll Value, args: &[&'ll Value],
args
);
let
args
=
self
.check_call
(
"call"
,
llfn
,
args
);
let
bundle
=
bundle
.map
(|
b
|
&*
b
.raw
);
let
bundle
=
bundle
.map
(|
b
|
&*
(
OperandBundleDef
::
from_generic
(
b
))
.raw
);
unsafe
{
llvm
::
LLVMRustBuildCall
(
...
...
src/librustc_codegen_llvm/common.rs
浏览文件 @
1bcb4df1
...
...
@@ -13,7 +13,7 @@
//! Code that is useful in various codegen modules.
use
llvm
::{
self
,
TypeKind
};
use
llvm
::{
True
,
False
,
Bool
,
OperandBundleDef
};
use
llvm
::{
True
,
False
,
Bool
};
use
rustc
::
hir
::
def_id
::
DefId
;
use
rustc
::
middle
::
lang_items
::
LangItem
;
use
abi
;
...
...
@@ -28,7 +28,7 @@
use
rustc
::
ty
::{
self
,
Ty
,
TyCtxt
};
use
rustc
::
ty
::
layout
::{
HasDataLayout
,
LayoutOf
};
use
rustc
::
hir
;
use
traits
::
BuilderMethods
;
use
traits
::
{
BuilderMethods
,
OperandBundleDef
}
;
use
libc
::{
c_uint
,
c_char
};
...
...
@@ -91,14 +91,14 @@ pub fn type_is_freeze<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bo
/// the `OperandBundleDef` value created for MSVC landing pads.
pub
struct
Funclet
<
'll
>
{
cleanuppad
:
&
'll
Value
,
operand
:
OperandBundleDef
<
'll
>
,
operand
:
OperandBundleDef
<
'll
,
&
'll
Value
>
,
}
impl
Funclet
<
'll
>
{
pub
fn
new
(
cleanuppad
:
&
'll
Value
)
->
Self
{
Funclet
{
cleanuppad
,
operand
:
OperandBundleDef
::
new
(
"funclet"
,
&
[
cleanuppad
]
),
operand
:
OperandBundleDef
::
new
(
"funclet"
,
cleanuppad
),
}
}
...
...
@@ -106,7 +106,7 @@ pub fn cleanuppad(&self) -> &'ll Value {
self
.cleanuppad
}
pub
fn
bundle
(
&
self
)
->
&
OperandBundleDef
<
'll
>
{
pub
fn
bundle
(
&
self
)
->
&
OperandBundleDef
<
'll
,
&
'll
Value
>
{
&
self
.operand
}
}
...
...
src/librustc_codegen_llvm/llvm/mod.rs
浏览文件 @
1bcb4df1
...
...
@@ -28,6 +28,7 @@
use
std
::
cell
::
RefCell
;
use
libc
::{
self
,
c_uint
,
c_char
,
size_t
};
use
rustc_data_structures
::
small_c_str
::
SmallCStr
;
use
traits
;
pub
mod
archive_ro
;
pub
mod
diagnostic
;
...
...
@@ -271,6 +272,10 @@ pub fn new(name: &str, vals: &[&'a Value]) -> Self {
};
OperandBundleDef
{
raw
:
def
}
}
pub
fn
from_generic
(
bundle
:
&
traits
::
OperandBundleDef
<
'a
,
&
'a
Value
>
)
->
Self
{
Self
::
new
(
bundle
.name
,
&
[
bundle
.val
])
}
}
impl
Drop
for
OperandBundleDef
<
'a
>
{
...
...
src/librustc_codegen_llvm/traits.rs
浏览文件 @
1bcb4df1
...
...
@@ -9,7 +9,6 @@
// except according to those terms.
use
llvm
::{
AtomicRmwBinOp
,
AtomicOrdering
,
SynchronizationScope
,
AsmDialect
};
use
llvm
::
OperandBundleDef
;
use
common
::
*
;
use
type_
::
Type
;
use
libc
::
c_char
;
...
...
@@ -17,10 +16,25 @@
use
rustc
::
ty
::
layout
::{
Align
,
Size
};
use
rustc
::
session
::
Session
;
use
builder
::
MemFlags
;
use
value
::
Value
;
use
std
::
borrow
::
Cow
;
use
std
::
ops
::
Range
;
pub
struct
OperandBundleDef
<
'a
,
Value
:
'a
>
{
pub
name
:
&
'a
str
,
pub
val
:
Value
}
impl
OperandBundleDef
<
'll
,
&
'll
Value
>
{
pub
fn
new
(
name
:
&
'll
str
,
val
:
&
'll
Value
)
->
Self
{
OperandBundleDef
{
name
,
val
,
}
}
}
pub
enum
IntPredicate
{
IntEQ
,
IntNE
,
...
...
@@ -97,7 +111,7 @@ fn invoke(
args
:
&
[
&
'll
Value
],
then
:
&
'll
BasicBlock
,
catch
:
&
'll
BasicBlock
,
bundle
:
Option
<&
OperandBundleDef
<
'll
>>
bundle
:
Option
<&
OperandBundleDef
<
'll
,
&
'll
Value
>>
)
->
&
'll
Value
;
fn
unreachable
(
&
self
);
fn
add
(
&
self
,
lhs
:
&
'll
Value
,
rhs
:
&
'll
Value
)
->
&
'll
Value
;
...
...
@@ -313,6 +327,6 @@ fn check_call<'b>(
fn
call_lifetime_intrinsic
(
&
self
,
intrinsic
:
&
str
,
ptr
:
&
'll
Value
,
size
:
Size
);
fn
call
(
&
self
,
llfn
:
&
'll
Value
,
args
:
&
[
&
'll
Value
],
bundle
:
Option
<&
OperandBundleDef
<
'll
>>
)
->
&
'll
Value
;
bundle
:
Option
<&
OperandBundleDef
<
'll
,
&
'll
Value
>>
)
->
&
'll
Value
;
fn
zext
(
&
self
,
val
:
&
'll
Value
,
dest_ty
:
&
'll
Type
)
->
&
'll
Value
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录