rust/mk
bors eebf6743d8 Auto merge of #30140 - michaelwoerister:tls-encoding, r=nikomatsakis
With this commit, metadata encoding and decoding can make use of thread-local encoding and decoding contexts. These allow implementers of `serialize::Encodable` and `Decodable` to access information and
datastructures that would otherwise not be available to them. For example, we can automatically translate def-id and span information during decoding because the decoding context knows which crate the data is decoded from. Or it allows to make `ty::Ty` decodable because the context has access to the `ty::ctxt` that is needed for creating `ty::Ty` instances.

Some notes:
- `tls::with_encoding_context()` and `tls::with_decoding_context()` (as opposed to their unsafe versions) try to prevent the TLS data getting out-of-sync by making sure that the encoder/decoder passed in is actually the same as the one stored in the context. This should prevent accidentally reading from the wrong decoder.
- There are no real tests in this PR. I had a unit tests for some of the core aspects of the TLS implementation but it was kind of brittle, a lot of code for mocking `ty::ctxt`, `crate_metadata`, etc and did actually test not so much. The code will soon be tested by the first incremental compilation auto-tests that rely on MIR being properly serialized. However, if people think that some tests should be added before this can land, I'll try to provide some that make sense.

r? @nikomatsakis
2015-12-09 15:10:37 +00:00
..
cfg Remove STARTUP_OBJS from Makefile deps for non win-gnu targets. 2015-12-08 14:56:22 +01:00
clean.mk Added missing argument to 'find' 2015-10-27 23:47:53 +13:00
crates.mk Add scoped thread-local encoding and decoding contexts to cstore. 2015-12-09 09:47:32 -05:00
ctags.mk Update the ctags rules and targets. 2015-07-30 06:35:42 +10:00
debuggers.mk debuginfo: Create common debugger pretty printer module. 2015-05-30 20:06:08 +02:00
dist.mk mk: Fix make dist 2015-12-04 08:55:02 -08:00
docs.mk src/doc/trpl -> src/doc/book 2015-11-19 11:30:18 -05:00
grammar.mk Make lexer tooling message more generic 2015-09-23 11:43:49 -04:00
host.mk mk: Add space before line continuation backslash 2014-07-23 08:44:11 -07:00
install.mk Fix typo in make var 2015-12-07 00:20:35 +01:00
llvm.mk Escape some variables in llvm.mk 2015-11-13 15:15:51 -05:00
main.mk mk: Remove obsolete comment 2015-12-02 02:13:32 +00:00
perf.mk support for GNU configure syntax 2013-10-29 16:22:08 -07:00
platform.mk Set CFLAGS/LDFLAGS/etc according to Debian policy 2015-11-20 12:51:10 -02:00
prepare.mk Fix --libdir installs 2015-11-16 18:55:07 -05:00
reconfig.mk mk: Fix reconfiguring top-level ./configure 2015-06-17 17:32:11 -07:00
rt.mk Make sure rsbegin.o and rsend.o get packaged with target lib artifacts. 2015-11-07 17:56:55 -08:00
rustllvm.mk trans: Use LLVM's writeArchive to modify archives 2015-07-10 09:06:21 -07:00
snap.mk Remove extra eval call in snap.mk 2015-11-13 15:15:51 -05:00
stage0.mk mk/stage0: complain instead of creating an empty file 2014-11-20 16:00:12 -05:00
target.mk Remove STARTUP_OBJS from Makefile deps for non win-gnu targets. 2015-12-08 14:56:22 +01:00
tests.mk Fix typo 2015-12-03 18:29:00 -05:00
util.mk mk: Build crates with relative paths to rustc 2015-06-13 01:41:52 +02:00