Skip to content

Commit 17afcc3

Browse files
author
Nick Desaulniers
committed
---
yaml --- r: 85337 b: refs/heads/dist-snap c: 0932ab3 h: refs/heads/master i: 85335: a26bc58 v: v3
1 parent 40dfd1e commit 17afcc3

30 files changed

+186
-2230
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 433fbe8fcf13724445cc57c85cc454352c969429
9+
refs/heads/dist-snap: 0932ab336ffd9c53d3a164e0f94fcab2206c3fee
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ pub fn source_name(input: &input) -> @str {
6565
}
6666
}
6767
68-
pub fn default_configuration(sess: Session, argv0: @str, input: &input) ->
68+
pub fn default_configuration(sess: Session) ->
6969
ast::CrateConfig {
70-
let (libc, tos) = match sess.targ_cfg.os {
71-
session::os_win32 => (@"msvcrt.dll", @"win32"),
72-
session::os_macos => (@"libc.dylib", @"macos"),
73-
session::os_linux => (@"libc.so.6", @"linux"),
74-
session::os_android => (@"libc.so", @"android"),
75-
session::os_freebsd => (@"libc.so.7", @"freebsd")
70+
let tos = match sess.targ_cfg.os {
71+
session::os_win32 => @"win32",
72+
session::os_macos => @"macos",
73+
session::os_linux => @"linux",
74+
session::os_android => @"android",
75+
session::os_freebsd => @"freebsd"
7676
};
7777

7878
// ARM is bi-endian, however using NDK seems to default
@@ -92,10 +92,7 @@ pub fn default_configuration(sess: Session, argv0: @str, input: &input) ->
9292
mk(@"target_arch", arch),
9393
mk(@"target_endian", end),
9494
mk(@"target_word_size", wordsz),
95-
mk(@"target_libc", libc),
96-
// Build bindings.
97-
mk(@"build_compiler", argv0),
98-
mk(@"build_input", source_name(input))];
95+
];
9996
}
10097

10198
pub fn append_configuration(cfg: &mut ast::CrateConfig, name: @str) {
@@ -104,11 +101,11 @@ pub fn append_configuration(cfg: &mut ast::CrateConfig, name: @str) {
104101
}
105102
}
106103

107-
pub fn build_configuration(sess: Session, argv0: @str, input: &input) ->
104+
pub fn build_configuration(sess: Session) ->
108105
ast::CrateConfig {
109106
// Combine the configuration requested by the session (command line) with
110107
// some default and generated configuration items
111-
let default_cfg = default_configuration(sess, argv0, input);
108+
let default_cfg = default_configuration(sess);
112109
let mut user_cfg = sess.opts.cfg.clone();
113110
// If the user wants a test runner, then add the test cfg
114111
if sess.opts.test { append_configuration(&mut user_cfg, @"test") }
@@ -980,7 +977,7 @@ pub fn list_metadata(sess: Session, path: &Path, out: @io::Writer) {
980977
mod test {
981978

982979
use driver::driver::{build_configuration, build_session};
983-
use driver::driver::{build_session_options, optgroups, str_input};
980+
use driver::driver::{build_session_options, optgroups};
984981

985982
use extra::getopts::groups::getopts;
986983
use extra::getopts;
@@ -998,7 +995,7 @@ mod test {
998995
let sessopts = build_session_options(
999996
@"rustc", matches, diagnostic::emit);
1000997
let sess = build_session(sessopts, diagnostic::emit);
1001-
let cfg = build_configuration(sess, @"whatever", &str_input(@""));
998+
let cfg = build_configuration(sess);
1002999
assert!((attr::contains_name(cfg, "test")));
10031000
}
10041001

@@ -1016,7 +1013,7 @@ mod test {
10161013
let sessopts = build_session_options(
10171014
@"rustc", matches, diagnostic::emit);
10181015
let sess = build_session(sessopts, diagnostic::emit);
1019-
let cfg = build_configuration(sess, @"whatever", &str_input(@""));
1016+
let cfg = build_configuration(sess);
10201017
let mut test_items = cfg.iter().filter(|m| "test" == m.name());
10211018
assert!(test_items.next().is_some());
10221019
assert!(test_items.next().is_none());

branches/dist-snap/src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ use middle::trans::expr;
214214
use middle::trans::glue;
215215
use middle::trans::tvec;
216216
use middle::trans::type_of;
217-
use middle::trans::debuginfo;
218217
use middle::ty;
219218
use util::common::indenter;
220219
use util::ppaux::{Repr, vec_map_to_str};
@@ -386,7 +385,6 @@ struct BindingInfo {
386385
llmatch: ValueRef,
387386
trmode: TransBindingMode,
388387
id: ast::NodeId,
389-
span: span,
390388
ty: ty::t,
391389
}
392390

@@ -1307,7 +1305,7 @@ fn insert_lllocals(bcx: @mut Block,
13071305
BindArgument => bcx.fcx.llargs
13081306
};
13091307

1310-
for (&ident, &binding_info) in bindings_map.iter() {
1308+
for (_, &binding_info) in bindings_map.iter() {
13111309
let llval = match binding_info.trmode {
13121310
// By value bindings: use the stack slot that we
13131311
// copied/moved the value into
@@ -1327,14 +1325,6 @@ fn insert_lllocals(bcx: @mut Block,
13271325

13281326
debug!("binding %? to %s", binding_info.id, bcx.val_to_str(llval));
13291327
llmap.insert(binding_info.id, llval);
1330-
1331-
if bcx.sess().opts.extra_debuginfo {
1332-
debuginfo::create_match_binding_metadata(bcx,
1333-
ident,
1334-
binding_info.id,
1335-
binding_info.ty,
1336-
binding_info.span);
1337-
}
13381328
}
13391329
return bcx;
13401330
}
@@ -1781,7 +1771,7 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::pat) -> BindingsMap {
17811771
let ccx = bcx.ccx();
17821772
let tcx = bcx.tcx();
17831773
let mut bindings_map = HashMap::new();
1784-
do pat_bindings(tcx.def_map, pat) |bm, p_id, span, path| {
1774+
do pat_bindings(tcx.def_map, pat) |bm, p_id, _s, path| {
17851775
let ident = path_to_ident(path);
17861776
let variable_ty = node_id_type(bcx, p_id);
17871777
let llvariable_ty = type_of::type_of(ccx, variable_ty);
@@ -1803,11 +1793,8 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::pat) -> BindingsMap {
18031793
}
18041794
};
18051795
bindings_map.insert(ident, BindingInfo {
1806-
llmatch: llmatch,
1807-
trmode: trmode,
1808-
id: p_id,
1809-
span: span,
1810-
ty: variable_ty
1796+
llmatch: llmatch, trmode: trmode,
1797+
id: p_id, ty: variable_ty
18111798
});
18121799
}
18131800
return bindings_map;

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,7 @@ pub fn trans_stmt(cx: @mut Block, s: &ast::stmt) -> @mut Block {
11031103
}
11041104

11051105
let mut bcx = cx;
1106+
debuginfo::update_source_pos(cx, s.span);
11061107

11071108
match s.node {
11081109
ast::stmt_expr(e, _) | ast::stmt_semi(e, _) => {
@@ -1633,8 +1634,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16331634
param_substs: param_substs,
16341635
span: sp,
16351636
path: path,
1636-
ccx: ccx,
1637-
debug_context: None,
1637+
ccx: ccx
16381638
};
16391639
fcx.llenv = unsafe {
16401640
llvm::LLVMGetParam(llfndecl, fcx.env_arg_pos() as c_uint)
@@ -1933,7 +1933,7 @@ pub fn trans_fn(ccx: @mut CrateContext,
19331933
attrs,
19341934
output_type,
19351935
|fcx| {
1936-
if ccx.sess.opts.debuginfo
1936+
if ccx.sess.opts.extra_debuginfo
19371937
&& fcx_has_nonzero_span(fcx) {
19381938
debuginfo::create_function_metadata(fcx);
19391939
}

branches/dist-snap/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use middle::trans::build;
2323
use middle::trans::datum;
2424
use middle::trans::glue;
2525
use middle::trans::write_guard;
26-
use middle::trans::debuginfo;
2726
use middle::ty::substs;
2827
use middle::ty;
2928
use middle::typeck;
@@ -227,10 +226,7 @@ pub struct FunctionContext {
227226
path: path,
228227

229228
// This function's enclosing crate context.
230-
ccx: @mut CrateContext,
231-
232-
// Used and maintained by the debuginfo module.
233-
debug_context: Option<~debuginfo::FunctionDebugContext>
229+
ccx: @mut CrateContext
234230
}
235231

236232
impl FunctionContext {

branches/dist-snap/src/librustc/middle/trans/controlflow.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use middle::trans::base::*;
1919
use middle::trans::build::*;
2020
use middle::trans::callee;
2121
use middle::trans::common::*;
22+
use middle::trans::debuginfo;
2223
use middle::trans::expr;
2324
use middle::trans::type_of::*;
2425
use middle::ty;
@@ -37,10 +38,12 @@ pub fn trans_block(bcx: @mut Block, b: &ast::Block, dest: expr::Dest) -> @mut Bl
3738
let _icx = push_ctxt("trans_block");
3839
let mut bcx = bcx;
3940
for s in b.stmts.iter() {
41+
debuginfo::update_source_pos(bcx, b.span);
4042
bcx = trans_stmt(bcx, *s);
4143
}
4244
match b.expr {
4345
Some(e) => {
46+
debuginfo::update_source_pos(bcx, e.span);
4447
bcx = expr::trans_into(bcx, e, dest);
4548
}
4649
None => {

0 commit comments

Comments
 (0)