Skip to content

Commit 445c525

Browse files
committed
---
yaml --- r: 83772 b: refs/heads/try c: 580adc9 h: refs/heads/master v: v3
1 parent d213525 commit 445c525

File tree

8 files changed

+269
-125
lines changed

8 files changed

+269
-125
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 5c8c8bc9662269d977fe897b4cb7afa805724d78
5+
refs/heads/try: 580adc9ad38bfe3585e8d17ba9ad4766cbc1ff1c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,8 +1968,7 @@ pub mod llvm {
19681968
DerivedFrom: DIType,
19691969
Elements: DIArray,
19701970
RunTimeLang: c_uint,
1971-
VTableHolder: ValueRef,
1972-
UniqueId: *c_char)
1971+
VTableHolder: ValueRef)
19731972
-> DICompositeType;
19741973

19751974
#[fast_ffi]

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,6 +3119,11 @@ pub fn trans_crate(sess: session::Session,
31193119
symbol_hasher,
31203120
link_meta,
31213121
analysis.reachable);
3122+
3123+
if ccx.sess.opts.debuginfo {
3124+
debuginfo::initialize(ccx, &crate);
3125+
}
3126+
31223127
{
31233128
let _icx = push_ctxt("text");
31243129
trans_mod(ccx, &crate.module);

branches/try/src/librustc/middle/trans/common.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool {
7070
return true;
7171
}
7272
match ty::get(ty).sty {
73-
ty::ty_struct(*) | ty::ty_enum(*) | ty::ty_tup(*) => {
73+
// FIXME: #9651: small `ty_struct` should also be immediate
74+
ty::ty_struct(def_id, ref substs) => {
75+
ty::struct_fields(tcx, def_id, substs).is_empty()
76+
}
77+
ty::ty_enum(*) | ty::ty_tup(*) => {
7478
let llty = sizing_type_of(ccx, ty);
7579
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type)
7680
}

branches/try/src/librustc/middle/trans/debuginfo.rs

Lines changed: 210 additions & 94 deletions
Large diffs are not rendered by default.

branches/try/src/libstd/unstable/sync.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use vec;
2626
/// An atomically reference counted pointer.
2727
///
2828
/// Enforces no shared-memory safety.
29-
//#[unsafe_no_drop_flag] FIXME: #9758
29+
#[unsafe_no_drop_flag]
3030
pub struct UnsafeArc<T> {
3131
data: *mut ArcData<T>,
3232
}
@@ -427,8 +427,6 @@ mod tests {
427427
use util;
428428
use sys::size_of;
429429

430-
//#[unsafe_no_drop_flag] FIXME: #9758
431-
#[ignore]
432430
#[test]
433431
fn test_size() {
434432
assert_eq!(size_of::<UnsafeArc<[int, ..10]>>(), size_of::<*[int, ..10]>());

branches/try/src/libsyntax/parse/token.rs

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ pub mod special_idents {
326326
pub static unary_minus_fn : Ident = Ident { name: 6, ctxt: 0}; // apparently unused?
327327
pub static clownshoes_extensions : Ident = Ident { name: 7, ctxt: 0};
328328

329-
pub static self_ : Ident = Ident { name: 8, ctxt: 0}; // 'self'
329+
pub static self_ : Ident = Ident { name: super::SELF_KEYWORD_NAME, ctxt: 0}; // 'self'
330330

331331
/* for matcher NTs */
332332
// none of these appear to be used, but perhaps references to
@@ -352,7 +352,7 @@ pub mod special_idents {
352352
pub static main : Ident = Ident { name: 24, ctxt: 0};
353353
pub static opaque : Ident = Ident { name: 25, ctxt: 0};
354354
pub static blk : Ident = Ident { name: 26, ctxt: 0};
355-
pub static statik : Ident = Ident { name: 27, ctxt: 0};
355+
pub static statik : Ident = Ident { name: super::STATIC_KEYWORD_NAME, ctxt: 0};
356356
pub static clownshoes_foreign_mod: Ident = Ident { name: 28, ctxt: 0};
357357
pub static unnamed_field: Ident = Ident { name: 29, ctxt: 0};
358358
pub static c_abi: Ident = Ident { name: 30, ctxt: 0}; // apparently unused?
@@ -414,8 +414,9 @@ pub type ident_interner = StrInterner;
414414

415415
// return a fresh interner, preloaded with special identifiers.
416416
fn mk_fresh_ident_interner() -> @ident_interner {
417-
// the indices here must correspond to the numbers in
418-
// special_idents.
417+
// The indices here must correspond to the numbers in
418+
// special_idents, in Keyword to_ident(), and in static
419+
// constants below.
419420
let init_vec = ~[
420421
"_", // 0
421422
"anon", // 1
@@ -473,8 +474,8 @@ fn mk_fresh_ident_interner() -> @ident_interner {
473474
"pub", // 52
474475
"ref", // 53
475476
"return", // 54
476-
"static", // 27 -- also a special ident
477-
"self", // 8 -- also a special ident
477+
"static", // 27 -- also a special ident (prefill de-dupes)
478+
"self", // 8 -- also a special ident (prefill de-dupes)
478479
"struct", // 55
479480
"super", // 56
480481
"true", // 57
@@ -498,6 +499,32 @@ fn mk_fresh_ident_interner() -> @ident_interner {
498499
@interner::StrInterner::prefill(init_vec)
499500
}
500501

502+
// NOTE remove stage0 pub'ed special cases after next snapshot.
503+
#[cfg(stage0)]
504+
pub static SELF_KEYWORD_NAME: uint = 8;
505+
#[cfg(not(stage0))]
506+
static SELF_KEYWORD_NAME: uint = 8;
507+
#[cfg(stage0)]
508+
pub static STATIC_KEYWORD_NAME: uint = 27;
509+
#[cfg(not(stage0))]
510+
static STATIC_KEYWORD_NAME: uint = 27;
511+
#[cfg(stage0)]
512+
pub static STRICT_KEYWORD_START: uint = 32;
513+
#[cfg(not(stage0))]
514+
static STRICT_KEYWORD_START: uint = 32;
515+
#[cfg(stage0)]
516+
pub static STRICT_KEYWORD_FINAL: uint = 64;
517+
#[cfg(not(stage0))]
518+
static STRICT_KEYWORD_FINAL: uint = 64;
519+
#[cfg(stage0)]
520+
pub static RESERVED_KEYWORD_START: uint = 65;
521+
#[cfg(not(stage0))]
522+
static RESERVED_KEYWORD_START: uint = 65;
523+
#[cfg(stage0)]
524+
pub static RESERVED_KEYWORD_FINAL: uint = 71;
525+
#[cfg(not(stage0))]
526+
static RESERVED_KEYWORD_FINAL: uint = 71;
527+
501528
// if an interner exists in TLS, return it. Otherwise, prepare a
502529
// fresh one.
503530
pub fn get_ident_interner() -> @ident_interner {
@@ -675,8 +702,8 @@ pub mod keywords {
675702
Pub => Ident { name: 52, ctxt: 0 },
676703
Ref => Ident { name: 53, ctxt: 0 },
677704
Return => Ident { name: 54, ctxt: 0 },
678-
Static => Ident { name: 27, ctxt: 0 },
679-
Self => Ident { name: 8, ctxt: 0 },
705+
Static => Ident { name: super::STATIC_KEYWORD_NAME, ctxt: 0 },
706+
Self => Ident { name: super::SELF_KEYWORD_NAME, ctxt: 0 },
680707
Struct => Ident { name: 55, ctxt: 0 },
681708
Super => Ident { name: 56, ctxt: 0 },
682709
True => Ident { name: 57, ctxt: 0 },
@@ -709,7 +736,8 @@ pub fn is_keyword(kw: keywords::Keyword, tok: &Token) -> bool {
709736
pub fn is_any_keyword(tok: &Token) -> bool {
710737
match *tok {
711738
token::IDENT(sid, false) => match sid.name {
712-
8 | 27 | 32 .. 70 => true,
739+
SELF_KEYWORD_NAME | STATIC_KEYWORD_NAME |
740+
STRICT_KEYWORD_START .. RESERVED_KEYWORD_FINAL => true,
713741
_ => false,
714742
},
715743
_ => false
@@ -719,7 +747,8 @@ pub fn is_any_keyword(tok: &Token) -> bool {
719747
pub fn is_strict_keyword(tok: &Token) -> bool {
720748
match *tok {
721749
token::IDENT(sid, false) => match sid.name {
722-
8 | 27 | 32 .. 64 => true,
750+
SELF_KEYWORD_NAME | STATIC_KEYWORD_NAME |
751+
STRICT_KEYWORD_START .. STRICT_KEYWORD_FINAL => true,
723752
_ => false,
724753
},
725754
_ => false,
@@ -729,7 +758,7 @@ pub fn is_strict_keyword(tok: &Token) -> bool {
729758
pub fn is_reserved_keyword(tok: &Token) -> bool {
730759
match *tok {
731760
token::IDENT(sid, false) => match sid.name {
732-
65 .. 71 => true,
761+
RESERVED_KEYWORD_START .. RESERVED_KEYWORD_FINAL => true,
733762
_ => false,
734763
},
735764
_ => false,

branches/try/src/rustllvm/RustWrapper.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -548,21 +548,14 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateStructType(
548548
LLVMValueRef DerivedFrom,
549549
LLVMValueRef Elements,
550550
unsigned RunTimeLang,
551-
LLVMValueRef VTableHolder,
552-
const char *UniqueId) {
551+
LLVMValueRef VTableHolder) {
553552
return wrap(Builder->createStructType(
554-
unwrapDI<DIDescriptor>(Scope),
555-
Name,
556-
unwrapDI<DIFile>(File),
557-
LineNumber,
558-
SizeInBits,
559-
AlignInBits,
560-
Flags,
553+
unwrapDI<DIDescriptor>(Scope), Name,
554+
unwrapDI<DIFile>(File), LineNumber,
555+
SizeInBits, AlignInBits, Flags,
561556
unwrapDI<DIType>(DerivedFrom),
562-
unwrapDI<DIArray>(Elements),
563-
RunTimeLang,
564-
unwrapDI<MDNode*>(VTableHolder),
565-
UniqueId));
557+
unwrapDI<DIArray>(Elements), RunTimeLang,
558+
unwrapDI<MDNode*>(VTableHolder)));
566559
}
567560

568561
extern "C" LLVMValueRef LLVMDIBuilderCreateMemberType(

0 commit comments

Comments
 (0)