Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6637340c
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,发现更多精彩内容 >>
提交
6637340c
编写于
12月 19, 2011
作者:
J
Josh Matthews
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Properly calculate base working dir for compile units.
上级
1d3d28bd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
10 deletion
+19
-10
src/comp/driver/rustc.rs
src/comp/driver/rustc.rs
+5
-5
src/comp/driver/session.rs
src/comp/driver/session.rs
+5
-1
src/comp/middle/debuginfo.rs
src/comp/middle/debuginfo.rs
+9
-4
未找到文件。
src/comp/driver/rustc.rs
浏览文件 @
6637340c
...
...
@@ -489,7 +489,7 @@ fn build_session_options(match: getopts::match)
ret
sopts
;
}
fn
build_session
(
sopts
:
@
session
::
options
)
->
session
::
session
{
fn
build_session
(
sopts
:
@
session
::
options
,
input
:
str
)
->
session
::
session
{
let
target_cfg
=
build_target_config
(
sopts
);
let
cstore
=
cstore
::
mk_cstore
();
let
filesearch
=
filesearch
::
mk_filesearch
(
...
...
@@ -498,7 +498,7 @@ fn build_session(sopts: @session::options) -> session::session {
sopts
.addl_lib_search_paths
);
ret
session
::
session
(
target_cfg
,
sopts
,
cstore
,
@
{
cm
:
codemap
::
new_codemap
(),
mutable
next_id
:
1
},
none
,
0u
,
filesearch
,
false
);
none
,
0u
,
filesearch
,
false
,
fs
::
dirname
(
input
)
);
}
fn
parse_pretty
(
sess
:
session
::
session
,
&&
name
:
str
)
->
pp_mode
{
...
...
@@ -644,7 +644,7 @@ fn main(args: [str]) {
};
let
sopts
=
build_session_options
(
match
);
let
sess
=
build_session
(
sopts
);
let
sess
=
build_session
(
sopts
,
ifile
);
let
odir
=
getopts
::
opt_maybe_str
(
match
,
"out-dir"
);
let
ofile
=
getopts
::
opt_maybe_str
(
match
,
"o"
);
let
cfg
=
build_configuration
(
sess
,
binary
,
ifile
);
...
...
@@ -676,7 +676,7 @@ fn test_switch_implies_cfg_test() {
ok
(
m
)
{
m
}
};
let
sessopts
=
build_session_options
(
match
);
let
sess
=
build_session
(
sessopts
);
let
sess
=
build_session
(
sessopts
,
""
);
let
cfg
=
build_configuration
(
sess
,
"whatever"
,
"whatever"
);
assert
(
attr
::
contains_name
(
cfg
,
"test"
));
}
...
...
@@ -690,7 +690,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
ok
(
m
)
{
m
}
};
let
sessopts
=
build_session_options
(
match
);
let
sess
=
build_session
(
sessopts
);
let
sess
=
build_session
(
sessopts
,
""
);
let
cfg
=
build_configuration
(
sess
,
"whatever"
,
"whatever"
);
let
test_items
=
attr
::
find_meta_items_by_name
(
cfg
,
"test"
);
assert
(
vec
::
len
(
test_items
)
==
1u
);
...
...
src/comp/driver/session.rs
浏览文件 @
6637340c
...
...
@@ -60,7 +60,8 @@
mutable
main_fn
:
option
::
t
<
node_id
>
,
mutable
err_count
:
uint
,
filesearch
:
filesearch
::
filesearch
,
mutable
building_library
:
bool
)
{
mutable
building_library
:
bool
,
working_dir
:
str
)
{
fn
get_targ_cfg
()
->
@
config
{
ret
targ_cfg
;
}
fn
get_opts
()
->
@
options
{
ret
opts
;
}
fn
get_cstore
()
->
metadata
::
cstore
::
cstore
{
cstore
}
...
...
@@ -123,6 +124,9 @@ fn building_library() -> bool { building_library }
fn
set_building_library
(
crate
:
@
ast
::
crate
)
{
building_library
=
session
::
building_library
(
opts
.crate_type
,
crate
);
}
fn
get_working_dir
()
->
str
{
ret
working_dir
;
}
}
fn
building_library
(
req_crate_type
:
crate_type
,
crate
:
@
ast
::
crate
)
->
bool
{
...
...
src/comp/middle/debuginfo.rs
浏览文件 @
6637340c
...
...
@@ -162,13 +162,18 @@ fn create_compile_unit(cx: @crate_ctxt, full_path: str)
option
::
none
.
{}
}
let
fname
=
fs
::
basename
(
full_path
);
let
path
=
fs
::
dirname
(
full_path
);
let
work_dir
=
cx
.sess
.get_working_dir
();
let
file_path
=
if
str
::
starts_with
(
full_path
,
work_dir
)
{
str
::
slice
(
full_path
,
str
::
byte_len
(
work_dir
),
str
::
byte_len
(
full_path
))
}
else
{
full_path
};
let
unit_metadata
=
[
lltag
(
tg
),
llunused
(),
lli32
(
DW_LANG_RUST
),
llstr
(
f
name
),
llstr
(
path
),
llstr
(
f
ile_path
),
llstr
(
work_dir
),
llstr
(
#
env
[
"CFG_VERSION"
]),
lli1
(
false
),
// main compile unit
lli1
(
cx
.sess
.get_opts
()
.optimize
!=
0u
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录