Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
88d874de
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,发现更多精彩内容 >>
提交
88d874de
编写于
2月 10, 2020
作者:
E
Eduard-Mihai Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc_codegen_llvm: avoid converting between DILocation and Value.
上级
fa2b381e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
13 deletion
+16
-13
compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
+2
-1
compiler/rustc_codegen_llvm/src/debuginfo/source_loc.rs
compiler/rustc_codegen_llvm/src/debuginfo/source_loc.rs
+3
-3
compiler/rustc_codegen_llvm/src/llvm/ffi.rs
compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+7
-5
compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+4
-4
未找到文件。
compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
浏览文件 @
88d874de
...
...
@@ -192,7 +192,8 @@ fn set_source_location(&mut self, scope: &'ll DIScope, span: Span) {
let
dbg_loc
=
self
.cx
()
.create_debug_loc
(
scope
,
span
);
unsafe
{
llvm
::
LLVMSetCurrentDebugLocation
(
self
.llbuilder
,
dbg_loc
);
let
dbg_loc_as_llval
=
llvm
::
LLVMRustMetadataAsValue
(
self
.cx
()
.llcx
,
dbg_loc
);
llvm
::
LLVMSetCurrentDebugLocation
(
self
.llbuilder
,
dbg_loc_as_llval
);
}
}
fn
insert_reference_to_gdb_debug_scripts_section_global
(
&
mut
self
)
{
...
...
compiler/rustc_codegen_llvm/src/debuginfo/source_loc.rs
浏览文件 @
88d874de
...
...
@@ -2,8 +2,8 @@
use
super
::
utils
::
debug_context
;
use
crate
::
common
::
CodegenCx
;
use
crate
::
llvm
::
debuginfo
::
DIScope
;
use
crate
::
llvm
::
{
self
,
Valu
e
};
use
crate
::
llvm
;
use
crate
::
llvm
::
debuginfo
::{
DILocation
,
DIScop
e
};
use
rustc_codegen_ssa
::
traits
::
*
;
use
rustc_data_structures
::
sync
::
Lrc
;
...
...
@@ -45,7 +45,7 @@ pub fn lookup_debug_loc(&self, pos: BytePos) -> DebugLoc {
}
}
pub
fn
create_debug_loc
(
&
self
,
scope
:
&
'll
DIScope
,
span
:
Span
)
->
&
'll
Value
{
pub
fn
create_debug_loc
(
&
self
,
scope
:
&
'll
DIScope
,
span
:
Span
)
->
&
'll
DILocation
{
let
DebugLoc
{
line
,
col
,
..
}
=
self
.lookup_debug_loc
(
span
.lo
());
unsafe
{
...
...
compiler/rustc_codegen_llvm/src/llvm/ffi.rs
浏览文件 @
88d874de
...
...
@@ -5,8 +5,9 @@
use
super
::
debuginfo
::{
DIArray
,
DIBasicType
,
DIBuilder
,
DICompositeType
,
DIDerivedType
,
DIDescriptor
,
DIEnumerator
,
DIFile
,
DIFlags
,
DIGlobalVariableExpression
,
DILexicalBlock
,
DINameSpace
,
DISPFlags
,
DIScope
,
DISubprogram
,
DISubrange
,
DITemplateTypeParameter
,
DIType
,
DIVariable
,
DebugEmissionKind
,
DIFile
,
DIFlags
,
DIGlobalVariableExpression
,
DILexicalBlock
,
DILocation
,
DINameSpace
,
DISPFlags
,
DIScope
,
DISubprogram
,
DISubrange
,
DITemplateTypeParameter
,
DIType
,
DIVariable
,
DebugEmissionKind
,
};
use
libc
::{
c_char
,
c_int
,
c_uint
,
size_t
};
...
...
@@ -794,6 +795,7 @@ pub mod debuginfo {
pub
struct
DIBuilder
<
'a
>
(
InvariantOpaque
<
'a
>
);
pub
type
DIDescriptor
=
Metadata
;
pub
type
DILocation
=
Metadata
;
pub
type
DIScope
=
DIDescriptor
;
pub
type
DIFile
=
DIScope
;
pub
type
DILexicalBlock
=
DIScope
;
...
...
@@ -2005,7 +2007,7 @@ pub fn LLVMRustDIBuilderInsertDeclareAtEnd(
VarInfo
:
&
'a
DIVariable
,
AddrOps
:
*
const
i64
,
AddrOpsCount
:
c_uint
,
DL
:
&
'a
Value
,
DL
:
&
'a
DILocation
,
InsertAtEnd
:
&
'a
BasicBlock
,
)
->
&
'a
Value
;
...
...
@@ -2093,8 +2095,8 @@ pub fn LLVMRustDIBuilderCreateDebugLocation(
Line
:
c_uint
,
Column
:
c_uint
,
Scope
:
&
'a
DIScope
,
InlinedAt
:
Option
<&
'a
Metadata
>
,
)
->
&
'a
Value
;
InlinedAt
:
Option
<&
'a
DILocation
>
,
)
->
&
'a
DILocation
;
pub
fn
LLVMRustDIBuilderCreateOpDeref
()
->
i64
;
pub
fn
LLVMRustDIBuilderCreateOpPlusUconst
()
->
i64
;
...
...
compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
浏览文件 @
88d874de
...
...
@@ -931,12 +931,12 @@ LLVMRustDIBuilderGetOrCreateArray(LLVMRustDIBuilderRef Builder,
extern
"C"
LLVMValueRef
LLVMRustDIBuilderInsertDeclareAtEnd
(
LLVMRustDIBuilderRef
Builder
,
LLVMValueRef
V
,
LLVMMetadataRef
VarInfo
,
int64_t
*
AddrOps
,
unsigned
AddrOpsCount
,
LLVM
Value
Ref
DL
,
int64_t
*
AddrOps
,
unsigned
AddrOpsCount
,
LLVM
Metadata
Ref
DL
,
LLVMBasicBlockRef
InsertAtEnd
)
{
return
wrap
(
Builder
->
insertDeclare
(
unwrap
(
V
),
unwrap
<
DILocalVariable
>
(
VarInfo
),
Builder
->
createExpression
(
llvm
::
ArrayRef
<
int64_t
>
(
AddrOps
,
AddrOpsCount
)),
DebugLoc
(
cast
<
MDNode
>
(
unwrap
<
MetadataAsValue
>
(
DL
)
->
getMetadata
()
)),
DebugLoc
(
cast
<
MDNode
>
(
DL
)),
unwrap
(
InsertAtEnd
)));
}
...
...
@@ -1003,7 +1003,7 @@ LLVMRustDICompositeTypeReplaceArrays(LLVMRustDIBuilderRef Builder,
DINodeArray
(
unwrap
<
MDTuple
>
(
Params
)));
}
extern
"C"
LLVM
Value
Ref
extern
"C"
LLVM
Metadata
Ref
LLVMRustDIBuilderCreateDebugLocation
(
LLVMContextRef
ContextRef
,
unsigned
Line
,
unsigned
Column
,
LLVMMetadataRef
Scope
,
LLVMMetadataRef
InlinedAt
)
{
...
...
@@ -1012,7 +1012,7 @@ LLVMRustDIBuilderCreateDebugLocation(LLVMContextRef ContextRef, unsigned Line,
DebugLoc
debug_loc
=
DebugLoc
::
get
(
Line
,
Column
,
unwrapDIPtr
<
MDNode
>
(
Scope
),
unwrapDIPtr
<
MDNode
>
(
InlinedAt
));
return
wrap
(
MetadataAsValue
::
get
(
Context
,
debug_loc
.
getAsMDNode
()
));
return
wrap
(
debug_loc
.
getAsMDNode
(
));
}
extern
"C"
int64_t
LLVMRustDIBuilderCreateOpDeref
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录