1. 14 9月, 2016 3 次提交
    • B
      Auto merge of #35021 - japaric:rustc-builtins, r=alexcrichton · b1363a73
      bors 提交于
      crate-ify compiler-rt into compiler-builtins
      
      libcompiler-rt.a is dead, long live libcompiler-builtins.rlib
      
      This commit moves the logic that used to build libcompiler-rt.a into a
      compiler-builtins crate on top of the core crate and below the std crate.
      This new crate still compiles the compiler-rt instrinsics using gcc-rs
      but produces an .rlib instead of a static library.
      
      Also, with this commit rustc no longer passes -lcompiler-rt to the
      linker. This effectively makes the "no-compiler-rt" field of target
      specifications a no-op. Users of `no_std` will have to explicitly add
      the compiler-builtins crate to their crate dependency graph *if* they
      need the compiler-rt intrinsics - this is a [breaking-change]. Users
      of the `std` have to do nothing extra as the std crate depends
      on compiler-builtins.
      
      Finally, this a step towards lazy compilation of std with Cargo as the
      compiler-rt intrinsics can now be built by Cargo instead of having to
      be supplied by the user by some other method.
      
      closes #34400
      
      ---
      
      r? @alexcrichton
      b1363a73
    • A
      Link test to compiler builtins and make unstable · 848cfe20
      Alex Crichton 提交于
      This commit fixes a test which now needs to explicitly link to the
      `compiler_builtins` crate as well as makes the `compiler_builtins` crate
      unstable.
      848cfe20
    • B
      Auto merge of #36181 - seanmonstar:likely, r=nikomatsakis · 2fd06081
      bors 提交于
      core: add likely and unlikely intrinsics
      
      I'm no good at reading assembly, but I have tried a stage1 compiler with this patch, and it does cause different asm output. Additionally, testing this compiler on my httparse crate with some `likely` usage added in to the branches does affect benchmarks. However, I'm sure a codegen test should be included, if anyone knows what it should look like.
      
      There isn't an entry in `librustc_trans/context.rs` in this diff, because it already exists (`llvm.expect.i1` is used for array indices).
      
      ----
      
      Even though this does affect httparse benchmarks, it doesn't seem to affect it the same way GCC's `__builtin_expect` affects picohttpparser. I was confused that the deviation on the benchmarks grew hugely when testing this, especially since I'm absolutely certain that the branchs where I added `likely` were always `true`. I chalk that up to GCC and LLVM handle branch prediction differently.
      
      cc #26179
      2fd06081
  2. 13 9月, 2016 18 次提交
  3. 12 9月, 2016 11 次提交
    • B
      Auto merge of #36414 - nnethercote:char_lit, r=jseyfried · 88897037
      bors 提交于
      Improve char_lit's readability and speed
      
      This is my first contribution to rustc. Please let me know if I've done anything wrong. (I ran `make tidy` before making the pull request.)
      88897037
    • B
      Auto merge of #36406 - arielb1:constant-padding, r=eddyb · 85592fbe
      bors 提交于
      use `adt::trans_const` when translating constant closures and tuples
      
      The previous way dropped padding on the floor.
      
      Fixes #36401
      
      r? @EddyB
      85592fbe
    • B
      Auto merge of #36360 - orbea:docdir, r=alexcrichton · 00ce2c0f
      bors 提交于
      Allow setting --docdir
      
      This will allow setting `--docdir` during configure, this is useful because not all linux distributions install documentation to `/usr/share/doc`.  For example in Slackware documentation is installed to `/usr/doc/$PRGNAM-$VERSION` and `/usr/share/doc` is a symlink to `/usr/doc`.
      
      To use this `./configure --docdir=/usr/doc/$PRGNAM-$VERSION` can be used.
      00ce2c0f
    • N
      Lazily construct panic messages in char_lit(). · 826f6736
      Nicholas Nethercote 提交于
      This reduces the time taken to run
      `rustc -Zparse-only rustc-benchmarks/issue-32278-big-array-of-strings`
      from 0.18s to 0.15s on my machine, and reduces the number of
      instructions (as measured by Cachegrind) from 1.34B to 1.01B.
      
      With the change applied, the time to fully compile that benchmark is
      1.96s, so this is a 1.5% improvement.
      826f6736
    • N
      Avoid an unnecessary intermediate value in char_lit(). · 4c274b6a
      Nicholas Nethercote 提交于
      This makes the function more concise and easier to understand.
      4c274b6a
    • B
      Auto merge of #36355 - bluss:vec-extend-from-slice-aliasing-workaround, r=alexcrichton · 4d913235
      bors 提交于
      Work around pointer aliasing issue in Vec::extend_from_slice, extend_with_element
      
      Due to missing noalias annotations for &mut T in general (issue #31681),
      in larger programs extend_from_slice and extend_with_element may both
      compile very poorly. What is observed is that the .set_len() calls are
      not lifted out of the loop, even for `Vec<u8>`.
      
      Use a local length variable for the Vec length instead, and use a scope
      guard to write this value back to self.len when the scope ends or on
      panic. Then the alias analysis is easy.
      
      This affects extend_from_slice, extend_with_element, the vec![x; n]
      macro, Write impls for Vec<u8>, BufWriter, etc (but may / may not
      have triggered since inlining can be enough for the compiler to get it right).
      
      Fixes #32155
      Fixes #33518
      Closes #17844
      4d913235
    • B
      Auto merge of #36344 - sanxiyn:llvm-components, r=alexcrichton · 0f5f325f
      bors 提交于
      Use LLVM_COMPONENTS to run tests just for supported targets
      
      This is already done for simd-ffi test, but not for atomic-lock-free test.
      
      Fix #35023.
      0f5f325f
    • A
      use `adt::trans_const` when translating constant closures and tuples · f1bd9077
      Ariel Ben-Yehuda 提交于
      Fixes #36401
      f1bd9077
    • B
      Auto merge of #36308 - dtolnay:inputitem, r=alexcrichton · 0be88eb7
      bors 提交于
      Point macros 1.1 errors to the input item
      
      Moved from https://github.com/alexcrichton/rust/pull/6 to continue discussion. Fixes #36218.
      
      Before:
      
      ```rust
      error[E0106]: missing lifetime specifier
        --> src/main.rs:10:10
         |
      10 | #[derive(Serialize, Deserialize)]
         |          ^ expected lifetime parameter
      
      error[E0038]: the trait `T` cannot be made into an object
        --> src/main.rs:15:15
         |
      15 | #[derive(Serialize, Deserialize)]
         |          ^^^^^^^^^^ the trait `T` cannot be made into an object
      ```
      
      After:
      
      ```rust
      error[E0106]: missing lifetime specifier
        --> src/main.rs:11:1
         |
      11 | struct A {
         | ^ expected lifetime parameter
      
      error[E0038]: the trait `T` cannot be made into an object
        --> src/main.rs:16:1
         |
      16 | struct B<'a> {
         | ^ the trait `T` cannot be made into an object
      ```
      0be88eb7
    • K
      Tweak array docs · 54c680cd
      Keegan McAllister 提交于
      Fixes #29331.
      54c680cd
    • B
      Auto merge of #36369 - uweigand:s390x, r=alexcrichton · 4812cf39
      bors 提交于
      Add s390x support
      
      This adds support for building the Rust compiler and standard
      library for s390x-linux, allowing a full cross-bootstrap sequence
      to complete.  This includes:
      
      - Makefile/configure changes to allow native s390x builds
      - Full Rust compiler support for the s390x C ABI
        (only the non-vector ABI is supported at this point)
      - Port of the standard library to s390x
      - Update the liblibc submodule to a version including s390x support
      - Testsuite fixes to allow clean "make check" on s390x
      
      Caveats:
      
      - Resets base cpu to "z10" to bring support in sync with the default
        behaviour of other compilers on the platforms.  (Usually, upstream
        supports all older processors; a distribution build may then chose
        to require a more recent base version.)  (Also, using zEC12 causes
        failures in the valgrind tests since valgrind doesn't fully support
        this CPU yet.)
      
      - z13 vector ABI is not yet supported.  To ensure compatible code
        generation, the -vector feature is passed to LLVM.  Note that this
        means that even when compiling for z13, no vector instructions
        will be used.  In the future, support for the vector ABI should be
        added (this will require common code support for different ABIs
        that need different data_layout strings on the same platform).
      
      - Two test cases are (temporarily) ignored on s390x to allow passing
        the test suite.  The underlying issues still need to be fixed:
        * debuginfo/simd.rs fails because of incorrect debug information.
          This seems to be a LLVM bug (also seen with C code).
        * run-pass/union/union-basic.rs simply seems to be incorrect for
          all big-endian platforms.
      Signed-off-by: NUlrich Weigand <ulrich.weigand@de.ibm.com>
      4812cf39
  4. 11 9月, 2016 4 次提交
  5. 10 9月, 2016 4 次提交