summary refs log tree commit diff
path: root/src/librustc/driver
AgeCommit message (Collapse)AuthorLines
2013-09-24Correctly encode item visibility in metadataAlex Crichton-2/+5
This fixes private statics and functions from being usable cross-crates, along with some bad privacy error messages. This is a reopening of #8365 with all the privacy checks in privacy.rs instead of resolve.rs (where they should be anyway). These maps of exported items will hopefully get used for generating documentation by rustdoc Closes #8592
2013-09-23test: Fix rustdoc and tests.Patrick Walton-4/+12
2013-09-23librustc: Remove the remaining direct uses of `@fn` from librustc.Patrick Walton-12/+12
2013-09-23librustc: Port the pretty printer annotation infrastructure to use traits ↵Patrick Walton-40/+75
instead of garbage collected functions.
2013-09-19Turned extra::getopts functions into methodsMarvin Löbel-34/+31
Some minor api and doc adjustments
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-1/+1
2013-09-12std: rename Option::unwrap_or_default() to unwrap_or()Erick Tryzelaar-3/+3
2013-09-10Delay assignment of node ids until after expansion. Ensures that each AST nodeNiko Matsakis-46/+61
has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-02turn off android ndk asm passIlyong Cho-3/+1
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-2/+2
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-50/+50
2013-08-30Tweak pass management and add some more optionsAlex Crichton-0/+21
The only changes to the default passes is that O1 now doesn't run the inline pass, just always-inline with lifetime intrinsics. O2 also now has a threshold of 225 instead of 275. Otherwise the default passes being run is the same. I've also added a few more options for configuring the pass pipeline. Namely you can now specify arguments to LLVM directly via the `--llvm-args` command line option which operates similarly to `--passes`. I also added the ability to turn off pre-population of the pass manager in case you want to run *only* your own passes.
2013-08-26Rewrite pass management with LLVMAlex Crichton-2/+24
Beforehand, it was unclear whether rust was performing the "recommended set" of optimizations provided by LLVM for code. This commit changes the way we run passes to closely mirror that of clang, which in theory does it correctly. The notable changes include: * Passes are no longer explicitly added one by one. This would be difficult to keep up with as LLVM changes and we don't guaranteed always know the best order in which to run passes * Passes are now managed by LLVM's PassManagerBuilder object. This is then used to populate the various pass managers run. * We now run both a FunctionPassManager and a module-wide PassManager. This is what clang does, and I presume that we *may* see a speed boost from the module-wide passes just having to do less work. I have no measured this. * The codegen pass manager has been extracted to its own separate pass manager to not get mixed up with the other passes * All pass managers now include passes for target-specific data layout and analysis passes Some new features include: * You can now print all passes being run with `-Z print-llvm-passes` * When specifying passes via `--passes`, the passes are now appended to the default list of passes instead of overwriting them. * The output of `--passes list` is now generated by LLVM instead of maintaining a list of passes ourselves * Loop vectorization is turned on by default as an optimization pass and can be disabled with `-Z no-vectorize-loops`
2013-08-24librustc: Always use session target triple.Luqman Aden-4/+5
2013-08-22Cleanup assembly source.Vadim Chugunov-3/+8
2013-08-22Compile via external assembler on Windows.Vadim Chugunov-3/+8
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-5/+4
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-2/+6
2013-08-19Issue #3678: Remove wrappers and call foreign functions directlyNiko Matsakis-0/+3
2013-08-16debuginfo: Added test cases for generic structs and enums.Michael Woerister-0/+8
Also, always set no_monomorphic_collapse flags if debuginfo is generated.
2013-08-13Remove unused automatic cfg bindings Fixes #7169Nick Desaulniers-16/+13
2013-08-12fix build with the new snapshot compilerDaniel Micay-19/+0
2013-08-11auto merge of #8410 : luqmana/rust/mcpu, r=sanxiynbors-13/+11
Adds `--target-cpu` flag which lets you choose a more specific target cpu instead of just passing the default, `generic`. It's more or less akin to `-mcpu`/`-mtune` in clang/gcc.
2013-08-11librustc: Convert from `@Object` to `@mut Object` as neededNiko Matsakis-3/+3
2013-08-10rustc: Add --target-cpu flag to select a more specific processor instead of ↵Luqman Aden-13/+11
the default, 'generic'.
2013-08-10std: Transform.find_ -> .findErick Tryzelaar-1/+1
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-3/+3
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-2/+2
cc #7887
2013-08-09auto merge of #8362 : sfackler/rust/env, r=alexcrichtonbors-1/+15
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Fixes #2248.
2013-08-08auto merge of #8350 : dim-an/rust/fix-struct-match, r=pcwaltonbors-1/+2
Code that collects fields in struct-like patterns used to ignore wildcard patterns like `Foo{_}`. But `enter_defaults` considered struct-like patterns as default in order to overcome this (accoring to my understanding of situation). However such behaviour caused code like this: ``` enum E { Foo{f: int}, Bar } let e = Bar; match e { Foo{f: _f} => { /* do something (1) */ } _ => { /* do something (2) */ } } ``` consider pattern `Foo{f: _f}` as default. That caused inproper behaviour and even segfaults while trying to destruct `Bar` as `Foo{f: _f}`. Issues: #5625 , #5530. This patch fixes `collect_record_or_struct_fields` to split cases of single wildcard struct-like pattern and no struct-like pattern at all. Former case resolved with `enter_rec_or_struct` (and not with `enter_defaults`). Closes #5625. Closes #5530.
2013-08-08env! syntax extension changesSteven Fackler-1/+15
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Close #2248
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-2/+1
2013-08-06Better documentation for --emit-llvm option.Dmitry Ermolov-1/+2
Document possible use with -S option.
2013-08-06auto merge of #8313 : msullivan/rust/cleanup, r=catamorphismbors-7/+6
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-1/+1
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-05Warn when using -o option on libraries. Closes #6554.Michael Sullivan-7/+6
2013-08-05auto merge of #8279 : pcwalton/rust/no-main, r=brsonbors-1/+2
Useful for SDL and possibly Android too. r? @brson
2013-08-04Add support for vanilla linux on arm.Luqman Aden-1/+1
2013-08-03librustc: Implement `#[no_main]`, which omits the entry point entirely.Patrick Walton-1/+2
Useful for SDL and possibly Android too.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-6/+6
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-6/+6
2013-07-29New naming convention for ast::{node_id, local_crate, crate_node_id, ↵Michael Woerister-6/+6
blk_check_mode, ty_field, ty_method}
2013-07-28Free intermediate translation results as soon as possibleBjörn Steinbrink-6/+13
This fixes the recently introduced peak memory usage regression by freeing the intermediate results as soon as they're not required anymore instead of keeping them around for the whole compilation process. Refs #8077
2013-07-27rustc: reorganize driver, replace compile_upto with multiple more-obvious ↵Graydon Hoare-224/+243
functions.
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-21/+22
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-37/+21
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-2/+3
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-23/+45
2013-07-17Made ast::blk not use spanned<T> anymore.Michael Woerister-1/+1
2013-07-16syntax: make a macros-injection pass; conditionally define debug! to a noop ↵Huon Wilson-1/+5
based on cfg(debug). Macros can be conditionally defined because stripping occurs before macro expansion, but, the built-in macros were only added as part of the actual expansion process and so couldn't be stripped to have definitions conditional on cfg flags. debug! is defined conditionally in terms of the debug config, expanding to nothing unless the --cfg debug flag is passed (to be precise it expands to `if false { normal_debug!(...) }` so that they are still type checked, and to avoid unused variable lints).