Vadim Chugunov
38f1c47d18
Removed unused parameter.
2015-09-25 18:53:14 -07:00
Björn Steinbrink
91f7c60d2d
Tell LLVM when a match is exhaustive
...
By putting an "unreachable" instruction into the default arm of a switch
instruction we can let LLVM know that the match is exhaustive, allowing
for better optimizations.
For example, this match:
```rust
pub enum Enum {
One,
Two,
Three,
}
impl Enum {
pub fn get_disc(self) -> u8 {
match self {
Enum::One => 0,
Enum::Two => 1,
Enum::Three => 2,
}
}
}
```
Currently compiles to this on x86_64:
```asm
.cfi_startproc
movzbl %dil, %ecx
cmpl $1, %ecx
setne %al
testb %cl, %cl
je .LBB0_2
incb %al
movb %al, %dil
.LBB0_2:
movb %dil, %al
retq
.Lfunc_end0:
```
But with this change we get:
```asm
.cfi_startproc
movb %dil, %al
retq
.Lfunc_end0:
```
2015-09-25 11:09:19 +02:00
Vadim Chugunov
e82bb915e4
Fix dllimports of static data from rlibs
2015-09-24 22:07:12 -07:00
Vadim Petrochenkov
f284cbc7af
Cleanup interfaces of Name, SyntaxContext and Ident
...
Make sure Name, SyntaxContext and Ident are passed by value
Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-24 23:05:02 +03:00
Eduard Burtescu
f293ea28b4
Remove the deprecated box(PLACE) syntax.
2015-09-24 18:00:08 +03:00
Vadim Petrochenkov
40ce80484c
Remove random Idents outside of libsyntax
2015-09-23 20:04:49 +03:00
Vadim Petrochenkov
2a779062d8
Use Names in the remaining HIR structures with exception of...
...
PathSegment, PatIdent, ExprWhile, ExprLoop, ExprBreak and ExprAgain - they need Idents for resolve
2015-09-22 19:58:29 +03:00
Vadim Petrochenkov
64fb709f99
Use Names in hir::{Field, ExprMethodCall, ExprField}
2015-09-22 19:53:53 +03:00
Vadim Petrochenkov
a4af958786
Use Names in HIR Items
2015-09-22 19:53:52 +03:00
bors
f07f4ef743
Auto merge of #28427 - DiamondLovesYou:gdb-debug-script-load, r=alexcrichton
...
This is so LLVM isn't forced to load every byte of it. Also sets the alignment of
the load. Adds a test for the debug script section.
r? @alexcrichton
2015-09-22 03:35:55 +00:00
Richard Diamond
9a24025661
Avoid loading the whole gdb debug scripts section.
...
This is so LLVM isn't forced to load every byte of it. Also sets the alignment of
the load. Adds a test for the debug script section.
2015-09-21 15:43:52 -05:00
Ms2ger
184c8a99ed
Use ast::AsmDialect's variants qualified, and drop the pointless prefix.
2015-09-21 16:48:25 +02:00
Ms2ger
22fa1aaade
Remove hir::AsmDialect in favour of ast::AsmDialect.
2015-09-21 16:12:53 +02:00
bors
783c3fcc1e
Auto merge of #28345 - japaric:op-assign, r=nmatsakis
...
Implements overload-able augmented/compound assignments, like `a += b` via the `AddAssign` trait, as specified in RFC [953]
[953]: https://github.com/rust-lang/rfcs/blob/master/text/0953-op-assign.md
r? @nikomatsakis
2015-09-19 21:19:29 +00:00
Steve Klabnik
f1473b6c00
Rollup merge of #28443 - GuillaumeGomez:error_codes, r=Manishearth
...
r? @Manishearth
2015-09-19 11:15:48 -04:00
Guillaume Gomez
1adcfb8c13
Add librustc_trans error codes
2015-09-19 17:04:27 +02:00
Jorge Aparicio
3ae3a5fc3c
Overloaded augmented assignments
2015-09-18 21:20:15 -05:00
Björn Steinbrink
2c17bfc20c
Skip no-op adjustments in trans
...
That allows us to keep using trans_into() in case of adjustments that
may actually be ignored in trans because they are a plain deref/ref pair
with no overloaded deref or unsizing.
Unoptimized(!) benchmarks from servo/servo#7638
Before
```
test goser::bench_clone ... bench: 17,701 ns/iter (+/- 58) = 30 MB/s
test goser::bincode::bench_decoder ... bench: 33,715 ns/iter (+/- 300) = 11 MB/s
test goser::bincode::bench_deserialize ... bench: 36,804 ns/iter (+/- 329) = 9 MB/s
test goser::bincode::bench_encoder ... bench: 34,695 ns/iter (+/- 149) = 11 MB/s
test goser::bincode::bench_populate ... bench: 18,879 ns/iter (+/- 88)
test goser::bincode::bench_serialize ... bench: 31,668 ns/iter (+/- 156) = 11 MB/s
test goser::capnp::bench_deserialize ... bench: 2,049 ns/iter (+/- 87) = 218 MB/s
test goser::capnp::bench_deserialize_packed ... bench: 10,707 ns/iter (+/- 258) = 31 MB/s
test goser::capnp::bench_populate ... bench: 635 ns/iter (+/- 5)
test goser::capnp::bench_serialize ... bench: 35,657 ns/iter (+/- 155) = 12 MB/s
test goser::capnp::bench_serialize_packed ... bench: 37,881 ns/iter (+/- 146) = 8 MB/s
test goser::msgpack::bench_decoder ... bench: 50,634 ns/iter (+/- 307) = 5 MB/s
test goser::msgpack::bench_encoder ... bench: 25,738 ns/iter (+/- 90) = 11 MB/s
test goser::msgpack::bench_populate ... bench: 18,900 ns/iter (+/- 138)
test goser::protobuf::bench_decoder ... bench: 2,791 ns/iter (+/- 29) = 102 MB/s
test goser::protobuf::bench_encoder ... bench: 75,414 ns/iter (+/- 358) = 3 MB/s
test goser::protobuf::bench_populate ... bench: 19,248 ns/iter (+/- 92)
test goser::rustc_serialize_json::bench_decoder ... bench: 109,999 ns/iter (+/- 797) = 5 MB/s
test goser::rustc_serialize_json::bench_encoder ... bench: 58,777 ns/iter (+/- 418) = 10 MB/s
test goser::rustc_serialize_json::bench_populate ... bench: 18,887 ns/iter (+/- 76)
test goser::serde_json::bench_deserializer ... bench: 104,803 ns/iter (+/- 770) = 5 MB/s
test goser::serde_json::bench_populate ... bench: 18,890 ns/iter (+/- 69)
test goser::serde_json::bench_serializer ... bench: 75,046 ns/iter (+/- 435) = 8 MB/s
```
After
```
test goser::bench_clone ... bench: 16,052 ns/iter (+/- 188) = 34 MB/s
test goser::bincode::bench_decoder ... bench: 31,194 ns/iter (+/- 941) = 12 MB/s
test goser::bincode::bench_deserialize ... bench: 33,934 ns/iter (+/- 352) = 10 MB/s
test goser::bincode::bench_encoder ... bench: 30,737 ns/iter (+/- 1,969) = 13 MB/s
test goser::bincode::bench_populate ... bench: 17,234 ns/iter (+/- 176)
test goser::bincode::bench_serialize ... bench: 28,269 ns/iter (+/- 452) = 12 MB/s
test goser::capnp::bench_deserialize ... bench: 2,019 ns/iter (+/- 85) = 221 MB/s
test goser::capnp::bench_deserialize_packed ... bench: 10,662 ns/iter (+/- 527) = 31 MB/s
test goser::capnp::bench_populate ... bench: 607 ns/iter (+/- 2)
test goser::capnp::bench_serialize ... bench: 30,488 ns/iter (+/- 219) = 14 MB/s
test goser::capnp::bench_serialize_packed ... bench: 33,731 ns/iter (+/- 201) = 9 MB/s
test goser::msgpack::bench_decoder ... bench: 46,921 ns/iter (+/- 461) = 6 MB/s
test goser::msgpack::bench_encoder ... bench: 22,315 ns/iter (+/- 96) = 12 MB/s
test goser::msgpack::bench_populate ... bench: 17,268 ns/iter (+/- 73)
test goser::protobuf::bench_decoder ... bench: 2,658 ns/iter (+/- 44) = 107 MB/s
test goser::protobuf::bench_encoder ... bench: 71,024 ns/iter (+/- 359) = 4 MB/s
test goser::protobuf::bench_populate ... bench: 17,704 ns/iter (+/- 104)
test goser::rustc_serialize_json::bench_decoder ... bench: 107,867 ns/iter (+/- 759) = 5 MB/s
test goser::rustc_serialize_json::bench_encoder ... bench: 52,327 ns/iter (+/- 479) = 11 MB/s
test goser::rustc_serialize_json::bench_populate ... bench: 17,262 ns/iter (+/- 68)
test goser::serde_json::bench_deserializer ... bench: 99,156 ns/iter (+/- 657) = 6 MB/s
test goser::serde_json::bench_populate ... bench: 17,264 ns/iter (+/- 77)
test goser::serde_json::bench_serializer ... bench: 66,135 ns/iter (+/- 392) = 9 MB/s
```
2015-09-18 15:46:58 +02:00
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
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
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
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
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
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