summary refs log tree commit diff
path: root/src/librustc_data_structures
AgeCommit message (Collapse)AuthorLines
2019-07-02more centril nitsNiko Matsakis-1/+1
2019-07-02fix silly bugs in binary_search_util testNiko Matsakis-2/+3
2019-07-02address nits by mattewjasperNiko Matsakis-2/+1
2019-07-02just create a binary search slice helper fnNiko Matsakis-114/+72
2019-07-02add a `VecMap` data structureNiko Matsakis-0/+114
2019-07-02pacify the mercilous tidyNiko Matsakis-1/+0
long lines, trailing newlines
2019-07-02add a `depth_first_search` helper functionNiko Matsakis-1/+49
2019-07-02introduce a `VecGraph` abstraction that cheaply stores graphsNiko Matsakis-3/+197
This is perhaps better than the linked list approach I was using before. Lower memory overhead, Theta(N+E) storage. Does require a sort. =)
2019-07-02implement the graph traits for SCCNiko Matsakis-1/+26
2019-07-02Auto merge of #61871 - Zoxc:no-lift-branch, r=eddybbors-0/+4
Don't use lift to detect local types This overlaps with https://github.com/rust-lang/rust/pull/61392. r? @eddyb
2019-06-26Fix clippy::precedenceIgor Matuszewski-1/+1
2019-06-26Fix clippy::redundant_closureIgor Matuszewski-1/+1
2019-06-26Fix clippy::cast_loslessIgor Matuszewski-6/+6
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-1/+1
2019-06-26Check for local types in writeback with debug assertionsJohn Kåre Alsaker-0/+4
2019-06-24Auto merge of #61787 - ecstatic-morse:dataflow-split-block-sets, r=pnkfelixbors-5/+0
rustc_mir: Hide initial block state when defining transfer functions This PR addresses [this FIXME](https://github.com/rust-lang/rust/blob/2887008e0ce0824be4e0e9562c22ea397b165c97/src/librustc_mir/dataflow/mod.rs#L594-L596). This makes `sets.on_entry` inaccessible in `{before_,}{statement,terminator}_effect`. This field was meant to allow implementors of `BitDenotation` to access the initial state for each block (optionally with the effect of all previous statements applied via `accumulates_intrablock_state`) while defining transfer functions. However, the ability to set the initial value for the entry set of each basic block (except for START_BLOCK) no longer exists. As a result, this functionality is mostly useless, and when it *was* used it was used erroneously (see #62007). Since `on_entry` is now useless, we can also remove `BlockSets`, which held the `gen`, `kill`, and `on_entry` bitvectors and replace it with a `GenKill` struct. Variables of this type are called `trans` since they represent a transfer function. `GenKill`s are stored contiguously in `AllSets`, which reduces the number of bounds checks and may improve cache performance: one is almost never accessed without the other. Replacing `BlockSets` with `GenKill` allows us to define some new helper functions which streamline dataflow iteration and the dataflow-at-location APIs. Notably, `state_for_location` used a subtle side-effect of the `kill`/`kill_all` setters to apply the transfer function, and could be incorrect if a transfer function depended on effects of previous statements in the block on `gen_set`. Additionally, this PR merges `BitSetOperator` and `InitialFlow` into one trait. Since the value of `InitialFlow` defines the semantics of the `join` operation, there's no reason to have seperate traits for each. We can add a default impl of `join` which branches based on `BOTTOM_VALUE`. This should get optimized away.
2019-06-23Rollup merge of #62068 - ia0:fix_meta_var, r=petrochenkovMazdak Farrokhzad-1/+1
Fix meta-variable binding errors in macros The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact. Found by https://github.com/rust-lang/rust/pull/62008
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-1/+1
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-22Merge `BitSetOperator` and `InitialFlow` into one trait.Dylan MacKenzie-5/+0
Since the value of `InitialFlow` defines the semantics of the `join` operation, there's no reason to have seperate traits for each. We can add a default impl of `join` which branches based on `BOTTOM_VALUE`. This should get optimized away.
2019-06-22Auto merge of #61020 - HeroicKatora:master, r=matthewjasperbors-4/+143
librustc_data_structures: Speedup union of sparse and dense hybrid set This optimization speeds up the union of a hybrid bitset when that switches it from a sparse representation to a dense bitset. It now clones the dense bitset and integrate only the spare elements instead of densifying the sparse bitset, initializing all elements, and then a union on two dense bitset, touching all words a second time. It's not completely certain if the added complexity is worth it but I would like to hear some feedback in any case. Benchmark results from my machine: ``` Now: bit_set::union_hybrid_sparse_to_dense ... bench: 72 ns/iter (+/- 5) Previous: bit_set::union_hybrid_sparse_to_dense ... bench: 90 ns/iter (+/- 6) ``` This being the second iteration of trying to improve the speed, since I missed the return value in the first, and forgot to run the relevant tests. Oops.
2019-06-16Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkovbors-2/+3
Stabilize underscore_const_names in 1.37.0 You are now permitted to write: ```rust const _: $type_expression = $term_expression; ``` That is, we change the [grammar of items](https://github.com/rust-lang-nursery/wg-grammar/blob/9d1984d7ae8d6576f943566539a31a5800644c57/grammar/item.lyg#L3-L42), as written in [the *`.lyg`* notation](https://github.com/rust-lang/gll/tree/263bf161dad903e67aa65fc591ced3cab18afa2a#grammar), from: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IDENT ":" ty:Type "=" value:Expr ";" } | ... ; ``` into: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IdentOrUnderscore ":" ty:Type "=" value:Expr ";" } | ... ; IdentOrUnderscore = | Named:IDENT | NoName:"_" ; ``` r? @petrochenkov
2019-06-16Separate librustc_data_structures modulechansuke-915/+913
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-0/+6
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-10Add more functionality to BitMatrixTyler Mandry-1/+93
2019-06-10Stabilize underscore_const_names: stage0 -> bootstrap.Mazdak Farrokhzad-3/+3
2019-06-10Stabilize underscore_const_names.Mazdak Farrokhzad-2/+3
2019-06-09Allow attributes in formal function parametersCaio-0/+6
2019-06-01rustc: use indexmap instead of a plain vector for upvars.Eduard-Mihai Burtescu-0/+37
2019-05-25Add Step::sub_usizeTim Vermeulen-0/+5
2019-05-22Add documentation on the reasoningAndreas Molzer-4/+14
Explains the thought process behind adding the union algorithm and discusses the alternative and heuristic behind.
2019-05-22Improve union of sparse and dense hybrid setAndreas Molzer-4/+45
This optimization speeds up the union of a hybrid bitset when that switches it from a sparse representation to a dense bitset. It now clones the dense bitset and integrate only the spare elements instead of densifying the sparse bitset, initializing all elements, and then a union on two dense bitset, touching all words a second time.
2019-05-22Provide some benchmarks for bitset hybrid unionAndreas Molzer-0/+88
2019-05-21update doc commentRalf Jung-2/+1
2019-05-21static_assert: make use of anonymous constantsRalf Jung-3/+3
2019-05-20Rollup merge of #60959 - petrochenkov:sassert, r=estebankMazdak Farrokhzad-0/+9
rustc: Improve type size assertions Now they - Tell what the new size is, when it changes - Do not require passing an identifier ``` ::: src\libsyntax\parse\token.rs:223:1 | 223 | static_assert_size!(Token, 123); | -------------------------------- in this macro invocation | = note: expected type `[(); 123]` found type `[(); 16]` ```
2019-05-20Document requirements for HashStable implementations better.Michael Woerister-0/+24
2019-05-19Improve type size assertionsVadim Petrochenkov-0/+9
Now they - Tell what the new size is, when it changes - Do not require passing an identifier
2019-05-17Remove unused field from StableHasher.Michael Woerister-20/+0
2019-05-13Remove bitrig support from rustMarcel Hellwig-1/+0
2019-05-04Delegate SmallVec's stable_hash to array's stable_hash.Jesper Steen Møller-3/+1
2019-05-04Hash all of the import_ids for the TraitCandidate.Jesper Steen Møller-0/+12
2019-04-27Auto merge of #60288 - Zoxc:update-rayon, r=nikomatsakisbors-2/+2
Update rustc-rayon version r? @nikomatsakis
2019-04-26Update rustc-rayon versionJohn Kåre Alsaker-2/+2
2019-04-26Use "capacity" as parameter name in with_capacity() methodsMatthias Geier-2/+2
Closes #60271.
2019-04-15Rollup merge of #59648 - alex:must-use-result, r=alexcrichtonMazdak Farrokhzad-6/+6
Add must_use annotations to Result::is_ok and is_err Discussed in #59610
2019-04-14Rollup merge of #59804 - Zoxc:cleaner-jobserver, r=alexcrichtonMazdak Farrokhzad-122/+8
Clean up jobserver integration cc @alexcrichton
2019-04-09Kill dead code dominator code.Edd Barrett-47/+0
2019-04-09Clean up jobserver integrationJohn Kåre Alsaker-122/+8
2019-04-08Add must_use annotations to Result::is_ok and is_errAlex Gaynor-6/+6
2019-03-27Update ena to version 0.13.0varkor-1/+1