1. 22 7月, 2013 14 次提交
  2. 21 7月, 2013 21 次提交
    • B
      Provide lower level access to the LLVM IR builder · 565a9bf2
      Björn Steinbrink 提交于
      Currently, the helper functions in the "build" module can only append
      at the end of a block. For certain things we'll want to be able to
      insert code at arbitrary locations inside a block though. Although can
      we do that by directly calling the LLVM functions, that is rather ugly
      and means that somethings need to be implemented twice. Once in terms
      of the helper functions and once in terms of low level LLVM functions.
      
      Instead of doing that, we should provide a Builder type that provides
      low level access to the builder, and which can be used by both, the
      helper functions in the "build" module, as well larger units of
      abstractions that combine several LLVM instructions.
      565a9bf2
    • B
      Remove an unnecessary block/jump from the drop glue for @-pointer · 3cccdbd9
      Björn Steinbrink 提交于
      The nested with_cond calls each introduce a "next" block, with the
      inner one just jumping to the outer one.
      3cccdbd9
    • B
      Avoid creating llenv blocks when there's nothing to load · d4051178
      Björn Steinbrink 提交于
      Currently, all closures have an llenv block to load values from the
      captured environment, but for closure that don't actually capture
      anything, that block is useless and can be skipped.
      d4051178
    • J
      syntax: print visibilities of foreign items · 85387e19
      Jyun-Yan You 提交于
      85387e19
    • B
      auto merge of #7913 : brson/rust/rm-install-snap, r=graydon · c4b62169
      bors 提交于
      c4b62169
    • B
      auto merge of #7912 : graydon/rust/extra-new-benchmarks-1, r=catamorphism · c325cb0a
      bors 提交于
      This adds new #[bench] benchmarks for extra::smallintmap, treemap, sha1, sha256 and 512, and base64. Also fixes a bunch of warnings in bitv.
      c325cb0a
    • B
      auto merge of #7902 : huonw/rust/attr++, r=cmr,pcwalton · d029ebfc
      bors 提交于
      This does a number of things, but especially dramatically reduce the
      number of allocations performed for operations involving attributes/
      meta items:
      
      - Converts ast::meta_item & ast::attribute and other associated enums
        to CamelCase.
      - Converts several standalone functions in syntax::attr into methods,
        defined on two traits AttrMetaMethods & AttributeMethods. The former
        is common to both MetaItem and Attribute since the latter is a thin
        wrapper around the former.
      - Deletes functions that are unnecessary due to iterators.
      - Converts other standalone functions to use iterators and the generic
        AttrMetaMethods rather than allocating a lot of new vectors (e.g. the
        old code would have to allocate a new vector to use functions that
        operated on &[meta_item] on &[attribute].)
      - Moves the core algorithm of the #[cfg] matching to syntax::attr,
        similar to find_inline_attr and find_linkage_metas.
      
      This doesn't have much of an effect on the speed of #[cfg] stripping,
      despite hugely reducing the number of allocations performed; presumably
      most of the time is spent in the ast folder rather than doing attribute
      checks.
      
      Also fixes the Eq instance of MetaItem_ to correctly ignore spans, so
      that `rustc --cfg 'foo(bar)'` now works.
      d029ebfc
    • B
      auto merge of #7896 : pcwalton/rust/pub-extern, r=pcwalton · 8476419f
      bors 提交于
      r? @nikomatsakis
      8476419f
    • P
      librustc: Remove `pub extern` and `priv extern` from the language. · 06594ed9
      Patrick Walton 提交于
      Place `pub` or `priv` on individual items instead.
      06594ed9
    • D
      rm obsolete no-op lints · 13b474dc
      Daniel Micay 提交于
      13b474dc
    • B
      auto merge of #7882 : blake2-ppc/rust/iterator-clone, r=thestinger · 75b4b1b0
      bors 提交于
      Implement method .cycle() that repeats an iterator endlessly
      
      Implement Clone for simple iterators (without closures), including VecIterator.
      
      > The theory is simple, the immutable iterators simply hold state
      > variables (indicies or pointers) into frozen containers. We can freely
      > clone these iterators, just like we can clone borrowed pointers.
      75b4b1b0
    • B
      auto merge of #7910 : brson/rust/rm-fixme, r=graydon · bb8ca1f5
      bors 提交于
      bb8ca1f5
    • B
      auto merge of #7908 : anasazi/rust/fix_udp_mut, r=brson · c5c02525
      bors 提交于
      c5c02525
    • B
      dlist: Implement Clone for immutable iterators · fe134b95
      blake2-ppc 提交于
      fe134b95
    • B
      std: Implement Clone for VecIterator and iterators using it · 24b6901b
      blake2-ppc 提交于
      The theory is simple, the immutable iterators simply hold state
      variables (indicies or pointers) into frozen containers. We can freely
      clone these iterators, just like we can clone borrowed pointers.
      
      VecIterator needs a manual impl to handle the lifetime struct member.
      24b6901b
    • B
      iterator: Add test for .cycle() · ffe2623e
      blake2-ppc 提交于
      ffe2623e
    • B
      iterator: Let closure-less iterators derive Clone · 4623e81a
      blake2-ppc 提交于
      4623e81a
    • B
      iterator: Add .cycle() to repeat an iterator · 435fcda5
      blake2-ppc 提交于
      435fcda5
    • B
      auto merge of #7894 : pcwalton/rust/and-pointers-in-at-boxes, r=brson · 5c999d4e
      bors 提交于
      r? @brson
      5c999d4e
    • B
      str: Implement Container for ~str, @str and Mutable for ~str · 3509f9d5
      blake2-ppc 提交于
      ~str and @str need separate implementations for use in generic
      functions, where it will not automatically use the impl on &str.
      3509f9d5
    • B
      auto merge of #7710 : michaelwoerister/rust/WP4, r=jdm · 8aae6edc
      bors 提交于
      This pull request includes various improvements:
      
      + Composite types (structs, tuples, boxes, etc) are now handled more cleanly by debuginfo generation. Most notably, field offsets are now extracted directly from LLVM types, as opposed to trying to reconstruct them. This leads to more stable handling of edge cases (e.g. packed structs or structs implementing drop).
      
      + `debuginfo.rs` in general has seen a major cleanup. This includes better formatting, more readable variable and function names, removal of dead code, and better factoring of functionality.
      
      + Handling of `VariantInfo` in `ty.rs` has been improved. That is, the `type VariantInfo = @VariantInfo_` typedef has been replaced with explicit uses of @VariantInfo, and the duplicated logic for creating VariantInfo instances in `ty::enum_variants()` and `typeck::check::mod::check_enum_variants()` has been unified into a single constructor function. Both function now look nicer too :)
      
      + Debug info generation for enum types is now mostly supported. This includes:
        + Good support for C-style enums. Both DWARF and `gdb` know how to handle them.
        + Proper description of tuple- and struct-style enum variants as unions of structs.
        + Proper handling of univariant enums without discriminator field.
        + Unfortunately `gdb` always prints all possible interpretations of a union, so debug output of enums is verbose and unintuitive. Neither `LLVM` nor `gdb` support DWARF's `DW_TAG_variant` which allows to properly describe tagged unions. Adding support for this to `LLVM` seems doable. `gdb` however is another story. In the future we might be able to use `gdb`'s Python scripting support to alleviate this problem. In agreement with @jdm this is not a high priority for now.
      
      + The debuginfo test suite has been extended with 14 test files including tests for packed structs (with Drop), boxed structs, boxed vecs, vec slices, c-style enums (standalone and embedded), empty enums, tuple- and struct-style enums, and various pointer types to the above.
      
      ~~What is not yet included is DI support for some enum edge-cases represented as described in `trans::adt::NullablePointer`.~~
      
      Cheers,
      Michael
      
      PS: closes #7819,  fixes #7712
      8aae6edc
  3. 20 7月, 2013 5 次提交
    • B
      auto merge of #7886 : msullivan/rust/default-methods, r=pcwalton · 3a1db2d1
      bors 提交于
      This does a bunch of cleanup on the data structures for the trait system. (Unfortunately it doesn't remove `provided_method_sources`. Maybe later.)
      
      It also changes how cross crate methods are handled, so that information about them is exported in metadata, instead of having the methods regenerated by every crate that imports an impl.
      
      r? @nikomatsakis, maybe?
      3a1db2d1
    • B
      auto merge of #7884 : pcwalton/rust/check-loans-and-inside-at, r=graydon · ec53efa6
      bors 提交于
      r? @graydon
      ec53efa6
    • B
      auto merge of #7858 : bblum/rust/kill, r=brson · e3142c5d
      bors 提交于
      Some notes about the commits.
      
      Exit code propagation commits:
      * ```Reimplement unwrap()``` has the same old code from ```arc::unwrap``` ported to use modern atomic types and finally (it's considerably nicer this way)
      * ```Add try_unwrap()``` has some new slightly-tricky (but pretty simple) concurrency primitive code
      * ```Add KillHandle``` and ```Add kill::Death``` are the bulk of the logic.
      
      Task killing commits:
      * ```Implement KillHandle::kill() and friends```, ```Do a task-killed check```, and ```Add BlockedTask``` implement the killing logic;
      * ```Change the HOF context switchers``` turns said logic on
      
      Linked failure commits:
      * ```Replace *rust_task ptrs``` adapts the taskgroup code to work for both runtimes
      * ```Enable taskgroup code``` does what it says on the tin.
      
      r? @brson
      e3142c5d
    • B
      auto merge of #7419 : catamorphism/rust/default-package, r=graydon · fdbd56ca
      bors 提交于
      r? @brson `rustpkg build`, if executed in a package source directory inside
      a workspace, will now build that package. By "inside a workspace"
      I mean that the parent directory has to be called `src`, and rustpkg
      will create a `build` directory in .. if there isn't already one.
      
      Same goes for `rustpkg install` and `rustpkg clean`.
      
      For the time being, `rustpkg build` (etc.) will still error out if
      you run it inside a directory whose parent isn't called `src`.
      I'm not sure whether or not it's desirable to have it do something
      in a non-workspace directory.
      fdbd56ca
    • B