Commit Graph

34 Commits

Author SHA1 Message Date
Jack Huey a24df5b3cd Reintegrate chalk using chalk-solve 2020-05-07 17:35:58 -04:00
Dylan DPC 14d608f1d8
Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikic
Define UB in float-to-int casts to saturate

This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.
2020-05-06 16:58:50 +02:00
Mark Rousskov 9907ad6ed9 Define UB in float-to-int casts to saturate
- Round to zero, and representable values cast directly.
- `NaN` goes to 0
- Values beyond the limits of the type are saturated to the "nearest value"
  (essentially rounding to zero, in some sense) in the integral type, so e.g.
  `f32::INFINITY` would go to `{u,i}N::MAX.`
2020-05-06 08:14:21 -04:00
Sam Elliott cda994633e Add Option to Force Unwind Tables
When panic != unwind, `nounwind` is added to all functions for a target.
This can cause issues when a panic happens with RUST_BACKTRACE=1, as
there needs to be a way to reconstruct the backtrace. There are three
possible sources of this information: forcing frame pointers (for which
an option exists already), debug info (for which an option exists), or
unwind tables.

Especially for embedded devices, forcing frame pointers can have code
size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads).
In code, it can be the case that debug info is not kept, so it is useful
to provide this third option, unwind tables, that users can use to
reconstruct the call stack. Reconstructing this stack is harder than
with frame pointers, but it is still possible.

This commit adds a compiler option which allows a user to force the
addition of unwind tables. Unwind tables cannot be disabled on targets
that require them for correctness, or when using `-C panic=unwind`.
2020-05-04 12:08:35 +01:00
Alex Crichton e1832fa4e4 Rename `bitcode-in-rlib` option to `embed-bitcode`
This commit finishes work first pioneered in #70458 and started in #71528.
The `-C bitcode-in-rlib` option, which has not yet reached stable, is
renamed to `-C embed-bitcode` since that more accurately reflects what
it does now anyway. Various tests and such are updated along the way as
well.

This'll also need to be backported to the beta channel to ensure we
don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-05-01 09:05:13 -07:00
Amanieu d'Antras 2f5bd9d0f1 Remove -Z no-landing-pads flag 2020-04-29 01:05:55 +01:00
Vadim Petrochenkov feeb75e263 rustc_target: Stop using "string typing" for TLS models
Introduce `enum TlsModel` instead.
2020-04-26 23:36:00 +03:00
Vadim Petrochenkov fb91e5ed2f rustc_target: Stop using "string typing" for relocation models
Introduce `enum RelocModel` instead.
2020-04-26 11:18:47 +03:00
Nicholas Nethercote 6e7ba26bbd Use macros for option tests. 2020-04-22 22:47:05 +10:00
Nicholas Nethercote 14ea491744 Add all the missing option tests. 2020-04-22 22:45:33 +10:00
Nicholas Nethercote 4348f31e3b Alphabetize the `-C` and `-Z` options.
In the code, test, and docs, because it makes it much easier to find
things.

Other than adding the comments about alphabetical order, this commit
only moves things around.
2020-04-22 22:44:37 +10:00
Nicholas Nethercote ae322ff651 Add a new option `-Cbitcode-in-rlib`.
It defaults to true, but Cargo will set this to false whenever it can to
reduce compile times.
2020-04-22 15:22:18 +10:00
Nicholas Nethercote 58217bc996 Replace uses of `parse_opt_*` with `parse_*` where possible.
This lets us specify the default at the options declaration point,
instead of using `.unwrap(default)` or `None | Some(default)` at some
use point far away. It also makes the code more concise.
2020-04-19 19:53:54 +10:00
Luca Barbieri ac2b84f962 Depend on getopts from crates.io
rustc_session exports it for other crates to avoid mismatching
crate versions.
2020-04-11 17:49:16 -04:00
Vadim Petrochenkov 13bd25e472 Do not lose or reorder user-provided linker arguments 2020-04-04 22:01:18 +03:00
Mazdak Farrokhzad 84a4633880
Rollup merge of #70511 - ecstatic-morse:mir-dataflow-graphviz, r=davidtwco
Add `-Z dump-mir-dataflow` flag for dumping dataflow results visualization

Previously, to visualize the results of a MIR dataflow pass, one had to add a `#[rustc_mir(borrowck_graphviz_postflow)]` attribute to functions of interest. However, there is no way to specify this attribute on closures and generators, so it was impossible to view results for these MIR bodies.

This PR adds a flag, `-Z dump-mir-dataflow`, which will output the dataflow results for any functions specified in `-Z dump-mir` to the output directory specified by `-Z dump-mir-dir`. This behavior is modeled on the `-Z dump-mir-graphviz` flag.
2020-04-01 14:32:12 +02:00
Mazdak Farrokhzad 1ccb0b4a02 rustc -> rustc_middle part 3 (rustfmt) 2020-03-30 07:19:55 +02:00
Mazdak Farrokhzad 0cb9e36090 rustc -> rustc_middle part 2 2020-03-30 07:16:56 +02:00
Dylan MacKenzie 4d099e6308 Add `-Z dump-mir-dataflow` 2020-03-28 14:05:59 -07:00
Nicholas Nethercote 02840ca8ab Remove `no_integrated_as` mode.
Specifically, remove both `-Z no_integrated_as` and
`TargetOptions::no_integrated_as`. The latter was only used for the
`msp430_none_elf` platform, for which it's no longer required.
2020-03-27 11:59:10 +11:00
Nicholas Nethercote 46c8a2c26e Remove `-Z incremental`.
`-C incremental` was introduced over two years ago. `-Z incremental` was
kept for transitioning, but it's been long enough now that it should be
ok to remove it.
2020-03-24 12:08:30 +11:00
Nicholas Nethercote a3782671cf Remove several dead `-Z` options. 2020-03-24 12:07:26 +11:00
Mazdak Farrokhzad 4392a8b73c use direct imports for `rustc::{lint, session}`. 2020-03-16 02:52:06 +01:00
Vadim Petrochenkov e08c279eac Rename `syntax` to `rustc_ast` in source code 2020-02-29 21:59:09 +03:00
Mazdak Farrokhzad 51078ceb44 fix ui-fulldeps & tests fallout 2020-01-11 07:42:26 +01:00
Vadim Petrochenkov 41a93cba38 Remove `-Z continue-parse-after-error` 2020-01-08 21:48:04 +03:00
Mazdak Farrokhzad b1aad76586 Normalize `syntax::edition` imports. 2020-01-02 19:31:38 +01:00
Mazdak Farrokhzad 4ff12ce4c1 Normalize `syntax::symbol` imports. 2020-01-02 13:57:04 +01:00
Mark Rousskov a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Eric Huss 590dd7dfef Add options to --extern flag. 2019-12-09 08:08:13 -08:00
Vadim Petrochenkov db357a6e3b rustc_plugin: Remove support for adding plugins from command line 2019-12-01 20:53:25 +03:00
Mark Rousskov 70805e6444 Delete ProcessCfgMod
The previous commit removes the use of this, and now we cleanup.
2019-11-20 14:07:57 -05:00
Mazdak Farrokhzad be023ebe85 move config.rs to libsyntax_expand 2019-11-10 02:46:17 +01:00
Mazdak Farrokhzad d945f9860f move parse_cfgspecs to rustc_interface 2019-10-19 13:25:46 +02:00