Skip to content

Commit ebb3102

Browse files
committed
---
yaml --- r: 12029 b: refs/heads/master c: b0f6dad h: refs/heads/master i: 12027: d623e4d v: v3
1 parent df93cfa commit ebb3102

File tree

11 files changed

+81
-66
lines changed

11 files changed

+81
-66
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 81424389382316220944322305c9935119dba5ce
2+
refs/heads/master: b0f6dad5e3a3fcb2a19077e5beb3833473bec5e7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/Makefile.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ CFG_LIBRUSTC :=$(call CFG_LIB_NAME,rustc)
114114
STDLIB_GLOB :=$(call CFG_LIB_GLOB,std)
115115
CORELIB_GLOB :=$(call CFG_LIB_GLOB,core)
116116
LIBRUSTC_GLOB :=$(call CFG_LIB_GLOB,rustc)
117-
STDLIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,std)
118-
CORELIB_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,core)
119-
LIBRUSTC_DSYM_GLOB :=$(call CFG_LIB_DSYM_GLOB,rustc)
120117

121118
# version-string calculation
122119
CFG_GIT_DIR := $(CFG_SRC_DIR).git

trunk/mk/host.mk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC): \
3131
$$(HSTDLIB_DEFAULT$(2)_H_$(3))
3232
@$$(call E, cp: $$@)
3333
$$(Q)cp $$< $$@
34-
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTC_GLOB) \
35-
$$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTC_DSYM_GLOB) \
34+
$$(Q)cp $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTC_GLOB) \
3635
$$(HLIB$(2)_H_$(4))
3736

3837
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME): \
@@ -45,8 +44,7 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_CORELIB): \
4544
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME)
4645
@$$(call E, cp: $$@)
4746
$$(Q)cp $$< $$@
48-
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(CORELIB_GLOB) \
49-
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CORELIB_DSYM_GLOB) \
47+
$$(Q)cp $$(TLIB$(1)_T_$(4)_H_$(3))/$(CORELIB_GLOB) \
5048
$$(HLIB$(2)_H_$(4))
5149

5250
$$(HLIB$(2)_H_$(4))/$$(CFG_STDLIB): \
@@ -55,8 +53,7 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_STDLIB): \
5553
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME)
5654
@$$(call E, cp: $$@)
5755
$$(Q)cp $$< $$@
58-
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(STDLIB_GLOB) \
59-
$$(TLIB$(1)_T_$(4)_H_$(3))/$(STDLIB_DSYM_GLOB) \
56+
$$(Q)cp $$(TLIB$(1)_T_$(4)_H_$(3))/$(STDLIB_GLOB) \
6057
$$(HLIB$(2)_H_$(4))
6158

6259
$$(HLIB$(2)_H_$(4))/libcore.rlib: \

trunk/mk/platform.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ endif
8585
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
8686
CFG_LIB_NAME=lib$(1).dylib
8787
CFG_LIB_GLOB=lib$(1)-*.dylib
88-
CFG_LIB_DSYM_GLOB=lib$(1)-*.dylib.dSYM
8988
CFG_UNIXY := 1
9089
CFG_LDENV := DYLD_LIBRARY_PATH
9190
CFG_GCCISH_LINK_FLAGS += -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind

trunk/src/rustc/driver/driver.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,18 +449,19 @@ fn build_session_options(match: getopts::match,
449449
ret sopts;
450450
}
451451

452-
fn build_session(sopts: @session::options,
452+
fn build_session(sopts: @session::options, input: str,
453453
demitter: diagnostic::emitter) -> session {
454454
let codemap = codemap::new_codemap();
455455
let diagnostic_handler =
456456
diagnostic::mk_handler(some(demitter));
457457
let span_diagnostic_handler =
458458
diagnostic::mk_span_handler(diagnostic_handler, codemap);
459-
build_session_(sopts, codemap, demitter, span_diagnostic_handler)
459+
build_session_(sopts, input, codemap, demitter,
460+
span_diagnostic_handler)
460461
}
461462

462463
fn build_session_(
463-
sopts: @session::options,
464+
sopts: @session::options, input: str,
464465
codemap: codemap::codemap,
465466
demitter: diagnostic::emitter,
466467
span_diagnostic_handler: diagnostic::span_handler
@@ -487,7 +488,7 @@ fn build_session_(
487488
span_diagnostic: span_diagnostic_handler,
488489
filesearch: filesearch,
489490
mutable building_library: false,
490-
working_dir: os::getcwd()}
491+
working_dir: path::dirname(input)}
491492
}
492493

493494
fn parse_pretty(sess: session, &&name: str) -> pp_mode {
@@ -635,7 +636,7 @@ mod test {
635636
getopts::fail_str(f); }
636637
};
637638
let sessopts = build_session_options(match, diagnostic::emit);
638-
let sess = build_session(sessopts, diagnostic::emit);
639+
let sess = build_session(sessopts, "", diagnostic::emit);
639640
let cfg = build_configuration(sess, "whatever", "whatever");
640641
assert (attr::contains_name(cfg, "test"));
641642
}
@@ -651,7 +652,7 @@ mod test {
651652
getopts::fail_str(f); }
652653
};
653654
let sessopts = build_session_options(match, diagnostic::emit);
654-
let sess = build_session(sessopts, diagnostic::emit);
655+
let sess = build_session(sessopts, "", diagnostic::emit);
655656
let cfg = build_configuration(sess, "whatever", "whatever");
656657
let test_items = attr::find_meta_items_by_name(cfg, "test");
657658
assert (vec::len(test_items) == 1u);

trunk/src/rustc/driver/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn run_compiler(args: [str], demitter: diagnostic::emitter) {
9999
};
100100

101101
let sopts = build_session_options(match, demitter);
102-
let sess = build_session(sopts, demitter);
102+
let sess = build_session(sopts, ifile, demitter);
103103
let odir = getopts::opt_maybe_str(match, "out-dir");
104104
let ofile = getopts::opt_maybe_str(match, "o");
105105
let cfg = build_configuration(sess, binary, ifile);

trunk/src/rustc/middle/trans/base.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ fn declare_tydesc(ccx: @crate_ctxt, t: ty::t) -> @tydesc_info {
402402
llsize = llsize_of(ccx, llty);
403403
llalign = llalign_of(ccx, llty);
404404
let name;
405-
if false /*ccx.sess.opts.debuginfo*/ { //XXX this triggers duplicate LLVM symbols
405+
if ccx.sess.opts.debuginfo {
406406
name = mangle_internal_name_by_type_only(ccx, t, "tydesc");
407407
} else { name = mangle_internal_name_by_seq(ccx, "tydesc"); }
408408
note_unique_llvm_symbol(ccx, name);
@@ -427,7 +427,7 @@ fn declare_generic_glue(ccx: @crate_ctxt, t: ty::t, llfnty: TypeRef,
427427
name: str) -> ValueRef {
428428
let name = name;
429429
let fn_nm;
430-
if false /*ccx.sess.opts.debuginfo*/ { //XXX this triggers duplicate LLVM symbols
430+
if ccx.sess.opts.debuginfo {
431431
fn_nm = mangle_internal_name_by_type_only(ccx, t, "glue_" + name);
432432
} else {
433433
fn_nm = mangle_internal_name_by_seq(ccx, "glue_" + name);
@@ -4672,7 +4672,8 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
46724672
lib::llvm::associate_type(tn, "tydesc", tydesc_type);
46734673
let crate_map = decl_crate_map(sess, link_meta.name, llmod);
46744674
let dbg_cx = if sess.opts.debuginfo {
4675-
option::some(debuginfo::mk_ctxt(llmod_id))
4675+
option::some(@{llmetadata: map::int_hash(),
4676+
names: new_namegen()})
46764677
} else {
46774678
option::none
46784679
};

trunk/src/rustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type crate_ctxt = {
114114
builder: BuilderRef_res,
115115
shape_cx: shape::ctxt,
116116
crate_map: ValueRef,
117-
dbg_cx: option<debuginfo::debug_ctxt>,
117+
dbg_cx: option<@debuginfo::debug_ctxt>,
118118
mutable do_not_commit_warning_issued: bool};
119119

120120
// Types used for llself.

trunk/src/rustc/middle/trans/debuginfo.rs

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import std::map;
21
import std::map::hashmap;
32
import lib::llvm::llvm;
43
import lib::llvm::ValueRef;
@@ -18,7 +17,6 @@ export create_function;
1817
export create_arg;
1918
export update_source_pos;
2019
export debug_ctxt;
21-
export mk_ctxt;
2220

2321
const LLVMDebugVersion: int = (9 << 16);
2422

@@ -77,24 +75,18 @@ fn llnull() -> ValueRef unsafe {
7775

7876
fn add_named_metadata(cx: @crate_ctxt, name: str, val: ValueRef) {
7977
str::as_c_str(name, {|sbuf|
80-
llvm::LLVMAddNamedMetadataOperand(cx.llmod, sbuf, val)
78+
llvm::LLVMAddNamedMetadataOperand(cx.llmod, sbuf,
79+
val)
8180
})
8281
}
8382

8483
////////////////
8584

8685
type debug_ctxt = {
8786
llmetadata: metadata_cache,
88-
names: namegen,
89-
crate_file: str
87+
names: namegen
9088
};
9189

92-
fn mk_ctxt(crate: str) -> debug_ctxt {
93-
{llmetadata: map::int_hash(),
94-
names: new_namegen(),
95-
crate_file: crate}
96-
}
97-
9890
fn update_cache(cache: metadata_cache, mdtag: int, val: debug_metadata) {
9991
let existing = if cache.contains_key(mdtag) {
10092
cache.get(mdtag)
@@ -107,7 +99,7 @@ fn update_cache(cache: metadata_cache, mdtag: int, val: debug_metadata) {
10799
type metadata<T> = {node: ValueRef, data: T};
108100

109101
type file_md = {path: str};
110-
type compile_unit_md = {name: str};
102+
type compile_unit_md = {path: str};
111103
type subprogram_md = {id: ast::node_id};
112104
type local_var_md = {id: ast::node_id};
113105
type tydesc_md = {hash: uint};
@@ -162,51 +154,48 @@ fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int,
162154
ret option::none;
163155
}
164156

165-
fn create_compile_unit(cx: @crate_ctxt)
157+
fn create_compile_unit(cx: @crate_ctxt, full_path: str)
166158
-> @metadata<compile_unit_md> unsafe {
167159
let cache = get_cache(cx);
168-
let crate_name = option::get(cx.dbg_cx).crate_file;
169160
let tg = CompileUnitTag;
170161
alt cached_metadata::<@metadata<compile_unit_md>>(cache, tg,
171-
{|md| md.data.name == crate_name}) {
162+
{|md| md.data.path == full_path}) {
172163
option::some(md) { ret md; }
173164
option::none {}
174165
}
175166

176-
let (_, work_dir) = get_file_path_and_dir(cx.sess.working_dir,
177-
crate_name);
167+
let work_dir = cx.sess.working_dir;
168+
let file_path = if str::starts_with(full_path, work_dir) {
169+
str::slice(full_path, str::len(work_dir), str::len(full_path))
170+
} else {
171+
full_path
172+
};
178173
let unit_metadata = [lltag(tg),
179174
llunused(),
180175
lli32(DW_LANG_RUST),
181-
llstr(crate_name),
176+
llstr(file_path),
182177
llstr(work_dir),
183178
llstr(#env["CFG_VERSION"]),
184-
lli1(true), // deprecated: main compile unit
179+
lli1(false), // main compile unit
185180
lli1(cx.sess.opts.optimize != 0u),
186181
llstr(""), // flags (???)
187182
lli32(0) // runtime version (???)
183+
// list of enum types
184+
// list of retained values
185+
// list of subprograms
186+
// list of global variables
188187
];
189188
let unit_node = llmdnode(unit_metadata);
190189
add_named_metadata(cx, "llvm.dbg.cu", unit_node);
191-
let mdval = @{node: unit_node, data: {name: crate_name}};
190+
let mdval = @{node: unit_node, data: {path: full_path}};
192191
update_cache(cache, tg, compile_unit_metadata(mdval));
193-
194192
ret mdval;
195193
}
196194

197195
fn get_cache(cx: @crate_ctxt) -> metadata_cache {
198196
option::get(cx.dbg_cx).llmetadata
199197
}
200198

201-
fn get_file_path_and_dir(work_dir: str, full_path: str) -> (str, str) {
202-
(if str::starts_with(full_path, work_dir) {
203-
str::slice(full_path, str::len(work_dir) + 1u,
204-
str::len(full_path))
205-
} else {
206-
full_path
207-
}, work_dir)
208-
}
209-
210199
fn create_file(cx: @crate_ctxt, full_path: str) -> @metadata<file_md> {
211200
let cache = get_cache(cx);;
212201
let tg = FileDescriptorTag;
@@ -216,12 +205,12 @@ fn create_file(cx: @crate_ctxt, full_path: str) -> @metadata<file_md> {
216205
option::none {}
217206
}
218207

219-
let (file_path, work_dir) = get_file_path_and_dir(cx.sess.working_dir,
220-
full_path);
221-
let unit_node = create_compile_unit(cx).node;
208+
let fname = path::basename(full_path);
209+
let path = path::dirname(full_path);
210+
let unit_node = create_compile_unit(cx, full_path).node;
222211
let file_md = [lltag(tg),
223-
llstr(file_path),
224-
llstr(work_dir),
212+
llstr(fname),
213+
llstr(path),
225214
unit_node];
226215
let val = llmdnode(file_md);
227216
let mdval = @{node: val, data: {path: full_path}};
@@ -321,7 +310,7 @@ fn create_basic_type(cx: @crate_ctxt, t: ty::t, ty: ast::prim_ty, span: span)
321310

322311
let fname = filename_from_span(cx, span);
323312
let file_node = create_file(cx, fname);
324-
let cu_node = create_compile_unit(cx);
313+
let cu_node = create_compile_unit(cx, fname);
325314
let (size, align) = size_and_align_of(cx, t);
326315
let lldata = [lltag(tg),
327316
cu_node.node,
@@ -474,7 +463,7 @@ fn create_composite_type(type_tag: int, name: str, file: ValueRef, line: int,
474463
lli32(line), // source line definition
475464
lli64(size), // size of members
476465
lli64(align), // align
477-
lli32/*64*/(offset), // offset
466+
lli64(offset), // offset
478467
lli32(0), // flags
479468
if option::is_none(derived) {
480469
llnull()
@@ -792,9 +781,13 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
792781
option::none {}
793782
}
794783

784+
let path = path_str(fcx.path);
785+
795786
let loc = codemap::lookup_char_pos(cx.sess.codemap,
796787
sp.lo);
797788
let file_node = create_file(cx, loc.file.name).node;
789+
let key = if cx.item_symbols.contains_key(fcx.id) { fcx.id } else { id };
790+
let mangled = cx.item_symbols.get(key);
798791
let ty_node = if cx.sess.opts.extra_debuginfo {
799792
alt ret_ty.node {
800793
ast::ty_nil { llnull() }
@@ -811,17 +804,17 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
811804
llunused(),
812805
file_node,
813806
llstr(ident),
814-
llstr(ident), //XXX fully-qualified C++ name
815-
llstr(""), //XXX MIPS name?????
807+
llstr(path), //XXX fully-qualified C++ name
808+
llstr(mangled), //XXX MIPS name?????
816809
file_node,
817810
lli32(loc.line as int),
818811
sub_node,
819812
lli1(false), //XXX static (check export)
820-
lli1(true), // defined in compilation unit
813+
lli1(true), // not extern
821814
lli32(DW_VIRTUALITY_none), // virtual-ness
822815
lli32(0i), //index into virt func
823-
/*llnull()*/ lli32(0), // base type with vtbl
824-
lli32(256), // flags
816+
llnull(), // base type with vtbl
817+
lli1(false), // artificial
825818
lli1(cx.sess.opts.optimize != 0u),
826819
fcx.llfn
827820
//list of template params
@@ -832,6 +825,5 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
832825
add_named_metadata(cx, "llvm.dbg.sp", val);
833826
let mdval = @{node: val, data: {id: id}};
834827
update_cache(cache, SubprogramTag, subprogram_metadata(mdval));
835-
836828
ret mdval;
837829
}

trunk/src/rustc/middle/ty.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,34 @@ mod unify {
16901690
ret nxt(mk_var(cx.tcx, key));
16911691
}
16921692

1693+
fn record_region_binding<T:copy>(
1694+
cx: @uctxt, key: uint,
1695+
r: region, base_mt: mt, variance: variance,
1696+
nxt: fn(t) -> ures<T>) -> ures<T> {
1697+
1698+
let rb = alt cx.st {
1699+
in_region_bindings(_, rb) { rb }
1700+
in_bindings(_) | precise { fail; }
1701+
};
1702+
1703+
ufind::grow(rb.sets, key + 1u);
1704+
let root = ufind::find(rb.sets, key);
1705+
let mut result_region = r;
1706+
alt smallintmap::find(rb.regions, root) {
1707+
some(old_region) {
1708+
alt unify_regions(cx, old_region, r, variance, {|v| ok(v)}) {
1709+
ok(unified_region) { result_region = unified_region; }
1710+
err(e) { ret err(e); }
1711+
}
1712+
}
1713+
none {/* fall through */ }
1714+
}
1715+
smallintmap::insert(rb.regions, root, result_region);
1716+
1717+
// FIXME: This should be re_var instead.
1718+
ret nxt(mk_rptr(cx.tcx, re_param(key), base_mt));
1719+
}
1720+
16931721
// Simple structural type comparison.
16941722
fn struct_cmp<T:copy>(
16951723
cx: @uctxt, expected: t, actual: t,

trunk/src/rustdoc/astsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn build_session() -> (session::session, @mutable bool) {
155155
let error_handlers = build_error_handlers(codemap);
156156
let {emitter, span_handler, ignore_errors} = error_handlers;
157157

158-
let session = driver::build_session_(sopts, codemap, emitter,
158+
let session = driver::build_session_(sopts, ".", codemap, emitter,
159159
span_handler);
160160
(session, ignore_errors)
161161
}

0 commit comments

Comments
 (0)