Skip to content

Improve codegen for intrinsics #7851

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

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3c19f1b
Refactored int/uint range code in preparation for change to range_rev…
pnkfelix Jun 27, 2013
db0a13b
Switch over to new range_rev semantics; fix #5270.
pnkfelix Jul 1, 2013
3896d46
Fix #5270: another test I did not update properly.
pnkfelix Jul 11, 2013
877bba9
Permit C-style enums in vector repeat length expressions (N.B. values…
jdm Jul 16, 2013
712ac83
Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764
ozten Jul 16, 2013
53e934c
auto merge of #7684 : pnkfelix/rust/fsk-invert-range-rev-halfclosedne…
bors Jul 16, 2013
ad3a697
Add project information to l10n templates.
omasanori Jul 16, 2013
8a1002f
auto merge of #7827 : jdm/rust/enumlength, r=graydon
bors Jul 16, 2013
40f7434
test: new codegen tests, rename hello.
graydon Jul 17, 2013
948a624
Add a `get_mut` method for TLS
alexcrichton Jul 17, 2013
0fd4d5d
Sort lint attributes to print them in a more sane way
alexcrichton Jul 17, 2013
4bd716a
auto merge of #7831 : ozten/rust/issues-7764-swap_unwarp-take-unwrap,…
bors Jul 17, 2013
af54f63
auto merge of #7828 : alexcrichton/rust/lang-opt, r=graydon
bors Jul 17, 2013
a93244d
auto merge of #7839 : graydon/rust/new-codegen-tests, r=pcwalton
bors Jul 17, 2013
c032ddd
auto merge of #7841 : alexcrichton/rust/tls++, r=huonw
bors Jul 17, 2013
9da42dc
auto merge of #7835 : omasanori/rust/l10n-improvement, r=pnkfelix
bors Jul 17, 2013
93c270c
auto merge of #7843 : alexcrichton/rust/better-lint-help, r=huonw
bors Jul 17, 2013
3e57251
Remove duplicated code from trans_intrinsics
dotdash Jul 11, 2013
15ea4a8
Generate better code for intrinsics
dotdash Jul 16, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,113 changes: 631 additions & 482 deletions doc/po/rust.md.pot

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions doc/po/rustpkg.md.pot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"Project-Id-Version: Rust 0.8-pre\n"
"POT-Creation-Date: 2013-07-17 07:18+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
#. type: Plain text
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
#: doc/tutorial-borrowed-ptr.md:4 doc/tutorial-ffi.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4 doc/tut.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4
msgid "# Introduction"
msgstr ""

Expand Down
12 changes: 6 additions & 6 deletions doc/po/tutorial-borrowed-ptr.md.pot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"Project-Id-Version: Rust 0.8-pre\n"
"POT-Creation-Date: 2013-07-17 07:18+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -19,12 +19,12 @@ msgstr ""
#. type: Plain text
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
#: doc/tutorial-borrowed-ptr.md:4 doc/tutorial-ffi.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4 doc/tut.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4
msgid "# Introduction"
msgstr ""

#. type: Plain text
#: doc/tutorial.md:1110 doc/tutorial-borrowed-ptr.md:72
#: doc/tutorial.md:1111 doc/tutorial-borrowed-ptr.md:72
msgid "Now we can call `compute_distance()` in various ways:"
msgstr ""

Expand Down
170 changes: 163 additions & 7 deletions doc/po/tutorial-container.md.pot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"Project-Id-Version: Rust 0.8-pre\n"
"POT-Creation-Date: 2013-07-17 07:18+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -195,7 +195,7 @@ msgid ""
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:89
#: doc/tutorial-container.md:89 doc/tutorial-container.md:262
#, no-wrap
msgid ""
"~~~\n"
Expand All @@ -217,7 +217,7 @@ msgid ""
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:107
#: doc/tutorial-container.md:107 doc/tutorial-container.md:284
#, no-wrap
msgid ""
"impl Iterator<int> for ZeroStream {\n"
Expand Down Expand Up @@ -440,6 +440,162 @@ msgid ""
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:207
#: doc/tutorial-container.md:208
msgid "// the iterator is now fully consumed assert!(it.next().is_none()); ~~~"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:210
msgid "## Conversion"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:212
msgid ""
"Iterators offer generic conversion to containers with the `collect` adaptor:"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:218
msgid ""
"~~~ let xs = [0, 1, 1, 2, 3, 5, 8]; let ys = xs.rev_iter().skip(1)."
"transform(|&x| x * 2).collect::<~[int]>(); assert_eq!(ys, ~[10, 6, 4, 2, 2, "
"0]); ~~~"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:221
msgid ""
"The method requires a type hint for the container type, if the surrounding "
"code does not provide sufficient information."
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:225
msgid ""
"Containers can provide conversion from iterators through `collect` by "
"implementing the `FromIterator` trait. For example, the implementation for "
"vectors is as follows:"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:238
#, no-wrap
msgid ""
"~~~\n"
"impl<A, T: Iterator<A>> FromIterator<A, T> for ~[A] {\n"
" pub fn from_iterator(iterator: &mut T) -> ~[A] {\n"
" let (lower, _) = iterator.size_hint();\n"
" let mut xs = with_capacity(lower);\n"
" for iterator.advance |x| {\n"
" xs.push(x);\n"
" }\n"
" xs\n"
" }\n"
"}\n"
"~~~\n"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:240
msgid "### Size hints"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:243
msgid ""
"The `Iterator` trait provides a `size_hint` default method, returning a "
"lower bound and optionally on upper bound on the length of the iterator:"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:247
msgid "~~~ fn size_hint(&self) -> (uint, Option<uint>) { (0, None) } ~~~"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:251
msgid ""
"The vector implementation of `FromIterator` from above uses the lower bound "
"to pre-allocate enough space to hold the minimum number of elements the "
"iterator will yield."
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:254
msgid ""
"The default implementation is always correct, but it should be overridden if "
"the iterator can provide better information."
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:256
msgid ""
"The `ZeroStream` from earlier can provide an exact lower and upper bound:"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:267
#, no-wrap
msgid ""
"impl ZeroStream {\n"
" fn new(n: uint) -> ZeroStream {\n"
" ZeroStream { remaining: n }\n"
" }\n"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:272
#, no-wrap
msgid ""
" fn size_hint(&self) -> (uint, Option<uint>) {\n"
" (self.remaining, Some(self.remaining))\n"
" }\n"
"}\n"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:286
msgid "## Double-ended iterators"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:290
msgid ""
"The `DoubleEndedIterator` trait represents an iterator able to yield "
"elements from either end of a range. It inherits from the `Iterator` trait "
"and extends it with the `next_back` function."
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:293
msgid ""
"A `DoubleEndedIterator` can be flipped with the `invert` adaptor, returning "
"another `DoubleEndedIterator` with `next` and `next_back` exchanged."
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:300
msgid ""
"~~~ let xs = [1, 2, 3, 4, 5, 6]; let mut it = xs.iter(); println(fmt!(\"%?"
"\", it.next())); // prints `Some(&1)` println(fmt!(\"%?\", it.next())); // "
"prints `Some(&2)` println(fmt!(\"%?\", it.next_back())); // prints `Some(&6)`"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:306
#, no-wrap
msgid ""
"// prints `5`, `4` and `3`\n"
"for it.invert().advance |&x| {\n"
" println(fmt!(\"%?\", x))\n"
"}\n"
"~~~\n"
msgstr ""

#. type: Plain text
#: doc/tutorial-container.md:308
msgid ""
"The `rev_iter` and `mut_rev_iter` methods on vectors just return an inverted "
"version of the standard immutable and mutable vector iterators."
msgstr ""
12 changes: 6 additions & 6 deletions doc/po/tutorial-ffi.md.pot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"Project-Id-Version: Rust 0.8-pre\n"
"POT-Creation-Date: 2013-07-17 07:18+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -19,12 +19,12 @@ msgstr ""
#. type: Plain text
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
#: doc/tutorial-borrowed-ptr.md:4 doc/tutorial-ffi.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4 doc/tut.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4
msgid "# Introduction"
msgstr ""

#. type: Plain text
#: doc/tutorial.md:875 doc/tutorial-ffi.md:143
#: doc/tutorial.md:876 doc/tutorial-ffi.md:143
msgid "# Destructors"
msgstr ""

Expand Down
10 changes: 5 additions & 5 deletions doc/po/tutorial-macros.md.pot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"Project-Id-Version: Rust 0.8-pre\n"
"POT-Creation-Date: 2013-07-17 07:18+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
#. type: Plain text
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
#: doc/tutorial-borrowed-ptr.md:4 doc/tutorial-ffi.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4 doc/tut.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4
msgid "# Introduction"
msgstr ""

Expand Down
10 changes: 5 additions & 5 deletions doc/po/tutorial-tasks.md.pot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-07-07 21:10+0300\n"
"Project-Id-Version: Rust 0.8-pre\n"
"POT-Creation-Date: 2013-07-17 07:18+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
#. type: Plain text
#: doc/rust.md:4 doc/rustpkg.md:4 doc/tutorial.md:4
#: doc/tutorial-borrowed-ptr.md:4 doc/tutorial-ffi.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4 doc/tut.md:4
#: doc/tutorial-macros.md:4 doc/tutorial-tasks.md:4
msgid "# Introduction"
msgstr ""

Expand Down
Loading