Skip to content

Commit 3bd58c4

Browse files
committed
---
yaml --- r: 85488 b: refs/heads/dist-snap c: 6a88415 h: refs/heads/master v: v3
1 parent 8841bd5 commit 3bd58c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2428
-829
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: 0dceabda7f1049fd70d38cf61c80dd5148fdca4e
9+
refs/heads/dist-snap: 6a88415ed80cf98ff3c8864a2b1cbf57f32e6208
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/rt.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ RUNTIME_CXXS_$(1)_$(2) := \
6868
rt/sync/rust_thread.cpp \
6969
rt/rust_builtin.cpp \
7070
rt/rust_run_program.cpp \
71-
rt/rust_env.cpp \
7271
rt/rust_rng.cpp \
73-
rt/rust_stack.cpp \
7472
rt/rust_upcall.cpp \
7573
rt/rust_uv.cpp \
7674
rt/rust_crate_map.cpp \
@@ -149,10 +147,10 @@ rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1)_$(2))
149147
$$(Q)$(AR_$(1)) rcs $$@ $$<
150148

151149
rt/$(1)/stage$(2)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)_$(2)) $$(MKFILE_DEPS) \
152-
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2)) $$(JEMALLOC_LIB_$(1)_$(2))
150+
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2))
153151
@$$(call E, link: $$@)
154152
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
155-
$$(JEMALLOC_LIB_$(1)_$(2)) $$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
153+
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
156154
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)_$(2)),$$(CFG_RUNTIME_$(1)))
157155

158156
# FIXME: For some reason libuv's makefiles can't figure out the

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,14 @@ pub fn build_session_options(binary: @str,
691691
let extra_debuginfo = debugging_opts & session::extra_debug_info != 0;
692692
let debuginfo = debugging_opts & session::debug_info != 0 ||
693693
extra_debuginfo;
694+
695+
// If debugging info is generated, do not collapse monomorphized function instances.
696+
// Functions with equivalent llvm code still need separate debugging descriptions because names
697+
// might differ.
698+
if debuginfo {
699+
debugging_opts |= session::no_monomorphic_collapse;
700+
}
701+
694702
let statik = debugging_opts & session::statik != 0;
695703

696704
let addl_lib_search_paths = getopts::opt_strs(matches, "L").map(|s| Path(*s));

branches/dist-snap/src/librustc/lib/llvm.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,16 @@ pub mod llvm {
20862086

20872087
#[fast_ffi]
20882088
pub fn LLVMSetUnnamedAddr(GlobalVar: ValueRef, UnnamedAddr: Bool);
2089+
2090+
#[fast_ffi]
2091+
pub fn LLVMDIBuilderCreateTemplateTypeParameter(Builder: DIBuilderRef,
2092+
Scope: ValueRef,
2093+
Name: *c_char,
2094+
Ty: ValueRef,
2095+
File: ValueRef,
2096+
LineNo: c_uint,
2097+
ColumnNo: c_uint)
2098+
-> ValueRef;
20892099
}
20902100
}
20912101

branches/dist-snap/src/librustc/middle/lang_items.rs

Lines changed: 42 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,27 @@ pub enum LangItem {
5757

5858
StrEqFnLangItem, // 19
5959
UniqStrEqFnLangItem, // 20
60-
AnnihilateFnLangItem, // 21
61-
LogTypeFnLangItem, // 22
62-
FailFnLangItem, // 23
63-
FailBoundsCheckFnLangItem, // 24
64-
ExchangeMallocFnLangItem, // 25
65-
ClosureExchangeMallocFnLangItem, // 26
66-
ExchangeFreeFnLangItem, // 27
67-
MallocFnLangItem, // 28
68-
FreeFnLangItem, // 29
69-
BorrowAsImmFnLangItem, // 30
70-
BorrowAsMutFnLangItem, // 31
71-
ReturnToMutFnLangItem, // 32
72-
CheckNotBorrowedFnLangItem, // 33
73-
StrDupUniqFnLangItem, // 34
74-
RecordBorrowFnLangItem, // 35
75-
UnrecordBorrowFnLangItem, // 36
76-
77-
StartFnLangItem, // 37
78-
79-
TyDescStructLangItem, // 38
80-
TyVisitorTraitLangItem, // 39
81-
OpaqueStructLangItem, // 40
60+
LogTypeFnLangItem, // 21
61+
FailFnLangItem, // 22
62+
FailBoundsCheckFnLangItem, // 23
63+
ExchangeMallocFnLangItem, // 24
64+
ClosureExchangeMallocFnLangItem, // 25
65+
ExchangeFreeFnLangItem, // 26
66+
MallocFnLangItem, // 27
67+
FreeFnLangItem, // 28
68+
BorrowAsImmFnLangItem, // 29
69+
BorrowAsMutFnLangItem, // 30
70+
ReturnToMutFnLangItem, // 31
71+
CheckNotBorrowedFnLangItem, // 32
72+
StrDupUniqFnLangItem, // 33
73+
RecordBorrowFnLangItem, // 34
74+
UnrecordBorrowFnLangItem, // 35
75+
76+
StartFnLangItem, // 36
77+
78+
TyDescStructLangItem, // 37
79+
TyVisitorTraitLangItem, // 38
80+
OpaqueStructLangItem, // 39
8281
}
8382

8483
pub struct LanguageItems {
@@ -122,28 +121,27 @@ impl LanguageItems {
122121

123122
19 => "str_eq",
124123
20 => "uniq_str_eq",
125-
21 => "annihilate",
126-
22 => "log_type",
127-
23 => "fail_",
128-
24 => "fail_bounds_check",
129-
25 => "exchange_malloc",
130-
26 => "closure_exchange_malloc",
131-
27 => "exchange_free",
132-
28 => "malloc",
133-
29 => "free",
134-
30 => "borrow_as_imm",
135-
31 => "borrow_as_mut",
136-
32 => "return_to_mut",
137-
33 => "check_not_borrowed",
138-
34 => "strdup_uniq",
139-
35 => "record_borrow",
140-
36 => "unrecord_borrow",
141-
142-
37 => "start",
143-
144-
38 => "ty_desc",
145-
39 => "ty_visitor",
146-
40 => "opaque",
124+
21 => "log_type",
125+
22 => "fail_",
126+
23 => "fail_bounds_check",
127+
24 => "exchange_malloc",
128+
25 => "closure_exchange_malloc",
129+
26 => "exchange_free",
130+
27 => "malloc",
131+
28 => "free",
132+
29 => "borrow_as_imm",
133+
30 => "borrow_as_mut",
134+
31 => "return_to_mut",
135+
32 => "check_not_borrowed",
136+
33 => "strdup_uniq",
137+
34 => "record_borrow",
138+
35 => "unrecord_borrow",
139+
140+
36 => "start",
141+
142+
37 => "ty_desc",
143+
38 => "ty_visitor",
144+
39 => "opaque",
147145

148146
_ => "???"
149147
}
@@ -226,9 +224,6 @@ impl LanguageItems {
226224
pub fn uniq_str_eq_fn(&self) -> Option<def_id> {
227225
self.items[UniqStrEqFnLangItem as uint]
228226
}
229-
pub fn annihilate_fn(&self) -> Option<def_id> {
230-
self.items[AnnihilateFnLangItem as uint]
231-
}
232227
pub fn log_type_fn(&self) -> Option<def_id> {
233228
self.items[LogTypeFnLangItem as uint]
234229
}
@@ -327,7 +322,6 @@ impl<'self> LanguageItemCollector<'self> {
327322

328323
item_refs.insert(@"str_eq", StrEqFnLangItem as uint);
329324
item_refs.insert(@"uniq_str_eq", UniqStrEqFnLangItem as uint);
330-
item_refs.insert(@"annihilate", AnnihilateFnLangItem as uint);
331325
item_refs.insert(@"log_type", LogTypeFnLangItem as uint);
332326
item_refs.insert(@"fail_", FailFnLangItem as uint);
333327
item_refs.insert(@"fail_bounds_check",

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

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,17 @@ struct ArmData<'self> {
399399
bindings_map: @BindingsMap
400400
}
401401

402+
/**
403+
* Info about Match.
404+
* If all `pats` are matched then arm `data` will be executed.
405+
* As we proceed `bound_ptrs` are filled with pointers to values to be bound,
406+
* these pointers are stored in llmatch variables just before executing `data` arm.
407+
*/
402408
#[deriving(Clone)]
403409
struct Match<'self> {
404410
pats: ~[@ast::pat],
405-
data: ArmData<'self>
411+
data: ArmData<'self>,
412+
bound_ptrs: ~[(ident, ValueRef)]
406413
}
407414

408415
impl<'self> Repr for Match<'self> {
@@ -447,14 +454,13 @@ fn expand_nested_bindings<'r>(bcx: @mut Block,
447454
br.pats.slice(col + 1u,
448455
br.pats.len())));
449456

450-
let binding_info =
451-
br.data.bindings_map.get(&path_to_ident(path));
452-
453-
Store(bcx, val, binding_info.llmatch);
454-
Match {
457+
let mut res = Match {
455458
pats: pats,
456-
data: br.data.clone()
457-
}
459+
data: br.data.clone(),
460+
bound_ptrs: br.bound_ptrs.clone()
461+
};
462+
res.bound_ptrs.push((path_to_ident(path), val));
463+
res
458464
}
459465
_ => (*br).clone(),
460466
}
@@ -496,21 +502,20 @@ fn enter_match<'r>(bcx: @mut Block,
496502
br.pats.slice(col + 1u, br.pats.len()));
497503

498504
let this = br.pats[col];
505+
let mut bound_ptrs = br.bound_ptrs.clone();
499506
match this.node {
500507
ast::pat_ident(_, ref path, None) => {
501508
if pat_is_binding(dm, this) {
502-
let binding_info =
503-
br.data.bindings_map.get(
504-
&path_to_ident(path));
505-
Store(bcx, val, binding_info.llmatch);
509+
bound_ptrs.push((path_to_ident(path), val));
506510
}
507511
}
508512
_ => {}
509513
}
510514

511515
result.push(Match {
512516
pats: pats,
513-
data: br.data.clone()
517+
data: br.data.clone(),
518+
bound_ptrs: bound_ptrs
514519
});
515520
}
516521
None => ()
@@ -1294,18 +1299,14 @@ fn store_non_ref_bindings(bcx: @mut Block,
12941299

12951300
fn insert_lllocals(bcx: @mut Block,
12961301
bindings_map: &BindingsMap,
1297-
binding_mode: IrrefutablePatternBindingMode,
12981302
add_cleans: bool) -> @mut Block {
12991303
/*!
13001304
* For each binding in `data.bindings_map`, adds an appropriate entry into
13011305
* the `fcx.lllocals` map. If add_cleans is true, then adds cleanups for
13021306
* the bindings.
13031307
*/
13041308

1305-
let llmap = match binding_mode {
1306-
BindLocal => bcx.fcx.lllocals,
1307-
BindArgument => bcx.fcx.llargs
1308-
};
1309+
let llmap = bcx.fcx.lllocals;
13091310

13101311
for (&ident, &binding_info) in bindings_map.iter() {
13111312
let llval = match binding_info.trmode {
@@ -1358,7 +1359,7 @@ fn compile_guard(bcx: @mut Block,
13581359
bcx = store_non_ref_bindings(bcx,
13591360
data.bindings_map,
13601361
Some(&mut temp_cleanups));
1361-
bcx = insert_lllocals(bcx, data.bindings_map, BindLocal, false);
1362+
bcx = insert_lllocals(bcx, data.bindings_map, false);
13621363

13631364
let val = unpack_result!(bcx, {
13641365
do with_scope_result(bcx, guard_expr.info(),
@@ -1418,6 +1419,10 @@ fn compile_submatch(bcx: @mut Block,
14181419
}
14191420
if m[0].pats.len() == 0u {
14201421
let data = &m[0].data;
1422+
for &(ref ident, ref value_ptr) in m[0].bound_ptrs.iter() {
1423+
let llmatch = data.bindings_map.get(ident).llmatch;
1424+
Store(bcx, *value_ptr, llmatch);
1425+
}
14211426
match data.arm.guard {
14221427
Some(guard_expr) => {
14231428
bcx = compile_guard(bcx,
@@ -1843,6 +1848,7 @@ fn trans_match_inner(scope_cx: @mut Block,
18431848
matches.push(Match {
18441849
pats: ~[*p],
18451850
data: arm_data.clone(),
1851+
bound_ptrs: ~[],
18461852
});
18471853
}
18481854
}
@@ -1875,7 +1881,7 @@ fn trans_match_inner(scope_cx: @mut Block,
18751881
}
18761882

18771883
// insert bindings into the lllocals map and add cleanups
1878-
bcx = insert_lllocals(bcx, arm_data.bindings_map, BindLocal, true);
1884+
bcx = insert_lllocals(bcx, arm_data.bindings_map, true);
18791885

18801886
bcx = controlflow::trans_block(bcx, &arm_data.arm.body, dest);
18811887
bcx = trans_block_cleanups(bcx, block_cleanups(arm_data.bodycx));

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

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
133133

134134
fn fcx_has_nonzero_span(fcx: &FunctionContext) -> bool {
135135
match fcx.span {
136-
None => true,
136+
None => false,
137137
Some(span) => *span.lo != 0 || *span.hi != 0
138138
}
139139
}
@@ -1739,6 +1739,10 @@ pub fn copy_args_to_allocas(fcx: @mut FunctionContext,
17391739

17401740
fcx.llself = Some(ValSelfData {v: self_val, ..slf});
17411741
add_clean(bcx, self_val, slf.t);
1742+
1743+
if fcx.ccx.sess.opts.extra_debuginfo && fcx_has_nonzero_span(fcx) {
1744+
debuginfo::create_self_argument_metadata(bcx, slf.t, self_val);
1745+
}
17421746
}
17431747
_ => {}
17441748
}
@@ -1859,6 +1863,10 @@ pub fn trans_closure(ccx: @mut CrateContext,
18591863
set_fixed_stack_segment(fcx.llfn);
18601864
}
18611865

1866+
if ccx.sess.opts.debuginfo && fcx_has_nonzero_span(fcx) {
1867+
debuginfo::create_function_metadata(fcx);
1868+
}
1869+
18621870
// Create the first basic block in the function and keep a handle on it to
18631871
// pass to finish_fn later.
18641872
let bcx_top = fcx.entry_bcx.unwrap();
@@ -1929,12 +1937,7 @@ pub fn trans_fn(ccx: @mut CrateContext,
19291937
id,
19301938
attrs,
19311939
output_type,
1932-
|fcx| {
1933-
if ccx.sess.opts.debuginfo
1934-
&& fcx_has_nonzero_span(fcx) {
1935-
debuginfo::create_function_metadata(fcx);
1936-
}
1937-
});
1940+
|_fcx| { });
19381941
}
19391942

19401943
fn insert_synthetic_type_entries(bcx: @mut Block,
@@ -2906,24 +2909,12 @@ pub fn fill_crate_map(ccx: @mut CrateContext, map: ValueRef) {
29062909
}
29072910
subcrates.push(C_int(ccx, 0));
29082911

2909-
let llannihilatefn = match ccx.tcx.lang_items.annihilate_fn() {
2910-
Some(annihilate_def_id) => {
2911-
if annihilate_def_id.crate == ast::LOCAL_CRATE {
2912-
get_item_val(ccx, annihilate_def_id.node)
2913-
} else {
2914-
let annihilate_fn_type = csearch::get_type(ccx.tcx,
2915-
annihilate_def_id).ty;
2916-
trans_external_path(ccx, annihilate_def_id, annihilate_fn_type)
2917-
}
2918-
}
2919-
None => { C_null(Type::i8p()) }
2920-
};
2921-
29222912
unsafe {
29232913
let mod_map = create_module_map(ccx);
29242914
llvm::LLVMSetInitializer(map, C_struct(
29252915
[C_i32(1),
2926-
lib::llvm::llvm::LLVMConstPointerCast(llannihilatefn, Type::i8p().to_ref()),
2916+
// FIXME #8431 This used to be the annihilate function, now it's nothing
2917+
C_null(Type::i8p()),
29272918
p2i(ccx, mod_map),
29282919
C_array(ccx.int_type, subcrates)]));
29292920
}

0 commit comments

Comments
 (0)