Commit Graph

43697 Commits

Author SHA1 Message Date
Björn Steinbrink
f777562eab Pass fat pointers in two immediate arguments
This has a number of advantages compared to creating a copy in memory
and passing a pointer. The obvious one is that we don't have to put the
data into memory but can keep it in registers. Since we're currently
passing a pointer anyway (instead of using e.g. a known offset on the
stack, which is what the `byval` attribute would achieve), we only use a
single additional register for each fat pointer, but save at least two
pointers worth of stack in exchange (sometimes more because more than
one copy gets eliminated). On archs that pass arguments on the stack, we
save a pointer worth of stack even without considering the omitted
copies.

Additionally, LLVM can optimize the code a lot better, to a large degree
due to the fact that lots of copies are gone or can be optimized away.
Additionally, we can now emit attributes like nonnull on the data and/or
vtable pointers contained in the fat pointer, potentially allowing for
even more optimizations.

This results in LLVM passes being about 3-7% faster (depending on the
crate), and the resulting code is also a few percent smaller, for
example:

   text    data  filename
5671479 3941461  before/librustc-d8ace771.so
5447663 3905745  after/librustc-d8ace771.so

1944425 2394024  before/libstd-d8ace771.so
1896769 2387610  after/libstd-d8ace771.so

I had to remove a call in the backtrace-debuginfo test, because LLVM can
now merge the tails of some blocks when optimizations are turned on,
which can't correctly preserve line info.

Fixes #22924

Cc #22891 (at least for fat pointers the code is good now)
2015-06-20 18:58:47 +02:00
Björn Steinbrink
02d74a4852 Make trans_arg_datum fill a destination vector instead of returning its result
This makes it easier to support translating a single rust argument to
more than one llvm argument value later.
2015-06-20 03:35:24 +02:00
Björn Steinbrink
dea5a9608c Simplify argument forwarding in the various shim generators 2015-06-20 03:35:24 +02:00
Björn Steinbrink
f862da5bb8 Use a single match arm for all TyRef variants when deducing function argument attributes
This makes it a lot easier to later add attributes for fat pointers.
2015-06-20 03:33:04 +02:00
bors
4b42cbd5eb Auto merge of #24527 - nikomatsakis:issue-24085, r=nikomatsakis
Expand the "givens" set to cover transitive relations.  The givens array
stores relationships like `'c <= '0` (where `'c` is a free region and
`'0` is an inference variable) that are derived from closure
arguments. These are (rather hackily) ignored for purposes of inference,
preventing spurious errors. The current code did not handle transitive
cases like `'c <= '0` and `'0 <= '1`. Fixes #24085.

r? @pnkfelix 
cc @bkoropoff

*But* I am not sure whether this fix will have a compile-time hit. I'd like to push to try branch observe cycle times.
2015-06-19 22:56:38 +00:00
bors
e4efb47b9d Auto merge of #26351 - eddyb:tls-tcx, r=nikomatsakis
Pre-requisite for splitting the type context into global and local parts.
The `Repr` and `UserString` traits were also replaced by `Debug` and `Display`.
2015-06-19 20:43:14 +00:00
bors
89485b2b6b Auto merge of #26428 - Manishearth:rollup, r=Manishearth
- Successful merges: #26388, #26401, #26414, #26427
- Failed merges:
2015-06-19 16:42:17 +00:00
Niko Matsakis
29c86539b3 Expand the "givens" set to cover transitive relations. The givens array
stores relationships like `'c <= '0` (where `'c` is a free region and
`'0` is an inference variable) that are derived from closure
arguments. These are (rather hackily) ignored for purposes of inference,
preventing spurious errors. The current code did not handle transitive
cases like `'c <= '0` and `'0 <= '1`. Fixes #24085.
2015-06-19 12:22:03 -04:00
Manish Goregaokar
a760d054ef Rollup merge of #26427 - GuillaumeGomez:patch-7, r=Manishearth
See #26396, #26400, #26399, #26398 and #26393.
2015-06-19 17:41:10 +05:30
Manish Goregaokar
812a3f044f Rollup merge of #26414 - alexcrichton:msvc-fix-build, r=brson
Currently all these do is cause linker errors as they try to lower to GNU-like
exception handling, none of which exists with MSVC.
2015-06-19 17:41:09 +05:30
Manish Goregaokar
da55e244a6 Rollup merge of #26401 - jooert:fix26360, r=steveklabnik
Fixes #26360.

r? @steveklabnik
2015-06-19 17:41:09 +05:30
Manish Goregaokar
c16780a3ff Rollup merge of #26388 - frewsxcv:regression-tests-21622, r=alexcrichton
Closes #21622
2015-06-19 17:41:09 +05:30
Guillaume Gomez
9679faa97a Remove error codes from macro 2015-06-19 14:06:33 +02:00
Guillaume Gomez
2015eb881e Replace "Bad example" by a better sentence 2015-06-19 14:05:11 +02:00
Guillaume Gomez
6471dccd3b Add E0016 explanation 2015-06-19 14:03:07 +02:00
Guillaume Gomez
8c5572fc21 Add Universal Function Call Syntax example 2015-06-19 14:01:55 +02:00
Guillaume Gomez
d4c37088ca Add E0034 error explanation 2015-06-19 13:59:51 +02:00
Guillaume Gomez
b4481e68de Remove unneeded indentation 2015-06-19 13:58:52 +02:00
Guillaume Gomez
04888e7c60 Add E0035 error explanation 2015-06-19 13:58:15 +02:00
Guillaume Gomez
00e115d090 Good time concordance 2015-06-19 13:56:53 +02:00
Guillaume Gomez
98205afe0b Add E0036 error explanation 2015-06-19 13:54:57 +02:00
bors
2f5683913c Auto merge of #26413 - alexcrichton:from-raw-fd-prelude, r=sfackler
These were just left out by mistake!
2015-06-18 23:28:41 +00:00
Alex Crichton
45f830b18c std: Add FromRaw{Fd,Handle,Socket} to os preludes
These were just left out by mistake!
2015-06-18 16:14:50 -07:00
Eduard Burtescu
6eed1662af Remove extra fmt::Debug impl for VtableClosureData from #26147. 2015-06-19 01:45:20 +03:00
Eduard Burtescu
d914831145 rustc: add more doc comments to ty::Lift and ty::with_ctxt. 2015-06-19 01:39:26 +03:00
Eduard Burtescu
0b58fdf925 rustc: remove Repr and UserString. 2015-06-19 01:39:26 +03:00
Eduard Burtescu
dfbc9608ce rustc: replace Repr/UserString impls with Debug/Display ones. 2015-06-19 01:36:20 +03:00
Eduard Burtescu
17e333d31b Move AST Repr impls to Debug impls in libsyntax. 2015-06-19 01:32:46 +03:00
Eduard Burtescu
af7daa0daf rustc: remove some unused UserString and Repr impls. 2015-06-19 01:32:45 +03:00
Eduard Burtescu
b510ea1487 Clean up unused argument/variable warnings. 2015-06-19 01:32:45 +03:00
Eduard Burtescu
a3727559c6 rustc: use the TLS type context in Repr and UserString. 2015-06-19 01:32:44 +03:00
Alex Crichton
57260262e7 rustc_trans: Disable landing pads on MSVC
Currently all these do is cause linker errors as they try to lower to GNU-like
exception handling, none of which exists with MSVC.
2015-06-18 15:24:36 -07:00
Eduard Burtescu
1f70a2e370 rustc: allow "lifting" T<'a> to T<'tcx> if the value is part of ty::ctxt<'tcx>. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
d8952e7932 rustc: store the type context in TLS and allow safe access to it. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
6061707348 rustc: leave only one free top-level function in ppaux, and private. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
96ad4a4863 rustc: use Repr and UserString instead of ppaux::ty_to_string. 2015-06-19 01:18:43 +03:00
Eduard Burtescu
4e0cb86a5c rustc: reduce ppaux's public footprint to 5 functions. 2015-06-19 01:18:42 +03:00
Eduard Burtescu
bc383f6294 rustc: enforce stack discipline on ty::ctxt. 2015-06-19 01:18:42 +03:00
Eduard Burtescu
84b49b2d35 rustc_resolve: don't require redundant arguments to resolve_crate. 2015-06-19 01:18:42 +03:00
Eduard Burtescu
2e997ef2d4 rustc: remove ownership of tcx from trans' context. 2015-06-19 01:18:42 +03:00
bors
ff8fee180b Auto merge of #26147 - arielb1:assoc-trans, r=nikomatsakis
Fixes #25700

r? @nikomatsakis
2015-06-18 21:34:04 +00:00
Ariel Ben-Yehuda
21fd312043 Normalize associated types in closure signatures
Fixes #25700.
2015-06-18 23:04:57 +03:00
bors
9cc0b22475 Auto merge of #26192 - alexcrichton:features-clean, r=aturon
This commit shards the all-encompassing `core`, `std_misc`, `collections`, and `alloc` features into finer-grained components that are much more easily opted into and tracked. This reflects the effort to push forward current unstable APIs to either stabilization or removal. Keeping track of unstable features on a much more fine-grained basis will enable the library subteam to quickly analyze a feature and help prioritize internally about what APIs should be stabilized.

A few assorted APIs were deprecated along the way, but otherwise this change is just changing the feature name associated with each API. Soon we will have a dashboard for keeping track of all the unstable APIs in the standard library, and I'll also start making issues for each unstable API after performing a first-pass for stabilization.
2015-06-18 19:14:52 +00:00
Ariel Ben-Yehuda
56d765d0eb Simplify and type_known_to_meet_builtin_bound and make it more correct when
associated types are involved.
2015-06-18 20:51:43 +03:00
Alex Crichton
ec333380e0 Fix libstd tests 2015-06-18 10:51:31 -07:00
Johannes Oertel
d234b0bb5f rustdoc: Update document title when displaying search results
Fixes #26360.
2015-06-18 18:39:31 +02:00
bors
f451812763 Auto merge of #26385 - nham:fix_25396, r=alexcrichton
Currently in the E0252 message, traits and modules are all called types (as in "a type named `Foo` has already been imported", even when `Foo` was a trait or module). This commit changes that to additionally detect when the import in question is a trait or module and report it accordingly.

Fixes #25396.
2015-06-18 16:17:04 +00:00
bors
7a13b93b00 Auto merge of #26392 - oli-obk:unused_functions, r=dotdash
These aren't used anywhere and to my current knowledge it's unlikely that they are going to be used in the future
2015-06-18 12:06:25 +00:00
Oliver Schneider
59638d15c1 remove unused functions from trans and llvm 2015-06-18 13:23:41 +02:00
bors
1ef14d9411 Auto merge of #26358 - nham:fix_24081, r=alexcrichton
Previously, it said "import `Foo` conflicts with existing submodule" even
when it was a type alias, enum, or trait. The message now says the conflict
is with "type in this module" in the case of the first two, and "trait in
this module" for the last one.

Fixes #24081.
2015-06-18 10:30:46 +00:00