Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #41717

Merged
merged 49 commits into from
May 3, 2017
Merged

Rollup of 7 pull requests #41717

merged 49 commits into from
May 3, 2017

Commits on Apr 30, 2017

  1. 1 Configuration menu
    Copy the full SHA
    5cf0446 View commit details
    Browse the repository at this point in the history
  2. 1 Configuration menu
    Copy the full SHA
    9896483 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2017

  1. Add an example for 'fence'

    topecongiro authored and Seiichi Uchida committed May 1, 2017
    1 Configuration menu
    Copy the full SHA
    91a9866 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2017

  1. query for deprecation

    hackeryarn committed May 2, 2017
    1 Configuration menu
    Copy the full SHA
    c1d97c7 View commit details
    Browse the repository at this point in the history
  2. 1 Configuration menu
    Copy the full SHA
    478b7d9 View commit details
    Browse the repository at this point in the history
  3. 1 Configuration menu
    Copy the full SHA
    1c57bb4 View commit details
    Browse the repository at this point in the history
  4. Remove ANTLR grammar.

    It is unused and not maintained.
    Mark-Simulacrum committed May 2, 2017
    1 Configuration menu
    Copy the full SHA
    c3781e6 View commit details
    Browse the repository at this point in the history
  5. introduce mir_keys()

    Each MIR key is a DefId that has MIR associated with it
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    0e5e2f3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    11b6b06 View commit details
    Browse the repository at this point in the history
  7. simplify the MirPass traits and passes dramatically

    Overall goal: reduce the amount of context a mir pass needs so that it
    resembles a query.
    
    - The hooks are no longer "threaded down" to the pass, but rather run
      automatically from the top-level (we also thread down the current pass
      number, so that the files are sorted better).
      - The hook now receives a *single* callback, rather than a callback per-MIR.
    - The traits are no longer lifetime parameters, which moved to the
      methods -- given that we required
      `for<'tcx>` objecs, there wasn't much point to that.
    - Several passes now store a `String` instead of a `&'l str` (again, no
      point).
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    46b342f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e9e6ccc View commit details
    Browse the repository at this point in the history
  9. rewrite Passes to have sets of passes

    Also, store the completed set of passes in the tcx.
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    668886a View commit details
    Browse the repository at this point in the history
  10. move to only def-id passes

    this temporary disables `inline`
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    f23a7bc View commit details
    Browse the repository at this point in the history
  11. retool MIR passes completely

    The new setup is as follows. There is a pipeline of MIR passes that each
    run **per def-id** to optimize a particular function. You are intended
    to request MIR at whatever stage you need it. At the moment, there is
    only one stage you can request:
    
    - `optimized_mir(def_id)`
    
    This yields the final product. Internally, it pulls the MIR for the
    given def-id through a series of steps. Right now, these are still using
    an "interned ref-cell" but they are intended to "steal" from one
    another:
    
    - `mir_build` -- performs the initial construction for local MIR
    - `mir_pass_set` -- performs a suite of optimizations and transformations
    - `mir_pass` -- an individual optimization within a suite
    
    So, to construct the optimized MIR, we invoke:
    
        mir_pass_set((MIR_OPTIMIZED, def_id))
    
    which will build up the final MIR.
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    2b32cb9 View commit details
    Browse the repository at this point in the history
  12. rename MirPassSet to MirSuite

    This seems like a better noun.
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    e89a321 View commit details
    Browse the repository at this point in the history
  13. introduce idea of "stealable" MIR

    This is a more principled version of the `RefCell` we were using
    before. We now allocate a `Steal<Mir<'tcx>>` for each intermediate MIR
    pass; when the next pass steals the entry, any later attempts to use it
    will panic (there is no way to *test* if MIR is stolen, you're just
    supposed to *know*).
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    29263fd View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ecc8ff9 View commit details
    Browse the repository at this point in the history
  15. introduce IntoKeyValues trait to prepare for multi-queries

    The idea is that such queries will return `FxHashMap`
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    3d1095c View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    1d675ce View commit details
    Browse the repository at this point in the history
  17. convert the inline pass to use the new multi result

    This involves changing various details about that system,
    though the basic shape remains the same.
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    a26e966 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    0d045d7 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    d9c8a2b View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    532439f View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    c1ff104 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    c2cfdbb View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    69c8f9d View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    c253df5 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    9c154a6 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    669d316 View commit details
    Browse the repository at this point in the history
  27. support inlining by asking for optimizer mir for callees

    I tested this with it enabled 100% of the time, and we were able to run
    mir-opt tests successfully.
    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    1dd9c3e View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    851a880 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    2fa1ba3 View commit details
    Browse the repository at this point in the history
  30. delete dead code

    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    74b2783 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    c7023d1 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    393fa4f View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    b0092e8 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    0afcfce View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    15bc2f4 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    e6793ac View commit details
    Browse the repository at this point in the history
  37. fix librustc_driver

    nikomatsakis committed May 2, 2017
    Configuration menu
    Copy the full SHA
    afc5acd View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    25be798 View commit details
    Browse the repository at this point in the history
  39. add FIXME to Steal

    nikomatsakis committed May 2, 2017
    1 Configuration menu
    Copy the full SHA
    488b2a3 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2017

  1. Rollup merge of rust-lang#41217 - topecongiro:docs/atomic-fence, r=st…

    …eveklabnik
    
    Update docs of 'fence'
    
    This PR updates the docs for `std::sync::atomic::fence` with an example and a diagram.
    Part of rust-lang#29377.
    r? @steveklabnik
    frewsxcv committed May 3, 2017
    1 Configuration menu
    Copy the full SHA
    1a5284c View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#41625 - nikomatsakis:incr-comp-dep-tracking…

    …-cell-mir, r=eddyb
    
    rework the queries for the MIR pipeline
    
    This PR refashions the MIR pipeline. There are a number of changes:
    
    * We no longer have "MIR passes" and the pass manager is completely reworked. Unless we are doing the interprocedural optimization (meaning, right now, the inline pass), we will process a single MIR from beginning to finish in a completely on-demand fashion; i.e., when you request `optimized_mir(D)`, that will trigger the MIR for `D` to actually be built and optimized, but no other functions are built or touched.
    * We no longer use `&'tcx RefCell<Mir<'tcx>>` as the result of queries, since that spoils the view of queries as "pure functions". To avoid however copying the MIR, we use a `&'tcx Steal<Mir<'tcx>>` -- this is something like a ref-cell, in that you can use `borrow()` to read it, but it has no `borrow_mut()`. Instead, it has `steal()`, which will take the contents and then panic if any further read attempt occurs.
    * We now support `[multi]` queries, which can optionally yield not just one result but a sequence of (K, V) pairs. This is used for the inlining pass. If inlining is enabled, then when it is invoked on **any** def-id D, it will go and read the results for **all** def-ids and transform them, and then return the results for all of them at once. This isn't ideal, and we'll probably want to rework this further, but it seems ok for now (note that MIR inlining is not enabled by default).
    
    **Tips for the reviewer:** The commits here are meant to build individually, but the path is a *bit* meandering. In some cases, for example, I introduce a trait in one commit, and then tweak it in a later commit as I actually try to put it to use. You may want to read the README in the final commit to get a sense of where the overall design is headed.
    
    @eddyb I did not wind up adding support for queries that produce more than one *kind* of result. Instead, I decided to just insert judicious use of the `force()` command. In other words, we had talked about e.g. having a query that produced not only the MIR but also the `const_qualif` result for the MIR in one sweep. I realized you can also have the same effect by having a kind of meta-query that forces the const-qualif pass and then reads the result. See the README for a description. (We can still do these "multi-query results" later if we want, I'm not sure though if it is necessary.)
    
    r? @eddyb
    
    cc @michaelwoerister @matthewhammer @arielb1, who participated in the IRC discussion.
    frewsxcv committed May 3, 2017
    1 Configuration menu
    Copy the full SHA
    cfff369 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#41640 - gaurikholkar:master, r=nikomatsakis

    Consider changing to & for let bindings rust-lang#40402
    
    This is a fix for rust-lang#40402
    
    For the example
    ```
    fn main() {
        let v = vec![String::from("oh no")];
    
        let e = v[0];
    }
    ```
    
    It gives
    ```
    error[E0507]: cannot move out of indexed content
     --> ex1.rs:4:13
      |
    4 |     let e = v[0];
      |             ^^^^ cannot move out of indexed content
      |
      = help: consider changing to `&v[0]`
    
    error: aborting due to previous error
    ```
    
    Another alternative is
    ```
    error[E0507]: cannot move out of indexed content
     --> ex1.rs:4:13
      |
    4 |     let e = v[0];
      |             ^^^^ consider changing to `&v[0]`
    
    error: aborting due to previous error
    ```
    Also refer to rust-lang#41564 for more details.
    
    r? @nikomatsakis
    frewsxcv committed May 3, 2017
    Configuration menu
    Copy the full SHA
    9e621c2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#41653 - achernyak:master, r=nikomatsakis

    Queries for Crate Metadata
    
    This resolves following parts of rust-lang#41417:
    * `fn stability(&self, def: DefId) -> Option<attr::Stability>;`
    * `fn deprecation(&self, def: DefId) -> Option<attr::Deprecation>;`
    
    r? @nikomatsakis
    frewsxcv committed May 3, 2017
    Configuration menu
    Copy the full SHA
    02274a8 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#41656 - malbarbo:android-armeabi, r=alexcri…

    …chton
    
    Change arm-linux-androideabi to correspond to the armeabi official ABI
    
    Fixes rust-lang#40941.
    frewsxcv committed May 3, 2017
    Configuration menu
    Copy the full SHA
    c386832 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#41657 - malbarbo:android-armv7-linker, r=al…

    …excrichton
    
    Add -march=armv7-a parameter to armv7 android linker
    
    Without this option, the linker fails to link any library that uses `std::future`. The error points some undefined references, like `std::__future_base::_Result_base`.
    
    For example, it fails to link rustc because llvm 4.0 uses `std::future`.
    
    See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
    frewsxcv committed May 3, 2017
    Configuration menu
    Copy the full SHA
    a476163 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#41705 - Mark-Simulacrum:remove-grammar, r=n…

    …ikomatsakis
    
    Remove ANTLR grammar
    
    I *think* that nothing in-tree references this, but I may be wrong. If anyone thinks of anything, please let me know and I'll work on removing.
    
    Fixes rust-lang#15677.
    frewsxcv committed May 3, 2017
    Configuration menu
    Copy the full SHA
    2b51384 View commit details
    Browse the repository at this point in the history