bors
89faafcd67
Auto merge of #28381 - ebfull:aint-fraid-a-no-ghosts-redux, r=me
...
#27483 redux at Gankro's request.
Fixes #26905 , Closes #28239
r? @nrc
2015-09-17 10:11:23 +00:00
Nick Cameron
d21bfff78c
Remove hir::ExprParen
2015-09-17 12:16:46 +12:00
Nick Cameron
e9f1b06329
Use ast attributes every where (remove HIR attributes).
...
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-16 10:57:06 +12:00
bors
8a19b234c7
Auto merge of #28413 - arielb1:deduplication, r=eddyb
...
clean a few things discovered during my split_ty work
r? @eddyb
2015-09-15 15:01:05 +00:00
Sean Bowe
b096403d43
Ignore PhantomData when checking CoerceUnsized implementations
2015-09-14 22:02:26 -06:00
bors
b1c9616882
Auto merge of #28274 - arielb1:split-ty, r=nikomatsakis
...
That file got way too big for its own good. It could be split more - this is just a start.
r? @nikomatsakis
2015-09-15 01:38:00 +00:00
Ariel Ben-Yehuda
5e4704f6ee
deduplicate erase_regions
...
there is no need for 3 versions of the function
2015-09-15 00:47:14 +03:00
Ariel Ben-Yehuda
5a95acb8ab
split ty::util and ty::adjustment
2015-09-14 14:55:56 +03:00
bors
2d4ae52cbd
Auto merge of #28358 - dotdash:nounwind, r=alexcrichton
...
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
2015-09-14 11:05:34 +00:00
Björn Steinbrink
3ef75d5774
Mark all extern functions as nounwind
...
Unwinding across an FFI boundary is undefined behaviour, so we can mark
all external function as nounwind. The obvious exception are those
functions that actually perform the unwinding.
2015-09-14 11:36:09 +02:00
Ariel Ben-Yehuda
caa10c3bde
move middle::ty and related modules to middle/ty/
2015-09-14 10:56:13 +03:00
Björn Steinbrink
e4e67bd489
Add an attribute to mark function as unwinding
2015-09-13 23:42:40 +02:00
Björn Steinbrink
90c48bed25
Centralise the handling of attributes on extern functions
2015-09-13 23:42:40 +02:00
Alex Crichton
f0b1326dc7
std: Stabilize/deprecate features for 1.4
...
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the
libs team decision for all library features this cycle.
Stabilized APIs:
* `<Box<str>>::into_string`
* `Arc::downgrade`
* `Arc::get_mut`
* `Arc::make_mut`
* `Arc::try_unwrap`
* `Box::from_raw`
* `Box::into_raw`
* `CStr::to_str`
* `CStr::to_string_lossy`
* `CString::from_raw`
* `CString::into_raw`
* `IntoRawFd::into_raw_fd`
* `IntoRawFd`
* `IntoRawHandle::into_raw_handle`
* `IntoRawHandle`
* `IntoRawSocket::into_raw_socket`
* `IntoRawSocket`
* `Rc::downgrade`
* `Rc::get_mut`
* `Rc::make_mut`
* `Rc::try_unwrap`
* `Result::expect`
* `String::into_boxed_slice`
* `TcpSocket::read_timeout`
* `TcpSocket::set_read_timeout`
* `TcpSocket::set_write_timeout`
* `TcpSocket::write_timeout`
* `UdpSocket::read_timeout`
* `UdpSocket::set_read_timeout`
* `UdpSocket::set_write_timeout`
* `UdpSocket::write_timeout`
* `Vec::append`
* `Vec::split_off`
* `VecDeque::append`
* `VecDeque::retain`
* `VecDeque::split_off`
* `rc::Weak::upgrade`
* `rc::Weak`
* `slice::Iter::as_slice`
* `slice::IterMut::into_slice`
* `str::CharIndices::as_str`
* `str::Chars::as_str`
* `str::split_at_mut`
* `str::split_at`
* `sync::Weak::upgrade`
* `sync::Weak`
* `thread::park_timeout`
* `thread::sleep`
Deprecated APIs
* `BTreeMap::with_b`
* `BTreeSet::with_b`
* `Option::as_mut_slice`
* `Option::as_slice`
* `Result::as_mut_slice`
* `Result::as_slice`
* `f32::from_str_radix`
* `f64::from_str_radix`
Closes #27277
Closes #27718
Closes #27736
Closes #27764
Closes #27765
Closes #27766
Closes #27767
Closes #27768
Closes #27769
Closes #27771
Closes #27773
Closes #27775
Closes #27776
Closes #27785
Closes #27792
Closes #27795
Closes #27797
2015-09-11 09:48:48 -07:00
bors
de63207d18
Auto merge of #28282 - DiamondLovesYou:optional-data-layout, r=alexcrichton
...
NFC.
2015-09-10 05:39:48 +00:00
Richard Diamond
cdf6cebc00
Refactor TargetOptions::data_layout
into an Option
al value to reflect current usage.
...
NFC.
2015-09-09 19:16:45 -05:00
bors
55da0e0000
Auto merge of #28277 - DiamondLovesYou:intrinsic-unnamed-addr, r=huonw
...
Intrinsics never have an address, so it doesn't make sense to say that their
address is unnamed.
2015-09-09 03:46:32 +00:00
Richard Diamond
ba72d9722c
Don't add unnamed address attributes to intrinsics.
...
Intrinsics never have an address, so it doesn't make sense to say that their
address is unnamed.
2015-09-06 19:26:41 -05:00
bors
f6aac80375
Auto merge of #28270 - arielb1:raw-fat-ops, r=nrc
...
r? @nrc
Fixes #17736
Fixes #18829
Fixes #23888
Fixes #28236
2015-09-06 23:24:11 +00:00
Ariel Ben-Yehuda
34bc99f860
implement raw fat pointer ops
2015-09-06 16:11:38 +03:00
Niko Matsakis
004d70212a
track, for each upvar, its index in list of upvars
2015-09-06 07:27:22 -04:00
bors
7ee876cb8e
Auto merge of #28221 - huonw:simd, r=alexcrichton
...
The ARM equivalents of the AArch64 are annoyingly more complicated (and some of the AArch64 ones are too).
I think I've got exposed all the x86 intrinsics from SSE to AVX2 now (at least, the ones that LLVM implements as callable intrinsics).
2015-09-05 02:15:41 +00:00
Nick Cameron
6a127e95c7
fixup
2015-09-05 09:45:35 +12:00
Nick Cameron
edca8f73d6
rustfmt librustc_trans/save
2015-09-05 09:45:35 +12:00
Huon Wilson
7241ae9112
Support return aggregates in platform intrinsics.
...
This also involved adding `[TYPE;N]` syntax and aggregate indexing
support to the generator script: it's the only way to be able to have a
parameterised intrinsic that returns an aggregate, since one can't refer
to previous elements of the current aggregate (and that was harder to
implement).
2015-09-04 09:14:13 -07:00
Huon Wilson
2b45a9ab54
Support bitcasts in platform intrinsic generator.
2015-09-04 09:14:13 -07:00
Huon Wilson
62e346af4b
Support void in platform intrinsic generator.
2015-09-04 09:14:13 -07:00
Huon Wilson
d12135a70d
Add support for pointers to generator.py.
2015-09-04 09:14:12 -07:00
bors
2f77a59d16
Auto merge of #28201 - apasel422:issue-26205, r=nikomatsakis
...
Closes #26205 .
r? @eddyb
2015-09-04 14:16:54 +00:00
bors
791e7bcb41
Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichton
...
r? @alexcrichton
2015-09-04 05:15:22 +00:00
Steve Klabnik
055c23da7b
Rollup merge of #28167 - petrochenkov:bytelit, r=nikomatsakis
...
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03 20:10:07 -04:00
Andrew Paseltiner
b8dad48435
Fix multiple mutable autoderefs with Box
...
Closes #26205 .
2015-09-03 14:41:27 -04:00
Vadim Petrochenkov
405c616eaf
Use consistent terminology for byte string literals
...
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03 10:54:53 +03:00
Vadim Petrochenkov
06fb196256
Use null()
/null_mut()
instead of 0 as *const T
/0 as *mut T
2015-09-03 09:49:50 +03:00
Simonas Kazlauskas
d8074e65b0
Use proper span for break and continue labels
...
Fixes #28109
2015-09-03 03:50:43 +03:00
Nick Cameron
facdf2ebb1
Add an intital HIR and lowering step
2015-09-03 10:02:36 +12:00
Huon Wilson
bb6be30d6f
Remove some SIMD codepaths from trans.
2015-08-31 18:33:55 -07:00
bors
2d3e8379c8
Auto merge of #28079 - huonw:simd, r=alexcrichton
...
This adds a new Python script (compatible with 2.7 and 3.x) that will consume some JSON files that define a platform's intrinsics. It can output a file that defines the intrinsics in the compiler, or an `extern` block that will import them.
The complexity of the generator is to be DRY: platforms (especially ARM and AArch64) have a lot of repetition with their intrinsics, for different versions with different types, so being able to write it once is nice.
2015-08-31 21:34:08 +00:00
James Miller
4637d42b58
Translate constructor arguments for zero-sized tuple structs
...
This was preventing any side-effects from the expressions from
happening.
Fixes #28114
2015-08-31 23:57:41 +12:00
Tobias Bucher
aad7ea66da
Make a macro a const fn and remove outdated NB
2015-08-30 14:32:17 +02:00
Huon Wilson
29dcff3aa2
Support different scalar integer widths in Rust v. LLVM.
...
Some x86 C intrinsics are declared to take `int ...` (i.e. exposed in
Rust as `i32`), but LLVM implements them by taking `i8` instead.
2015-08-29 20:11:23 -07:00
Huon Wilson
ee2de27996
Add support for aggregates in platform intrinsics.
...
This adds support for flattened intrinsics, which are called in Rust
with tuples but in LLVM without them (e.g. `foo((a, b))` becomes `foo(a,
b)`). Unflattened ones could be supported, but are not yet.
2015-08-29 15:36:16 -07:00
Huon Wilson
b03ca7f805
Separate integers into signed and unsigned.
...
This is necessary to reflect the ARM APIs accurately, since some
functions explicitly take an unsigned parameter and a signed one, of the
same integer shape, so the no-duplicates check will fail unless we
distinguish.
2015-08-29 15:36:16 -07:00
bors
abfa081c10
Auto merge of #27999 - dotdash:lt, r=eddyb
...
The major change here is in the tiny commit at the end and makes it so that we no longer emit lifetime intrinsics for allocas for function arguments. They are live for the whole function anyway, so the intrinsics add no value. This makes the resulting IR more clear, and reduces the peak memory usage and LLVM times by about 1-4%, depending on the crate.
The remaining changes are just preparatory cleanups and fixes for missing lifetime intrinsics.
2015-08-27 20:09:15 +00:00
bors
ab21fe59e9
Auto merge of #28020 - dotdash:ref_fat_ptr_be_gone, r=eddyb
...
r? @eddyb -- we talked about this on IRC a while back but I only now managed to get the change done.
2015-08-27 03:57:21 +00:00
Björn Steinbrink
05d36965df
Avoid an extra alloca/memcpy when auto-ref'ing fat pointers
...
auto_ref() handles fat pointers just fine and unlike ref_fat_ptr() does so
without creating an unnecessary copy of the pointer.
2015-08-26 19:41:27 +02:00
Ariel Ben-Yehuda
277eeb95c3
move destructors_for_type into AdtDef
2015-08-25 21:52:15 +03:00
Ariel Ben-Yehuda
d07ee255d0
handle dtors having generics in an order different from their ADT
...
Fixes #27997 .
2015-08-25 20:50:30 +03:00
Björn Steinbrink
9a15d664a6
Omit lifetime intrinsics for function arguments and similar top-level items
...
Function arguments are live for the whole function scope, so adding
lifetime intrinsics around them adds no value. The same is true for drop
hint allocas and everything else that goes directly through
lvalue_scratch_datum. So the easiest fix is to emit lifetime intrinsics
only for lvalue datums that are created in to_lvalue_datum_in_scope().
The reduces peak memory usage and LLVM times by about 1-4%, depending on
the crate.
2015-08-25 18:37:02 +02:00
Björn Steinbrink
727a5d543d
Prefer alloc_ty() instead of alloca() where possible
2015-08-25 18:37:01 +02:00