about summary refs log tree commit diff
path: root/src/librustc_incremental
AgeCommit message (Collapse)AuthorLines
2016-11-29Split nested_visit_mode function off from nested_visit_mapFlorian Diebold-2/+4
... and make the latter mandatory to implement.
2016-11-29Add make tidy fixesFlorian Diebold-1/+4
2016-11-29Give function bodies their own dep graph nodeFlorian Diebold-17/+43
2016-11-29rustc_incremental: fix compilationFlorian Diebold-12/+0
2016-11-29rustc_incremental: fix compilationFlorian Diebold-0/+12
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-13/+7
2016-11-28rustc: desugar `use a::{b,c};` into `use a::b; use a::c;` in HIR.Eduard-Mihai Burtescu-11/+2
2016-11-28rustc: desugar UFCS as much as possible during HIR lowering.Eduard Burtescu-4/+12
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-2/+2
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-21Fix incremental compilation hashing.Jeffrey Seyfried-16/+20
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-9/+8
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-8/+9
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-1/+1
2016-11-20Move `MetaItemKind`'s `Name` to a field of `MetaItem`.Jeffrey Seyfried-12/+10
2016-11-20Refactor `CrateConfig`.Jeffrey Seyfried-12/+5
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-12/+14
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-1/+1
2016-11-18Add span to warning about incr. comp. vs Token::Interpolated.Michael Woerister-4/+6
2016-11-18Remove outdated comment about SVH.Michael Woerister-5/+0
2016-11-18ICH: Hash MacroDefs in a mostly stable way.Michael Woerister-3/+143
2016-11-18Add error message when not finding the ICH of a DepNode.Michael Woerister-1/+6
2016-11-17canonicalize base incremental path on windowsNiko Matsakis-0/+13
This sidesteps problems with long paths because the canonical path includes the "magic long path prefix" on Windows.
2016-11-17hash the contents of impl-item-ref by adding them to visitorNiko Matsakis-0/+14
Also simplify some of the `ty::AssociatedItem` representation, in particular by folding `has_value` into `hir::Defaultness`
2016-11-16add a `nested_visit_map` methodNiko Matsakis-8/+0
This allows you to enable *all* nested visits in a future-compatible sort of way. Moreover, if you choose to override the `visit_nested` methods yourself, you can "future-proof" against omissions by overriding `nested_visit_map` to panic.
2016-11-16fix dep-graph checking to account for implitemsNiko Matsakis-2/+2
2016-11-16make distinct Hir() nodes in the graph for impl itemsNiko Matsakis-4/+7
2016-11-16fallout from separating impl-items from implsNiko Matsakis-0/+16
Basically adding `visit_impl_item` in various places and so forth.
2016-11-16refactor Visitor into ItemLikeVisitor and intravisit::VisitorNiko Matsakis-10/+12
There are now three patterns (shallow, deep, and nested visit). These are described in detail on the docs in `itemlikevisit::ItemLikeVisitor`.
2016-11-13Make names of types used in LLVM IR stable.Michael Woerister-40/+15
Before this PR, type names could depend on the cratenum being used for a given crate and also on the source location of closures. Both are undesirable for incremental compilation where we cache LLVM IR and don't want it to depend on formatting or in which order crates are loaded.
2016-11-10Add variants `Def::Macro` and `Namespace::MacroNS`.Jeffrey Seyfried-1/+2
2016-11-09Rollup merge of #37229 - nnethercote:FxHasher, r=nikomatsakisEduard-Mihai Burtescu-63/+63
Replace FNV with a faster hash function. Hash table lookups are very hot in rustc profiles and the time taken within `FnvHash` itself is a big part of that. Although FNV is a simple hash, it processes its input one byte at a time. In contrast, Firefox has a homespun hash function that is also simple but works on multiple bytes at a time. So I tried it out and the results are compelling: ``` futures-rs-test 4.326s vs 4.212s --> 1.027x faster (variance: 1.001x, 1.007x) helloworld 0.233s vs 0.232s --> 1.004x faster (variance: 1.037x, 1.016x) html5ever-2016- 5.397s vs 5.210s --> 1.036x faster (variance: 1.009x, 1.006x) hyper.0.5.0 5.018s vs 4.905s --> 1.023x faster (variance: 1.007x, 1.006x) inflate-0.1.0 4.889s vs 4.872s --> 1.004x faster (variance: 1.012x, 1.007x) issue-32062-equ 0.347s vs 0.335s --> 1.035x faster (variance: 1.033x, 1.019x) issue-32278-big 1.717s vs 1.622s --> 1.059x faster (variance: 1.027x, 1.028x) jld-day15-parse 1.537s vs 1.459s --> 1.054x faster (variance: 1.005x, 1.003x) piston-image-0. 11.863s vs 11.482s --> 1.033x faster (variance: 1.060x, 1.002x) regex.0.1.30 2.517s vs 2.453s --> 1.026x faster (variance: 1.011x, 1.013x) rust-encoding-0 2.080s vs 2.047s --> 1.016x faster (variance: 1.005x, 1.005x) syntex-0.42.2 32.268s vs 31.275s --> 1.032x faster (variance: 1.014x, 1.022x) syntex-0.42.2-i 17.629s vs 16.559s --> 1.065x faster (variance: 1.013x, 1.021x) ``` (That's a stage1 compiler doing debug builds. Results for a stage2 compiler are similar.) The attached commit is not in a state suitable for landing because I changed the implementation of FnvHasher without changing its name (because that would have required touching many lines in the compiler). Nonetheless, it is a good place to start discussions. Profiles show very clearly that this new hash function is a lot faster to compute than FNV. The quality of the new hash function is less clear -- it seems to do better in some cases and worse in others (judging by the number of instructions executed in `Hash{Map,Set}::get`). CC @brson, @arthurprs
2016-11-08Auto merge of #36843 - petrochenkov:dotstab, r=nikomatsakisbors-1/+1
Stabilize `..` in tuple (struct) patterns I'd like to nominate `..` in tuple and tuple struct patterns for stabilization. This feature is a relatively small extension to existing stable functionality and doesn't have known blockers. The feature first appeared in Rust 1.10 6 months ago. An example of use: https://github.com/rust-lang/rust/pull/36203 Closes https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis
2016-11-08Replace FnvHasher use with FxHasher.Nicholas Nethercote-63/+63
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-11-05Auto merge of #37427 - nnethercote:opt-IchHasher, r=michaelwoeristerbors-12/+68
Reduce the number of bytes hashed by IchHasher. IchHasher uses blake2b hashing, which is expensive, so the fewer bytes hashed the better. There are two big ways to reduce the number of bytes hashed. - Filenames in spans account for ~66% of all bytes (for builds with debuginfo). The vast majority of spans have the same filename for the start of the span and the end of the span, so hashing the filename just once in those cases is a big win. - u32 and u64 and usize values account for ~25%--33% of all bytes (for builds with debuginfo). The vast majority of these are small, i.e. fit in a u8, so shrinking them down before hashing is also a big win. This PR implements these two optimizations. I'm certain the first one is safe. I'm about 90% sure that the second one is safe. Here are measurements of the number of bytes hashed when doing debuginfo-enabled builds of stdlib and rustc-benchmarks/syntex-0.42.2-incr-clean. ``` stdlib syntex-incr ------ ----------- original 156,781,386 255,095,596 half-SawSpan 106,744,403 176,345,419 short-ints 45,890,534 118,014,227 no-SawSpan[*] 6,831,874 45,875,714 [*] don't hash the SawSpan at all. Not part of this PR, just implemented for comparison's sake. ``` For debug builds of syntex-0.42.2-incr-clean, the two changes give a 1--2% speed-up.
2016-11-03Stabilize `..` in tuple (struct) patternsVadim Petrochenkov-1/+1
2016-11-03leb128-encode integers before hashing them in IchHasher.Nicholas Nethercote-1/+37
This significantly reduces the number of bytes hashed by IchHasher.
2016-11-02Rollup merge of #37513 - michaelwoerister:hash-panic-spans, r=nikomatsakisJonathan Turner-35/+103
ICH: Hash expression spans if their source location is captured for panics. Since the location of some expressions is captured in error message constants, it has an influence on machine code and consequently we need to take them into account by the incr. comp. hash. This PR makes this happen for `+, -, *, /, %` and for array indexing -- let me know if I forgot anything. In the future we might want to change the codegen strategy for those error messages, so that they are stored in a separate object file with a stable symbol name, so that only this object file has to be regenerated when source locations change. This strategy would also eliminate unnecessary duplications due to monomorphization, as @arielb1 has pointed out on IRC. I opened https://github.com/rust-lang/rust/issues/37512, so we don't forget about this. r? @nikomatsakis
2016-11-02Don't hash span filenames twice in IchHasher.Nicholas Nethercote-11/+31
This significantly reduces the number of bytes hashed by IchHasher.
2016-11-01ICH: Hash expression spans if their source location is captured for panicsMichael Woerister-35/+103
2016-10-31Remove unused type aliasesSeo Sanghyeon-2/+0
2016-10-30Replace all uses of SHA-256 with BLAKE2b.Michael Woerister-28/+8
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-1/+1
2016-10-24Refactor away fields `MacroDef::{use_locally, export}`.Jeffrey Seyfried-7/+5
2016-10-17ICH: Use 128-bit Blake2b hash instead of 64-bit SipHash for incr. comp. ↵Michael Woerister-37/+172
fingerprints.
2016-10-12Rollup merge of #36995 - nrc:stable, r=@nikomatsakisAlex Crichton-1/+1
stabilise ?, attributes on stmts, deprecate Reflect r? @nikomatsakis
2016-10-12Stabilise `?`Nick Cameron-1/+1
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-07incr.comp.: Hide concrete hash algorithm used for ICHMichael Woerister-8/+64
2016-10-06ICH: Remove obsolete binding in saw_tyMathieu Borderé-4/+1
2016-10-05ICH: update saw_ty for TyBareFn; Update tests for functioninterfacesMathieu Borderé-2/+5
2016-10-05Adjustments due to naming changes in Ty_ and PatKind structsMathieu Borderé-6/+6