Skip to content

Commit f7516de

Browse files
committed
---
yaml --- r: 95260 b: refs/heads/dist-snap c: 580adc9 h: refs/heads/master v: v3
1 parent ee12f2a commit f7516de

File tree

12 files changed

+759
-125
lines changed

12 files changed

+759
-125
lines changed

[refs]

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

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

Lines changed: 458 additions & 2 deletions
Large diffs are not rendered by default.

branches/dist-snap/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/dist-snap/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/dist-snap/src/librustc/middle/trans/debuginfo.rs

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

branches/dist-snap/src/libstd/libc.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,9 +2708,12 @@ pub mod funcs {
27082708
pub fn setbuf(stream: *FILE, buf: *c_char);
27092709
// Omitted: printf and scanf variants.
27102710
pub fn fgetc(stream: *FILE) -> c_int;
2711+
#[fast_ffi]
27112712
pub fn fgets(buf: *mut c_char, n: c_int, stream: *FILE)
27122713
-> *c_char;
2714+
#[fast_ffi]
27132715
pub fn fputc(c: c_int, stream: *FILE) -> c_int;
2716+
#[fast_ffi]
27142717
pub fn fputs(s: *c_char, stream: *FILE) -> *c_char;
27152718
// Omitted: getc, getchar (might be macros).
27162719

@@ -2720,11 +2723,13 @@ pub mod funcs {
27202723
// Omitted: putc, putchar (might be macros).
27212724
pub fn puts(s: *c_char) -> c_int;
27222725
pub fn ungetc(c: c_int, stream: *FILE) -> c_int;
2726+
#[fast_ffi]
27232727
pub fn fread(ptr: *mut c_void,
27242728
size: size_t,
27252729
nobj: size_t,
27262730
stream: *FILE)
27272731
-> size_t;
2732+
#[fast_ffi]
27282733
pub fn fwrite(ptr: *c_void,
27292734
size: size_t,
27302735
nobj: size_t,
@@ -2761,9 +2766,13 @@ pub mod funcs {
27612766
-> c_long;
27622767
pub fn strtoul(s: *c_char, endp: **c_char, base: c_int)
27632768
-> c_ulong;
2769+
#[fast_ffi]
27642770
pub fn calloc(nobj: size_t, size: size_t) -> *c_void;
2771+
#[fast_ffi]
27652772
pub fn malloc(size: size_t) -> *c_void;
2773+
#[fast_ffi]
27662774
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
2775+
#[fast_ffi]
27672776
pub fn free(p: *c_void);
27682777
pub fn abort() -> !;
27692778
pub fn exit(status: c_int) -> !;
@@ -2856,6 +2865,7 @@ pub mod funcs {
28562865
#[link_name = "_pclose"]
28572866
pub fn pclose(stream: *FILE) -> c_int;
28582867
#[link_name = "_fdopen"]
2868+
#[fast_ffi]
28592869
pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
28602870
#[link_name = "_fileno"]
28612871
pub fn fileno(stream: *FILE) -> c_int;
@@ -2923,13 +2933,15 @@ pub mod funcs {
29232933
pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int)
29242934
-> c_int;
29252935
#[link_name = "_read"]
2936+
#[fast_ffi]
29262937
pub fn read(fd: c_int, buf: *mut c_void, count: c_uint)
29272938
-> c_int;
29282939
#[link_name = "_rmdir"]
29292940
pub fn rmdir(path: *c_char) -> c_int;
29302941
#[link_name = "_unlink"]
29312942
pub fn unlink(c: *c_char) -> c_int;
29322943
#[link_name = "_write"]
2944+
#[fast_ffi]
29332945
pub fn write(fd: c_int, buf: *c_void, count: c_uint) -> c_int;
29342946
}
29352947
}
@@ -3083,6 +3095,7 @@ pub mod funcs {
30833095
pub fn pathconf(path: *c_char, name: c_int) -> c_long;
30843096
pub fn pause() -> c_int;
30853097
pub fn pipe(fds: *mut c_int) -> c_int;
3098+
#[fast_ffi]
30863099
pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
30873100
-> ssize_t;
30883101
pub fn rmdir(path: *c_char) -> c_int;
@@ -3095,6 +3108,7 @@ pub mod funcs {
30953108
pub fn tcgetpgrp(fd: c_int) -> pid_t;
30963109
pub fn ttyname(fd: c_int) -> *c_char;
30973110
pub fn unlink(c: *c_char) -> c_int;
3111+
#[fast_ffi]
30983112
pub fn write(fd: c_int, buf: *c_void, count: size_t)
30993113
-> ssize_t;
31003114
}

branches/dist-snap/src/libstd/rt/local_heap.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,25 @@ pub fn live_allocs() -> *raw::Box<()> {
107107
}
108108

109109
extern {
110+
#[fast_ffi]
110111
fn rust_new_memory_region(detailed_leaks: uintptr_t,
111112
poison_on_free: uintptr_t) -> *MemoryRegion;
113+
#[fast_ffi]
112114
fn rust_delete_memory_region(region: *MemoryRegion);
115+
#[fast_ffi]
113116
fn rust_new_boxed_region(region: *MemoryRegion,
114117
poison_on_free: uintptr_t) -> *BoxedRegion;
118+
#[fast_ffi]
115119
fn rust_delete_boxed_region(region: *BoxedRegion);
120+
#[fast_ffi]
116121
fn rust_boxed_region_malloc(region: *BoxedRegion,
117122
td: *TypeDesc,
118123
size: size_t) -> *OpaqueBox;
124+
#[fast_ffi]
119125
fn rust_boxed_region_realloc(region: *BoxedRegion,
120126
ptr: *OpaqueBox,
121127
size: size_t) -> *OpaqueBox;
128+
#[fast_ffi]
122129
fn rust_boxed_region_free(region: *BoxedRegion, box: *OpaqueBox);
123130
}
124131

branches/dist-snap/src/libstd/rt/thread_local_storage.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ type pthread_key_t = ::libc::c_uint;
5252

5353
#[cfg(unix)]
5454
extern {
55+
#[fast_ffi]
5556
fn pthread_key_create(key: *mut pthread_key_t, dtor: *u8) -> c_int;
57+
#[fast_ffi]
5658
fn pthread_setspecific(key: pthread_key_t, value: *mut c_void) -> c_int;
59+
#[fast_ffi]
5760
fn pthread_getspecific(key: pthread_key_t) -> *mut c_void;
5861
}
5962

branches/dist-snap/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/dist-snap/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/dist-snap/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(

branches/dist-snap/src/test/bench/shootout-pidigits.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,31 @@ impl mpz_t {
2424

2525
#[link_args="-lgmp"]
2626
extern {
27+
#[fast_ffi]
2728
#[link_name="__gmpz_add"]
2829
fn mpz_add(x: *mpz_t, y: *mpz_t, z: *mpz_t);
30+
#[fast_ffi]
2931
#[link_name="__gmpz_cmp"]
3032
fn mpz_cmp(x: *mpz_t, y: *mpz_t) -> c_int;
33+
#[fast_ffi]
3134
#[link_name="__gmpz_fdiv_qr"]
3235
fn mpz_fdiv_qr(a: *mpz_t, b: *mpz_t, c: *mpz_t, d: *mpz_t);
36+
#[fast_ffi]
3337
#[link_name="__gmpz_get_ui"]
3438
fn mpz_get_ui(x: *mpz_t) -> c_uint;
39+
#[fast_ffi]
3540
#[link_name="__gmpz_init"]
3641
fn mpz_init(x: *mpz_t);
42+
#[fast_ffi]
3743
#[link_name="__gmpz_init_set_ui"]
3844
fn mpz_init_set_ui(x: *mpz_t, y: c_uint);
45+
#[fast_ffi]
3946
#[link_name="__gmpz_mul_2exp"]
4047
fn mpz_mul_2exp(x: *mpz_t, y: *mpz_t, z: c_uint);
48+
#[fast_ffi]
4149
#[link_name="__gmpz_mul_ui"]
4250
fn mpz_mul_ui(x: *mpz_t, y: *mpz_t, z: c_uint);
51+
#[fast_ffi]
4352
#[link_name="__gmpz_submul_ui"]
4453
fn mpz_submul_ui(x: *mpz_t, y: *mpz_t, z: c_uint);
4554
}

0 commit comments

Comments
 (0)