rust/src/librustc_codegen_llvm
Mazdak Farrokhzad 778b631ff0
Rollup merge of #62809 - alexcrichton:wasm-llvm-9, r=nikic
rustc: Update wasm32 support for LLVM 9

This commit brings in a number of minor updates for rustc's support for
the wasm target which has changed in the LLVM 9 update. Notable updates
include:

* The compiler now no longer manually inserts the `producers` section,
  instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata
  for the `processed-by` directive (which is now emitted on the wasm
  target in this PR) and it uses debuginfo to figure out what `language`
  to put in the `producers` section.

* Threaded WebAssembly code now requires different flags to be passed
  with LLD. In LLD we now pass:

  * `--shared-memory` - required since objects are compiled with
    atomics. This also means that the generated memory will be marked as
    `shared`.
  * `--max-memory=1GB` - required with the `--shared-memory` argument
    since shared memories in WebAssembly must have a maximum size. The
    1GB number is intended to be a conservative estimate for rustc, but
    it should be overridable with `-C link-arg` if necessary.
  * `--passive-segments` - this has become the default for multithreaded
    memory, but when compiling a threaded module all data segments need
    to be marked as passive to ensure they don't re-initialize memory
    for each thread. This will also cause LLD to emit a synthetic
    function to initialize memory which users will have to arrange to
    call.
  * The `__heap_base` and `__data_end` globals are explicitly exported
    since they're now hidden by default due to the `--export` flags we
    pass to LLD.
2019-07-29 02:10:52 +02:00
..
back Don't add extra passes into the function pass manager 2019-07-15 09:45:14 +02:00
debuginfo rustc: Update wasm32 support for LLVM 9 2019-07-25 07:08:45 -07:00
llvm Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
abi.rs Pass type to byval attributes 2019-07-09 21:55:29 +02:00
allocator.rs Merge rustc_allocator into libsyntax_ext 2019-07-24 12:27:58 +03:00
asm.rs hygiene: Tweak naming some more 2019-07-19 12:02:57 +03:00
attributes.rs Translate target features for LLVM 9 2019-07-09 21:55:29 +02:00
base.rs Remove needless lifetimes 2019-07-03 10:01:02 +02:00
build.rs Remove licenses 2018-12-25 21:08:33 -07:00
builder.rs Remove vector fadd/fmul reduction workarounds 2019-07-20 18:49:50 +02:00
callee.rs remove reexport of rustc::ty::Instance 2019-06-02 22:32:42 -05:00
Cargo.toml Remove some dummy dependencies 2019-07-07 03:23:00 +02:00
common.rs Remove vector fadd/fmul reduction workarounds 2019-07-20 18:49:50 +02:00
consts.rs Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc 2019-06-22 01:42:38 +02:00
context.rs Strip function pointer alignment for older LLVM versions 2019-07-09 21:55:29 +02:00
declare.rs Pass type to byval attributes 2019-07-09 21:55:29 +02:00
error_codes.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
intrinsic.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
lib.rs Deny unused_lifetimes through rustbuild 2019-07-28 18:47:02 +03:00
llvm_util.rs add support for hexagon-unknown-linux-musl 2019-07-22 09:44:58 -05:00
metadata.rs format a bit 2019-07-07 09:32:36 +02:00
mono_item.rs remove reexport of rustc::ty::Instance 2019-06-02 22:32:42 -05:00
README.md rustc-guide has moved 2018-11-26 15:03:13 -06:00
type_.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
type_of.rs rustc_codegen_llvm: deny(unused_lifetimes). 2019-06-12 16:02:03 +03:00
va_arg.rs Expose VaListImpl as the Rust equivalent of __va_list_tag and implement Clone for it. 2019-06-17 16:04:49 -07:00
value.rs librustc_codegen_llvm: deny(elided_lifetimes_in_paths) 2019-02-25 08:40:18 +01:00

The codegen crate contains the code to convert from MIR into LLVM IR, and then from LLVM IR into machine code. In general it contains code that runs towards the end of the compilation process.

For more information about how codegen works, see the rustc guide.