rust/src/libsyntax
Alex Crichton 7df6f4161c rustc: Add a #[wasm_custom_section] attribute
This commit is an implementation of adding custom sections to wasm artifacts in
rustc. The intention here is to expose the ability of the wasm binary format to
contain custom sections with arbitrary user-defined data. Currently neither our
version of LLVM nor LLD supports this so the implementation is currently custom
to rustc itself.

The implementation here is to attach a `#[wasm_custom_section = "foo"]`
attribute to any `const` which has a type like `[u8; N]`. Other types of
constants aren't supported yet but may be added one day! This should hopefully
be enough to get off the ground with *some* custom section support.

The current semantics are that any constant tagged with `#[wasm_custom_section]`
section will be *appended* to the corresponding section in the final output wasm
artifact (and this affects dependencies linked in as well, not just the final
crate). This means that whatever is interpreting the contents must be able to
interpret binary-concatenated sections (or each constant needs to be in its own
custom section).

To test this change the existing `run-make` test suite was moved to a
`run-make-fulldeps` folder and a new `run-make` test suite was added which
applies to all targets by default. This test suite currently only has one test
which only runs for the wasm target (using a node.js script to use `WebAssembly`
in JS to parse the wasm output).
2018-03-22 13:16:38 -07:00
..
diagnostics Auto merge of #48917 - petrochenkov:import, r=oli-obk 2018-03-18 01:50:52 +00:00
ext Auto merge of #48917 - petrochenkov:import, r=oli-obk 2018-03-18 01:50:52 +00:00
parse Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebank 2018-03-22 22:43:37 +08:00
print Auto merge of #48917 - petrochenkov:import, r=oli-obk 2018-03-18 01:50:52 +00:00
util Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
abi.rs add thiscall calling convention support 2017-05-24 16:40:03 -04:00
ast.rs Add some docs + Fix rebase 2018-03-17 22:29:15 +03:00
attr.rs Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
build.rs rustc: Add some build scripts for librustc crates 2017-07-22 22:04:13 -07:00
Cargo.toml Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
codemap.rs CodeMap functions refactored. 2018-03-18 20:46:29 -03:00
config.rs Make it possible to ungate features by epoch 2018-03-08 17:10:05 -08:00
diagnostic_list.rs Stabilize inclusive_range_syntax language feature. 2018-03-15 16:58:02 +08:00
entry.rs Cleanup InternedString. 2016-11-21 09:00:56 +00:00
epoch.rs Note the future epoch for epoch lints 2018-03-08 17:10:06 -08:00
feature_gate.rs rustc: Add a #[wasm_custom_section] attribute 2018-03-22 13:16:38 -07:00
fold.rs Rename Span::empty to Span::shrink_to_lo, add Span::shrink_to_hi 2018-03-17 22:12:21 +03:00
json.rs Require the code mapper to be thread-safe 2018-03-15 00:43:03 +01:00
lib.rs Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
ptr.rs syntax: Rename P::unwrap into P::into_inner 2017-12-17 02:21:29 +03:00
README.md Replace many of the last references to readmes 2018-03-16 12:43:22 -05:00
show_span.rs use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
std_inject.rs Rename Span::empty to Span::shrink_to_lo, add Span::shrink_to_hi 2018-03-17 22:12:21 +03:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebank 2018-03-22 22:43:37 +08:00
test_snippet.rs Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
tokenstream.rs Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
visit.rs AST: Make renames in imports closer to the source 2018-03-17 22:12:21 +03:00

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.

For more information about how these things work in rustc, see the rustc guide: