Skip to content

Commit 4e3479f

Browse files
committed
---
yaml --- r: 234796 b: refs/heads/tmp c: 9ba5db6 h: refs/heads/master v: v3
1 parent a7868c1 commit 4e3479f

File tree

16 files changed

+46
-155
lines changed

16 files changed

+46
-155
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 7e8d19b24de6d06e4962c5959d00603c3239ac8c
28+
refs/heads/tmp: 9ba5db6690929eb0595582908dadbb4e773fbf98
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/doc/complement-project-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Existing languages at this level of abstraction and efficiency are unsatisfactor
2222

2323
# Is any part of this thing production-ready?
2424

25-
Yes!
25+
No. Feel free to play around, but don't expect completeness or stability yet. Expect incompleteness and breakage.
2626

2727
# Is this a completely Mozilla-planned and orchestrated thing?
2828

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ let err2: Box<Error> = From::from(parse_err);
12231223

12241224
There is a really important pattern to recognize here. Both `err1` and `err2`
12251225
have the *same type*. This is because they are existentially quantified types,
1226-
or trait objects. In particular, their underlying type is *erased* from the
1226+
or trait objects. In particularly, their underlying type is *erased* from the
12271227
compiler's knowledge, so it truly sees `err1` and `err2` as exactly the same.
12281228
Additionally, we constructed `err1` and `err2` using precisely the same
12291229
function call: `From::from`. This is because `From::from` is overloaded on both

branches/tmp/src/libcollections/vec.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use alloc::heap::EMPTY;
6565
use core::cmp::Ordering;
6666
use core::fmt;
6767
use core::hash::{self, Hash};
68-
use core::intrinsics::{arith_offset, assume, drop_in_place, needs_drop};
68+
use core::intrinsics::{arith_offset, assume, drop_in_place};
6969
use core::iter::FromIterator;
7070
use core::mem;
7171
use core::ops::{Index, IndexMut, Deref};
@@ -1322,14 +1322,8 @@ impl<T> Drop for Vec<T> {
13221322
// OK because exactly when this stops being a valid assumption, we
13231323
// don't need unsafe_no_drop_flag shenanigans anymore.
13241324
if self.buf.unsafe_no_drop_flag_needs_drop() {
1325-
unsafe {
1326-
// The branch on needs_drop() is an -O1 performance optimization.
1327-
// Without the branch, dropping Vec<u8> takes linear time.
1328-
if needs_drop::<T>() {
1329-
for x in self.iter_mut() {
1330-
drop_in_place(x);
1331-
}
1332-
}
1325+
for x in self.iter_mut() {
1326+
unsafe { drop_in_place(x); }
13331327
}
13341328
}
13351329
// RawVec handles deallocation

branches/tmp/src/libcore/ptr.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,6 @@ fnptr_impls_args! { A, B }
385385
fnptr_impls_args! { A, B, C }
386386
fnptr_impls_args! { A, B, C, D }
387387
fnptr_impls_args! { A, B, C, D, E }
388-
fnptr_impls_args! { A, B, C, D, E, F }
389-
fnptr_impls_args! { A, B, C, D, E, F, G }
390-
fnptr_impls_args! { A, B, C, D, E, F, G, H }
391-
fnptr_impls_args! { A, B, C, D, E, F, G, H, I }
392-
fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J }
393-
fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J, K }
394-
fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J, K, L }
395388

396389
// Comparison for pointers
397390
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/librustc_front/hir.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// The Rust HIR.
1212

13+
pub use self::AsmDialect::*;
1314
pub use self::BindingMode::*;
1415
pub use self::BinOp_::*;
1516
pub use self::BlockCheckMode::*;
@@ -40,7 +41,7 @@ pub use self::PathParameters::*;
4041

4142
use syntax::codemap::{self, Span, Spanned, DUMMY_SP, ExpnId};
4243
use syntax::abi::Abi;
43-
use syntax::ast::{Name, Ident, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect};
44+
use syntax::ast::{Name, Ident, NodeId, DUMMY_NODE_ID, TokenTree};
4445
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, CrateConfig};
4546
use syntax::owned_slice::OwnedSlice;
4647
use syntax::parse::token::InternedString;
@@ -875,6 +876,12 @@ pub enum Ty_ {
875876
TyInfer,
876877
}
877878

879+
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
880+
pub enum AsmDialect {
881+
AsmAtt,
882+
AsmIntel
883+
}
884+
878885
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
879886
pub struct InlineAsm {
880887
pub asm: InternedString,

branches/tmp/src/librustc_front/lowering.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ pub fn lower_expr(e: &Expr) -> P<hir::Expr> {
801801
clobbers: clobbers.clone(),
802802
volatile: volatile,
803803
alignstack: alignstack,
804-
dialect: dialect,
804+
dialect: lower_asm_dialect(dialect),
805805
expn_id: expn_id,
806806
}),
807807
ExprStruct(ref path, ref fields, ref maybe_expr) => {
@@ -863,6 +863,13 @@ pub fn lower_capture_clause(c: CaptureClause) -> hir::CaptureClause {
863863
}
864864
}
865865

866+
pub fn lower_asm_dialect(a: AsmDialect) -> hir::AsmDialect {
867+
match a {
868+
AsmAtt => hir::AsmAtt,
869+
AsmIntel => hir::AsmIntel,
870+
}
871+
}
872+
866873
pub fn lower_visibility(v: Visibility) -> hir::Visibility {
867874
match v {
868875
Public => hir::Public,

branches/tmp/src/librustc_front/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ impl<'a> State<'a> {
15391539
if a.alignstack {
15401540
options.push("alignstack");
15411541
}
1542-
if a.dialect == ast::AsmDialect::Intel {
1542+
if a.dialect == hir::AsmDialect::AsmIntel {
15431543
options.push("intel");
15441544
}
15451545

branches/tmp/src/librustc_trans/back/lto.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use llvm;
1515
use llvm::archive_ro::ArchiveRO;
1616
use llvm::{ModuleRef, TargetMachineRef, True, False};
1717
use rustc::util::common::time;
18+
use rustc::util::common::path2cstr;
1819
use back::write::{ModuleConfig, with_llvm_pmb};
1920

2021
use libc;
@@ -24,7 +25,9 @@ use std::ffi::CString;
2425

2526
pub fn run(sess: &session::Session, llmod: ModuleRef,
2627
tm: TargetMachineRef, reachable: &[String],
27-
config: &ModuleConfig) {
28+
config: &ModuleConfig,
29+
name_extra: &str,
30+
output_names: &config::OutputFilenames) {
2831
if sess.opts.cg.prefer_dynamic {
2932
sess.err("cannot prefer dynamic linking when performing LTO");
3033
sess.note("only 'staticlib' and 'bin' outputs are supported with LTO");
@@ -124,6 +127,14 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
124127
}
125128
}
126129

130+
if sess.opts.cg.save_temps {
131+
let path = output_names.with_extension(&format!("{}.no-opt.lto.bc", name_extra));
132+
let cstr = path2cstr(&path);
133+
unsafe {
134+
llvm::LLVMWriteBitcodeToFile(llmod, cstr.as_ptr());
135+
}
136+
}
137+
127138
// Now we have one massive module inside of llmod. Time to run the
128139
// LTO-specific optimization passes that LLVM provides.
129140
//

branches/tmp/src/librustc_trans/back/write.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ unsafe fn optimize_and_codegen(cgcx: &CodegenContext,
496496
match cgcx.lto_ctxt {
497497
Some((sess, reachable)) if sess.lto() => {
498498
time(sess.time_passes(), "all lto passes", ||
499-
lto::run(sess, llmod, tm, reachable, &config));
499+
lto::run(sess, llmod, tm, reachable, &config,
500+
&name_extra, &output_names));
500501

501502
if config.emit_lto_bc {
502503
let name = format!("{}.lto.bc", name_extra);

branches/tmp/src/librustc_trans/trans/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use trans::type_::Type;
2222

2323
use rustc_front::hir as ast;
2424
use std::ffi::CString;
25-
use syntax::ast::AsmDialect;
2625
use libc::{c_uint, c_char};
2726

2827
// Take an inline assembly expression and splat it out via LLVM
@@ -106,8 +105,8 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
106105
};
107106

108107
let dialect = match ia.dialect {
109-
AsmDialect::Att => llvm::AD_ATT,
110-
AsmDialect::Intel => llvm::AD_Intel
108+
ast::AsmAtt => llvm::AD_ATT,
109+
ast::AsmIntel => llvm::AD_Intel
111110
};
112111

113112
let asm = CString::new(ia.asm.as_bytes()).unwrap();

branches/tmp/src/libsyntax/ast.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// The Rust abstract syntax tree.
1212

13+
pub use self::AsmDialect::*;
1314
pub use self::AttrStyle::*;
1415
pub use self::BindingMode::*;
1516
pub use self::BinOp_::*;
@@ -1439,8 +1440,8 @@ pub enum Ty_ {
14391440

14401441
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
14411442
pub enum AsmDialect {
1442-
Att,
1443-
Intel,
1443+
AsmAtt,
1444+
AsmIntel
14441445
}
14451446

14461447
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]

branches/tmp/src/libsyntax/ext/asm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use feature_gate;
2222
use parse::token::{intern, InternedString};
2323
use parse::token;
2424
use ptr::P;
25-
use syntax::ast::AsmDialect;
2625

2726
enum State {
2827
Asm,
@@ -66,7 +65,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
6665
let mut clobs = Vec::new();
6766
let mut volatile = false;
6867
let mut alignstack = false;
69-
let mut dialect = AsmDialect::Att;
68+
let mut dialect = ast::AsmAtt;
7069

7170
let mut state = Asm;
7271

@@ -179,7 +178,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
179178
} else if option == "alignstack" {
180179
alignstack = true;
181180
} else if option == "intel" {
182-
dialect = AsmDialect::Intel;
181+
dialect = ast::AsmIntel;
183182
} else {
184183
cx.span_warn(p.last_span, "unrecognized option");
185184
}

branches/tmp/src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@ impl<'a> State<'a> {
22092209
if a.alignstack {
22102210
options.push("alignstack");
22112211
}
2212-
if a.dialect == ast::AsmDialect::Intel {
2212+
if a.dialect == ast::AsmDialect::AsmIntel {
22132213
options.push("intel");
22142214
}
22152215

branches/tmp/src/test/bench/shootout-fasta-redux.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
use std::cmp::min;
4242
use std::env;
4343
use std::io;
44-
use std::io::BufWriter;
4544
use std::io::prelude::*;
4645

4746
const LINE_LEN: usize = 60;
@@ -215,7 +214,7 @@ fn main() {
215214
};
216215

217216
let stdout = io::stdout();
218-
let mut out = BufWriter::new(stdout.lock());
217+
let mut out = stdout.lock();
219218

220219
out.write_all(b">ONE Homo sapiens alu\n").unwrap();
221220
{

branches/tmp/src/test/run-pass/issue-28561.rs

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)