about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2020-03-24 12:24:52 +1100
committerNicholas Nethercote <nnethercote@mozilla.com>2020-03-26 13:49:02 +1100
commit87ef16c9dc7b4ebb46c1db3363e1a00586a819d8 (patch)
treee875b1c9e50b80e71c7def992292e79599018b80 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parente1d1db790fb3b2892bbe644c2d7ce1265352b0fd (diff)
downloadrust-87ef16c9dc7b4ebb46c1db3363e1a00586a819d8.tar.gz
rust-87ef16c9dc7b4ebb46c1db3363e1a00586a819d8.zip
Introduce `EmitObj`.
Currently, there are three fields in `ModuleConfig` that dictate
how object files are emitted: `emit_obj`, `obj_is_bitcode`, and
`embed_bitcode`.

Some of the combinations of these fields are nonsensical, in particular
having both `obj_is_bitcode` and `embed_bitcode` true at the same time.

Also, currently:
- we needlessly emit and then delete a bytecode file if `obj_is_bitcode`
  is true but `emit_obj` is false;
- we needlessly embed bitcode in the LLVM module if `embed_bitcode` is
  true and `emit_obj` is false.

This commit combines the three fields into one, with a new type
`EmitObj` (and the auxiliary `BitcodeSection`) which can encode five
different possibilities.

In the old code, `set_flags` would set `obj_is_bitcode` and
`embed_bitcode` on all three of the configs (`modules`, `allocator`,
`metadata`) if the relevant other conditions were met, even if no object
code needed to be emitted for one or more of them. Whereas
`start_async_codegen` would set `emit_obj`, but only for those configs
that need it.

In the new code, `start_async_codegen` does all the work of setting
`emit_obj`, and it only does that for the configs that need it.
`set_flags` no longer sets anything related to object file emission.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions