1. 18 7月, 2013 22 次提交
  2. 17 7月, 2013 18 次提交
    • B
      Generate better code for intrinsics · 15ea4a8d
      Björn Steinbrink 提交于
      Currently, our intrinsics are generated as functions that have the
      usual setup, which means an alloca, and therefore also a jump, for
      those intrinsics that return an immediate value. This is especially bad
      for unoptimized builds because it means that an intrinsic like
      "contains_managed" that should be just "ret 0" or "ret 1" actually ends
      up allocating stack space, doing a jump and a store/load sequence
      before it finally returns the value.
      
      To fix that, we need a way to stop the generic function declaration
      mechanism from allocating stack space for the return value. This
      implicitly also kills the jump, because the block for static allocas
      isn't required anymore.
      
      Additionally, trans_intrinsic needs to build the return itself instead
      of calling finish_fn, because the latter relies on the availability of
      the return value pointer.
      
      With these changes, we get the bare minimum code required for our
      intrinsics, which makes them small enough that inlining them makes the
      resulting code smaller, so we can mark them as "always inline" to get
      better performing unoptimized builds.
      
      Optimized builds also benefit slightly from this change as there's less
      code for LLVM to translate and the smaller intrinsics help it to make
      better inlining decisions for a few code paths.
      
      Building stage2 librustc gets ~1% faster for the optimized version and 5% for
      the unoptimized version.
      15ea4a8d
    • B
      Remove duplicated code from trans_intrinsics · 3e572511
      Björn Steinbrink 提交于
      Most arms of the huge match contain the same code, differing only in
      small details like the name of the llvm intrinsic that is to be called.
      Thus the duplicated code can be factored out into a few functions that
      take some parameters to handle the differences.
      3e572511
    • N
      782853c6
    • B
      auto merge of #7843 : alexcrichton/rust/better-lint-help, r=huonw · 93c270c6
      bors 提交于
      Closes #7818
      93c270c6
    • N
      81c576cd
    • B
      auto merge of #7835 : omasanori/rust/l10n-improvement, r=pnkfelix · 9da42dce
      bors 提交于
      Adding options for `po4a` in `mk/docs.mk` and updating .pots.
      9da42dce
    • B
      auto merge of #7841 : alexcrichton/rust/tls++, r=huonw · c032dddf
      bors 提交于
      Simulates borrow checks for '@mut' boxes, or at least it's the same idea. This allows you to store owned values, but mutate them while they're owned by TLS.
      
      This should remove the necessity for a `pop`/`set` pattern to mutate data structures in TLS.
      c032dddf
    • B
      auto merge of #7839 : graydon/rust/new-codegen-tests, r=pcwalton · a93244db
      bors 提交于
      Add some codegen tests. Nothing too surprising.
      a93244db
    • M
      Made ast::blk not use spanned<T> anymore. · 0cc70743
      Michael Woerister 提交于
      0cc70743
    • B
      auto merge of #7828 : alexcrichton/rust/lang-opt, r=graydon · af54f633
      bors 提交于
      Whenever a lang_item is required, some relevant message is displayed, often with
      a span of what triggered the usage of the lang item.
      
      Now "hello word" is as small as:
      
      ```rust
      #[no_std];
      
      extern {
          fn puts(s: *u8);
      }
      
      extern "rust-intrinsic" {
          fn transmute<T, U>(t: T) -> U;
      }
      
      #[start]
      fn main(_: int, _: **u8, _: *u8) -> int {
          unsafe {
              let (ptr, _): (*u8, uint) = transmute("Hello!");
              puts(ptr);
          }
          return 0;
      }
      ```
      af54f633
    • H
      rustc: implement a `#[no_implicit_prelude]` attribute. · 040e470f
      Huon Wilson 提交于
      It disables the insertion of `use std::prelude::*;` into the top of
      all the modules below the item on which it is placed (including that
      item itself).
      040e470f
    • A
      Make all lang_items optional · 88a1b713
      Alex Crichton 提交于
      Whenever a lang_item is required, some relevant message is displayed, often with
      a span of what triggered the usage of the lang item
      88a1b713
    • B
      auto merge of #7831 : ozten/rust/issues-7764-swap_unwarp-take-unwrap, r=pcwalton · 4bd716ac
      bors 提交于
      Fixes Issue #7764
      
      Running `make check` I do get a failure:
      
          test rt::io::extensions::test::push_bytes ... ok
          rustest rt::comm::test::oneshot_single_thread_send_port_close ... t: task failed at 'Unhandled condition:
           read_error: {kind: OtherIoError, desc: "Placeholder error. You shouldn\'t be seeing this", detail: None}',
           /Users/shout/Projects/rust/src/libstd/condition.rs:50
          /bin/sh: line 1: 35056 Abort trap: 6           x86_64-apple-darwin/stage2/test/stdtest-x86_64-apple-darwin --logfile
           tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.log
          make: *** [tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.ok] Error 134
      4bd716ac
    • A
      Sort lint attributes to print them in a more sane way · 0fd4d5d7
      Alex Crichton 提交于
      Closes #7818
      0fd4d5d7
    • A
      Add a `get_mut` method for TLS · 948a6240
      Alex Crichton 提交于
      Simulates borrow checks for '@mut' boxes, or at least it's the same idea.
      948a6240
    • G
      test: new codegen tests, rename hello. · 40f74341
      Graydon Hoare 提交于
      40f74341
    • B
      auto merge of #7827 : jdm/rust/enumlength, r=graydon · 8a1002fb
      bors 提交于
      Allowing them in type signatures is a significant amount of extra work, unfortunately. This also doesn't apply to static values, which takes a different code path.
      8a1002fb
    • O
      Add project information to l10n templates. · ad3a6973
      OGINO Masanori 提交于
      ad3a6973