Skip to content

Commit d43647b

Browse files
committed
---
yaml --- r: 85997 b: refs/heads/dist-snap c: 874611b h: refs/heads/master i: 85995: f42d827 v: v3
1 parent 46e3149 commit d43647b

Some content is hidden

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

60 files changed

+347
-711
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: bb35e23f1ca63eba4a3ea25ecdf68a393871ed18
9+
refs/heads/dist-snap: 874611b348ba6fc18fb017c9f8a6a46b98ce6c76
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/json.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -1164,6 +1164,9 @@ impl Ord for Json {
11641164
}
11651165
}
11661166
}
1167+
fn le(&self, other: &Json) -> bool { !(*other).lt(&(*self)) }
1168+
fn ge(&self, other: &Json) -> bool { !(*self).lt(other) }
1169+
fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) }
11671170
}
11681171

11691172
/// A trait for converting values to JSON

branches/dist-snap/src/libextra/semver.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -37,6 +37,18 @@ impl cmp::Ord for Identifier {
3737
(&AlphaNumeric(_), _) => false
3838
}
3939
}
40+
#[inline]
41+
fn le(&self, other: &Identifier) -> bool {
42+
! (other < self)
43+
}
44+
#[inline]
45+
fn gt(&self, other: &Identifier) -> bool {
46+
other < self
47+
}
48+
#[inline]
49+
fn ge(&self, other: &Identifier) -> bool {
50+
! (self < other)
51+
}
4052
}
4153

4254
impl ToStr for Identifier {

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 41 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pub mod write {
216216
use lib;
217217

218218
use std::c_str::ToCStr;
219-
use std::libc::{c_uint, c_int};
219+
use std::libc::c_uint;
220220
use std::path::Path;
221221
use std::run;
222222
use std::str;
@@ -257,7 +257,17 @@ pub mod write {
257257
}
258258
}
259259

260-
configure_llvm(sess);
260+
// Copy what clan does by turning on loop vectorization at O2 and
261+
// slp vectorization at O3
262+
let vectorize_loop = !sess.no_vectorize_loops() &&
263+
(sess.opts.optimize == session::Default ||
264+
sess.opts.optimize == session::Aggressive);
265+
let vectorize_slp = !sess.no_vectorize_slp() &&
266+
sess.opts.optimize == session::Aggressive;
267+
llvm::LLVMRustSetLLVMOptions(sess.print_llvm_passes(),
268+
vectorize_loop,
269+
vectorize_slp,
270+
sess.time_llvm_passes());
261271

262272
let OptLevel = match sess.opts.optimize {
263273
session::No => lib::llvm::CodeGenLevelNone,
@@ -283,9 +293,12 @@ pub mod write {
283293
// Create the two optimizing pass managers. These mirror what clang
284294
// does, and are by populated by LLVM's default PassManagerBuilder.
285295
// Each manager has a different set of passes, but they also share
286-
// some common passes.
296+
// some common passes. Each one is initialized with the analyis
297+
// passes the target requires, and then further passes are added.
287298
let fpm = llvm::LLVMCreateFunctionPassManagerForModule(llmod);
288299
let mpm = llvm::LLVMCreatePassManager();
300+
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
301+
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
289302

290303
// If we're verifying or linting, add them to the function pass
291304
// manager.
@@ -295,11 +308,32 @@ pub mod write {
295308
if !sess.no_verify() { assert!(addpass("verify")); }
296309
if sess.lint_llvm() { assert!(addpass("lint")); }
297310

298-
if !sess.no_prepopulate_passes() {
299-
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
300-
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
301-
populate_llvm_passess(fpm, mpm, llmod, OptLevel);
311+
// Create the PassManagerBuilder for LLVM. We configure it with
312+
// reasonable defaults and prepare it to actually populate the pass
313+
// manager.
314+
let builder = llvm::LLVMPassManagerBuilderCreate();
315+
match sess.opts.optimize {
316+
session::No => {
317+
// Don't add lifetime intrinsics add O0
318+
llvm::LLVMRustAddAlwaysInlinePass(builder, false);
319+
}
320+
// numeric values copied from clang
321+
session::Less => {
322+
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder,
323+
225);
324+
}
325+
session::Default | session::Aggressive => {
326+
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder,
327+
275);
328+
}
302329
}
330+
llvm::LLVMPassManagerBuilderSetOptLevel(builder, OptLevel as c_uint);
331+
llvm::LLVMRustAddBuilderLibraryInfo(builder, llmod);
332+
333+
// Use the builder to populate the function/module pass managers.
334+
llvm::LLVMPassManagerBuilderPopulateFunctionPassManager(builder, fpm);
335+
llvm::LLVMPassManagerBuilderPopulateModulePassManager(builder, mpm);
336+
llvm::LLVMPassManagerBuilderDispose(builder);
303337

304338
for pass in sess.opts.custom_passes.iter() {
305339
do pass.with_c_str |s| {
@@ -390,74 +424,6 @@ pub mod write {
390424
sess.abort_if_errors();
391425
}
392426
}
393-
394-
unsafe fn configure_llvm(sess: Session) {
395-
// Copy what clan does by turning on loop vectorization at O2 and
396-
// slp vectorization at O3
397-
let vectorize_loop = !sess.no_vectorize_loops() &&
398-
(sess.opts.optimize == session::Default ||
399-
sess.opts.optimize == session::Aggressive);
400-
let vectorize_slp = !sess.no_vectorize_slp() &&
401-
sess.opts.optimize == session::Aggressive;
402-
403-
let mut llvm_c_strs = ~[];
404-
let mut llvm_args = ~[];
405-
let add = |arg: &str| {
406-
let s = arg.to_c_str();
407-
llvm_args.push(s.with_ref(|p| p));
408-
llvm_c_strs.push(s);
409-
};
410-
add("rustc"); // fake program name
411-
add("-arm-enable-ehabi");
412-
add("-arm-enable-ehabi-descriptors");
413-
if vectorize_loop { add("-vectorize-loops"); }
414-
if vectorize_slp { add("-vectorize-slp"); }
415-
if sess.time_llvm_passes() { add("-time-passes"); }
416-
if sess.print_llvm_passes() { add("-debug-pass=Structure"); }
417-
418-
for arg in sess.opts.llvm_args.iter() {
419-
add(*arg);
420-
}
421-
422-
do llvm_args.as_imm_buf |p, len| {
423-
llvm::LLVMRustSetLLVMOptions(len as c_int, p);
424-
}
425-
}
426-
427-
unsafe fn populate_llvm_passess(fpm: lib::llvm::PassManagerRef,
428-
mpm: lib::llvm::PassManagerRef,
429-
llmod: ModuleRef,
430-
opt: lib::llvm::CodeGenOptLevel) {
431-
// Create the PassManagerBuilder for LLVM. We configure it with
432-
// reasonable defaults and prepare it to actually populate the pass
433-
// manager.
434-
let builder = llvm::LLVMPassManagerBuilderCreate();
435-
match opt {
436-
lib::llvm::CodeGenLevelNone => {
437-
// Don't add lifetime intrinsics add O0
438-
llvm::LLVMRustAddAlwaysInlinePass(builder, false);
439-
}
440-
lib::llvm::CodeGenLevelLess => {
441-
llvm::LLVMRustAddAlwaysInlinePass(builder, true);
442-
}
443-
// numeric values copied from clang
444-
lib::llvm::CodeGenLevelDefault => {
445-
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder,
446-
225);
447-
}
448-
lib::llvm::CodeGenLevelAggressive => {
449-
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder,
450-
275);
451-
}
452-
}
453-
llvm::LLVMPassManagerBuilderSetOptLevel(builder, opt as c_uint);
454-
llvm::LLVMRustAddBuilderLibraryInfo(builder, llmod);
455-
456-
// Use the builder to populate the function/module pass managers.
457-
llvm::LLVMPassManagerBuilderPopulateFunctionPassManager(builder, fpm);
458-
llvm::LLVMPassManagerBuilderPopulateModulePassManager(builder, mpm);
459-
llvm::LLVMPassManagerBuilderDispose(builder);
460-
}
461427
}
462428

463429

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -737,22 +737,13 @@ pub fn build_session_options(binary: @str,
737737
}).collect()
738738
}
739739
};
740-
let llvm_args = match getopts::opt_maybe_str(matches, "llvm-args") {
741-
None => ~[],
742-
Some(s) => {
743-
s.split_iter(|c: char| c == ' ' || c == ',').map(|s| {
744-
s.trim().to_owned()
745-
}).collect()
746-
}
747-
};
748740

749741
let sopts = @session::options {
750742
crate_type: crate_type,
751743
is_static: statik,
752744
gc: gc,
753745
optimize: opt_level,
754746
custom_passes: custom_passes,
755-
llvm_args: llvm_args,
756747
debuginfo: debuginfo,
757748
extra_debuginfo: extra_debuginfo,
758749
lint_opts: lint_opts,
@@ -860,8 +851,6 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
860851
Appends to the default list of passes to run for the \
861852
specified current optimization level. A value of \
862853
\"list\" will list all of the available passes", "NAMES"),
863-
optopt("", "llvm-args", "A list of arguments to pass to llvm, comma \
864-
separated", "ARGS"),
865854
optopt( "", "out-dir",
866855
"Write output to compiler-chosen filename
867856
in <dir>", "DIR"),

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub static once_fns: uint = 1 << 26;
7979
pub static print_llvm_passes: uint = 1 << 27;
8080
pub static no_vectorize_loops: uint = 1 << 28;
8181
pub static no_vectorize_slp: uint = 1 << 29;
82-
pub static no_prepopulate_passes: uint = 1 << 30;
8382

8483
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
8584
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
@@ -127,10 +126,6 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
127126
(~"print-llvm-passes",
128127
~"Prints the llvm optimization passes being run",
129128
print_llvm_passes),
130-
(~"no-prepopulate-passes",
131-
~"Don't pre-populate the pass managers with a list of passes, only use \
132-
the passes from --passes",
133-
no_prepopulate_passes),
134129
(~"no-vectorize-loops",
135130
~"Don't run the loop vectorization optimization passes",
136131
no_vectorize_loops),
@@ -157,7 +152,6 @@ pub struct options {
157152
gc: bool,
158153
optimize: OptLevel,
159154
custom_passes: ~[~str],
160-
llvm_args: ~[~str],
161155
debuginfo: bool,
162156
extra_debuginfo: bool,
163157
lint_opts: ~[(lint::lint, lint::level)],
@@ -326,9 +320,6 @@ impl Session_ {
326320
pub fn print_llvm_passes(@self) -> bool {
327321
self.debugging_opt(print_llvm_passes)
328322
}
329-
pub fn no_prepopulate_passes(@self) -> bool {
330-
self.debugging_opt(no_prepopulate_passes)
331-
}
332323
pub fn no_vectorize_loops(@self) -> bool {
333324
self.debugging_opt(no_vectorize_loops)
334325
}
@@ -360,7 +351,6 @@ pub fn basic_options() -> @options {
360351
gc: false,
361352
optimize: No,
362353
custom_passes: ~[],
363-
llvm_args: ~[],
364354
debuginfo: false,
365355
extra_debuginfo: false,
366356
lint_opts: ~[],

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ pub enum AsmDialect {
191191
AD_Intel = 1
192192
}
193193

194-
#[deriving(Eq)]
195194
pub enum CodeGenOptLevel {
196195
CodeGenLevelNone = 0,
197196
CodeGenLevelLess = 1,
@@ -2124,7 +2123,10 @@ pub mod llvm {
21242123
pub fn LLVMRustPrintModule(PM: PassManagerRef,
21252124
M: ModuleRef,
21262125
Output: *c_char);
2127-
pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: **c_char);
2126+
pub fn LLVMRustSetLLVMOptions(PrintPasses: bool,
2127+
VectorizeLoops: bool,
2128+
VectorizeSLP: bool,
2129+
TimePasses: bool);
21282130
pub fn LLVMRustPrintPasses();
21292131
pub fn LLVMRustSetNormalizedTarget(M: ModuleRef, triple: *c_char);
21302132
pub fn LLVMRustAddAlwaysInlinePass(P: PassManagerBuilderRef,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn check_impl_of_trait(cx: Context, it: @item, trait_ref: &trait_ref, self_type:
129129

130130
// If this trait has builtin-kind supertraits, meet them.
131131
let self_ty: ty::t = ty::node_id_to_type(cx.tcx, it.id);
132-
debug!("checking impl with self type %?", ty::get(self_ty).sty);
132+
error!("checking impl with self type %?", ty::get(self_ty).sty);
133133
do check_builtin_bounds(cx, self_ty, trait_def.bounds) |missing| {
134134
cx.tcx.sess.span_err(self_type.span,
135135
fmt!("the type `%s', which does not fulfill `%s`, cannot implement this \

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ impl Reflector {
252252
let tcx = bcx.ccx().tcx;
253253
let fields = ty::struct_fields(tcx, did, substs);
254254

255-
let extra = ~[self.c_uint(fields.len())]
256-
+ self.c_size_and_align(t);
255+
let extra = ~[self.c_slice(ty_to_str(tcx, t).to_managed()),
256+
self.c_uint(fields.len())] + self.c_size_and_align(t);
257257
do self.bracketed("class", extra) |this| {
258258
for (i, field) in fields.iter().enumerate() {
259259
let extra = ~[this.c_uint(i),

0 commit comments

Comments
 (0)