1. 28 5月, 2013 10 次提交
    • J
      Fix #6696 · 4521c347
      Jihyun Yu 提交于
      4521c347
    • B
      auto merge of #6739 : kballard/rust/issue-6419, r=catamorphism · e6a838d0
      bors 提交于
      Apple Clang uses different version numbering than "regular" clang, but
      it also provides the "regular" version it's based on. Update the sed
      pattern to pull out this "regular" version number instead of the Apple
      version number.
      e6a838d0
    • B
      auto merge of #6724 : thestinger/rust/swap_fast, r=thestinger · dbc57584
      bors 提交于
      Passing higher alignment values gives the optimization passes more freedom since it can copy in larger chunks. This change results in rustc outputting the same post-optimization IR as clang for swaps and most copies excluding the lack of information about padding.
      
      Code snippet:
      
      ```rust
      #[inline(never)]
      fn swap<T>(x: &mut T, y: &mut T) {
          util::swap(x, y);
      }
      ```
      
      Original IR (for `int`):
      
      ```llvm
      define internal fastcc void @_ZN9swap_283417_a71830ca3ed2d65d3_00E(i64*, i64*) #1 {
      static_allocas:
        %2 = icmp eq i64* %0, %1
        br i1 %2, label %_ZN4util9swap_283717_a71830ca3ed2d65d3_00E.exit, label %3
      
      ; <label>:3                                       ; preds = %static_allocas
        %4 = load i64* %0, align 1
        %5 = load i64* %1, align 1
        store i64 %5, i64* %0, align 1
        store i64 %4, i64* %1, align 1
        br label %_ZN4util9swap_283717_a71830ca3ed2d65d3_00E.exit
      
      _ZN4util9swap_283717_a71830ca3ed2d65d3_00E.exit:  ; preds = %3, %static_allocas
        ret void
      }
      ```
      
      After #6710:
      
      ```llvm
      define internal fastcc void @_ZN9swap_283017_a71830ca3ed2d65d3_00E(i64* nocapture, i64* nocapture) #1 {
      static_allocas:
        %2 = load i64* %0, align 1
        %3 = load i64* %1, align 1
        store i64 %3, i64* %0, align 1
        store i64 %2, i64* %1, align 1
        ret void
      }
      ```
      
      After this change:
      
      ```llvm
      define internal fastcc void @_ZN9swap_283017_a71830ca3ed2d65d3_00E(i64* nocapture, i64* nocapture) #1 {
      static_allocas:
        %2 = load i64* %0, align 8
        %3 = load i64* %1, align 8
        store i64 %3, i64* %0, align 8
        store i64 %2, i64* %1, align 8
        ret void
      }
      ```
      
      Another example:
      
      ```rust
      #[inline(never)]
      fn set<T>(x: &mut T, y: T) {
          *x = y;
      }
      ```
      
      Before, with `(int, int)` (align 1):
      
      ```llvm
      define internal fastcc void @_ZN8set_282517_8fa972e3f9e451983_00E({ i64, i64 }* nocapture, { i64, i64 }* nocapture) #1 {
      static_allocas:
        %2 = bitcast { i64, i64 }* %1 to i8*
        %3 = bitcast { i64, i64 }* %0 to i8*
        tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 16, i32 1, i1 false)
        ret void
      }
      ```
      
      After, with `(int, int)` (align 8):
      
      ```llvm
      define internal fastcc void @_ZN8set_282617_8fa972e3f9e451983_00E({ i64, i64 }* nocapture, { i64, i64 }* nocapture) #1 {
      static_allocas:
        %2 = bitcast { i64, i64 }* %1 to i8*
        %3 = bitcast { i64, i64 }* %0 to i8*
        tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 16, i32 8, i1 false)
        ret void
      }
      ```
      dbc57584
    • D
      fix casts on 32-bit · e6c04dea
      Daniel Micay 提交于
      e6c04dea
    • B
      auto merge of #6715 : Xazax-hun/rust/incoming, r=graydon · 5d04ee80
      bors 提交于
      Preliminary implementation for: https://github.com/mozilla/rust/issues/6275
      
      This is my first (non hello world) rust code, so it may not be idiomatic.
      5d04ee80
    • B
      auto merge of #6703 : sanxiyn/rust/allocation-lint, r=sanxiyn · b0f36865
      bors 提交于
      Fix #6145. In particular, handle operator overloading.
      b0f36865
    • B
      auto merge of #6768 : lkuper/rust/3538, r=thestinger · d98cc999
      bors 提交于
      There were several old `#[doc(hidden)]` attributes in libstd and
      libextra, left over from when rustdoc didn't hide private
      definitions, tagged with `FIXME #3538`.
      
      Since #3538 is now closed, I removed the `#[doc(hidden)]` attributes
      as well as the FIXMEs, but I left `#[doc(hidden)]` in
      libstd/task/spawn.rs and libstd/task/rt.rs since those two are
      apparently `pub`, as well as in libextra/std.rc since std/extra is
      `pub`.
      d98cc999
    • S
      Remove unnecessary allocations flagged by lint · 8f80323f
      Seo Sanghyeon 提交于
      8f80323f
    • S
      Use adjustments table for allocation lint · 363e6727
      Seo Sanghyeon 提交于
      363e6727
    • L
      Get rid of no-longer-needed #[doc(hidden)] attributes. · beec6e4b
      Lindsey Kuper 提交于
      There were several old `#[doc(hidden)]` attributes in libstd and
      libextra, left over from when rustdoc didn't hide private
      definitions, tagged with `FIXME #3538`.
      
      Since #3538 is now closed, I removed the `#[doc(hidden)]` attributes
      as well as the FIXMEs, but I left `#[doc(hidden)]` in
      libstd/task/spawn.rs and libstd/task/rt.rs since those two are
      apparently `pub`, as well as in libextra/std.rc since std/extra is
      `pub`.
      beec6e4b
  2. 27 5月, 2013 12 次提交
  3. 26 5月, 2013 18 次提交