about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/tests.rs
AgeCommit message (Collapse)AuthorLines
2024-04-19coverage. Add coverage-options=mcdc as gate for MC/DC instrumentzhuyunxing-1/+1
2024-04-16Rollup merge of #122811 - nnethercote:mv-SourceMap-init, r=WaffleLapkinGuillaume Gomez-50/+48
Move `SourceMap` initialization So it happens at the same time as `SessionGlobals` initialization, rather than shortly afterward. r? `@WaffleLapkin`
2024-04-16Rollup merge of #121694 - davidtwco:stabilize-relro-level, r=Mark-SimulacrumGuillaume Gomez-1/+1
sess: stabilize `-Zrelro-level` as `-Crelro-level` Stabilise `-Zrelro-level` as `-Crelro-level`. There's no tracking issue for this flag to close.
2024-04-16Move `initialize_checked_jobserver`.Nicholas Nethercote-2/+2
Currently it's a method on `EarlyDiagCtxt`, which is not the right place for it at all -- `EarlyDiagCtxt` is used to issue diagnostics, but shouldn't be doing any of the actual checking. This commit moves it into a standalone function that takes an `EarlyDiagCtxt` as an argument, which is more sensible. This does require adding `EarlyDiagCtxt::early_struct_warn`, so a warning can be returned and then modified with a note. (And that likely explains why somebody put `initialize_checked_jobserver` into `EarlyDiagCtxt` in the first place.)
2024-04-16Construct `SourceMap` at the same time as `SessionGlobals`.Nicholas Nethercote-2/+9
Currently `SourceMap` is constructed slightly later than `SessionGlobals`, and inserted. This commit changes things so they are done at the same time. Benefits: - `SessionGlobals::source_map` changes from `Lock<Option<Lrc<SourceMap>>>` to `Option<Lrc<SourceMap>>`. It's still optional, but mutability isn't required because it's initialized at construction. - `set_source_map` is removed, simplifying `run_compiler`, which is good because that's a critical function and it's nice to make it simpler. This requires moving things around a bit, so the necessary inputs are available when `SessionGlobals` is created, in particular the `loader` and `hash_kind`, which are no longer computed by `build_session`. These inputs are captured by the new `SourceMapInputs` type, which is threaded through various places.
2024-04-16Factor out common code in interface tests.Nicholas Nethercote-48/+39
Replacing `mk_session` with `sess_and_cfgs`, which does a bit more of the shared stuff -- the option parsing and the `build_configuration` call.
2024-04-06Put checks that detect UB under their own flag below debug_assertionsBen Kimock-0/+1
2024-04-03Remove MIR unsafe checkMatthew Jasper-1/+0
This also remove safety information from MIR.
2024-03-25Make sysroot mandatory for rustdocLukas Wirth-1/+1
2024-03-25Implement `-L builtin:$path`Lukas Wirth-23/+32
2024-03-21Rename some `target_cfg` variables as `target`.Nicholas Nethercote-2/+2
Because the underlying type is called `Target`. (There is also a separate type called `TargetCfg`.)
2024-03-21Remove `CodegenBackend::target_override`.Nicholas Nethercote-2/+1
Backend and target selection is a mess: the target can override the backend (via `Target::default_codegen_backend`), *and* the backend can override the target (via `CodegenBackend::target_override`). The code that handles this is ugly. It calls `build_target_config` twice, once before getting the backend and once again afterward. It also must check that both overrides aren't triggering at the same time. This commit removes the latter override. It's used in rust-gpu but @eddyb said via Zulip that removing it would be ok. This simplifies the code greatly, and will allow some nice follow-up refactorings.
2024-03-13coverage: Add `-Zcoverage-options` for fine control of coverageZalathar-5/+7
This new nightly-only flag can be used to toggle fine-grained flags that control the details of coverage instrumentation. Currently the only supported flag value is `branch` (or `no-branch`), which is a placeholder for upcoming support for branch coverage. Other flag values can be added in the future, to prototype proposed new behaviour, or to enable special non-default behaviour.
2024-03-12sess: stabilize relro-levelDavid Wood-1/+1
Signed-off-by: David Wood <david@davidtw.co>
2024-03-11Rollup merge of #116793 - WaffleLapkin:target_rules_the_backend, r=cjgillotJubilee-2/+9
Allow targets to override default codegen backend Implements https://github.com/rust-lang/compiler-team/issues/670.
2024-03-11Rollup merge of #116791 - WaffleLapkin:unparallel-backends, r=oli-obkJubilee-1/+1
Allow codegen backends to opt-out of parallel codegen This makes it a bit easier to write cursed codegen backends.
2024-03-10Introduce perma-unstable `wasm-c-abi` flagdaxpedda-1/+4
2024-03-06Change the documented implicit value of `-C instrument-coverage` to `=yes`Zalathar-1/+1
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-0/+1
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-1/+1
2024-02-15Use generic `NonZero` internally.Markus Reiter-2/+2
2024-02-15Rename `-Zno_parallel_llvm` -> `-Zno_parallel_backend`Maybe Waffle-1/+1
2024-02-15Refactor out a repeating pattern with `get_or_default_sysroot`Maybe Waffle-7/+2
2024-02-14Allow targets to override default codegen backendMaybe Waffle-1/+13
2024-02-07Rollup merge of #119162 - heiher:direct-access-external-data, r=petrochenkovGuillaume Boisseau-0/+1
Add unstable `-Z direct-access-external-data` cmdline flag for `rustc` The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/707 Fixes #118053
2024-01-20Track `verbose` and `verbose_internals`jyn-1/+2
bjorn3 says: > On errors we don't finalize the incr comp cache, but non-fatal diagnostics are cached afaik. Otherwise we would have to replay the query in question, which we may not be able to do if the query key is not reconstructible from the dep node fingerprint. So we must track these flags to avoid replaying incorrect diagnostics.
2024-01-17Improved collapse_debuginfo attribute, added command-line flag (no|external|yes)Andrew Zhogin-4/+5
2024-01-16Add unstable `-Z direct-access-external-data` cmdline flag for `rustc`WANG Rui-0/+1
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/707
2024-01-09Rollup merge of #118680 - djkoloski:shell_argfiles, r=compiler-errorsGuillaume Gomez-0/+1
Add support for shell argfiles Closes https://github.com/rust-lang/compiler-team/issues/684
2024-01-09Remove `-Zdont-buffer-diagnostics`.Nicholas Nethercote-1/+0
It was added in #54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary.
2024-01-08Add support for shell argfilesDavid Koloski-0/+1
2024-01-05Rollup merge of #119567 - nnethercote:rm-Zreport-delayed-bugs, r=oli-obkMichael Goulet-1/+0
Remove `-Zreport-delayed-bugs`. It's not used within the repository in any way (e.g. in tests), and doesn't seem useful. It was added in #52568. r? ````@oli-obk````
2024-01-05Rollup merge of #119566 - Zalathar:remove-spanview, r=Swatinem,NilstriebMichael Goulet-3/+2
Remove `-Zdump-mir-spanview` The `-Zdump-mir-spanview` flag was added back in #76074, as a development/debugging aid for the initial work on what would eventually become `-Cinstrument-coverage`. It causes the compiler to emit an HTML file containing a function's source code, with various spans highlighted based on the contents of MIR. When the suggestion was made to [triage and remove unnecessary `-Z` flags (Zulip)](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60-Z.60.20option.20triage), I noted that this flag could potentially be worth removing, but I wanted to keep it around to see whether I found it useful for my own coverage work. But when I actually tried to use it, I ran into various issues (e.g. it crashes on `tests/coverage/closure.rs`). If I can't trust it to work properly without a full overhaul, then instead of diving down a rabbit hole of trying to fix arcane span-handling bugs, it seems better to just remove this obscure old code entirely. --- ````@rustbot```` label +A-code-coverage
2024-01-05Stabilize THIR unsafeckMatthew Jasper-1/+1
2024-01-04Remove `-Zreport-delayed-bugs`.Nicholas Nethercote-1/+0
It's not used within the repository in any way (e.g. in tests), and doesn't seem useful.
2024-01-04Remove `-Zdump-mir-spanview`Zalathar-3/+2
2023-12-19rename to verbose-internalsjyn-1/+1
2023-12-18Rename many `DiagCtxt` and `EarlyDiagCtxt` locals.Nicholas Nethercote-30/+30
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-4/+4
2023-12-18Rename `EarlyErrorHandler` as `EarlyDiagCtxt`.Nicholas Nethercote-4/+4
2023-12-14rename `-Ztrait-solver` to `-Znext-solver`lcnr-5/+7
2023-12-13Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`.Lukasz Anforowicz-0/+1
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-081. fix jobserver GLOBAL_CLIENT_CHECKED uninitialized before useoksbsb-0/+2
2. jobserver::initialize_checked should call before build_session, still should use EarlyErrorHandler, so revert stderr change in #118635
2023-12-06Fewer early errors.Nicholas Nethercote-4/+4
`build_session` is passed an `EarlyErrorHandler` and then constructs a `Handler`. But the `EarlyErrorHandler` is still used for some time after that. This commit changes `build_session` so it consumes the passed `EarlyErrorHandler`, and also drops it as soon as the `Handler` is built. As a result, `parse_cfg` and `parse_check_cfg` now take a `Handler` instead of an `EarlyErrorHandler`.
2023-12-05Factor out some repeated code.Nicholas Nethercote-14/+10
2023-11-30Add `-Zfunction-return={keep,thunk-extern}` optionMiguel Ojeda-4/+6
This is intended to be used for Linux kernel RETHUNK builds. With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is `objtool`-warning-free and is able to boot in QEMU and load a sample Rust kernel module. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-11-15Auto merge of #116555 - paulmenage:llvm-module-flag, r=wesleywiserbors-0/+1
Add -Z llvm_module_flag Allow adding values to the `!llvm.module.flags` metadata for a generated module. The syntax is `-Z llvm_module_flag=<name>:<type>:<value>:<behavior>` Currently only u32 values are supported but the type is required to be specified for forward compatibility. The `behavior` element must match one of the named LLVM metadata behaviors.viors. This flag is expected to be perma-unstable.
2023-11-14Auto merge of #117773 - nnethercote:rm-Zperf-stats, r=wesleywiserbors-1/+0
Remove `-Zperf-stats`. The included measurements have varied over the years. At one point there were quite a few more, but #49558 deleted a lot that were no longer used. Today there's just four, and it's a motley collection that doesn't seem particularly valuable. I think it has been well and truly subsumed by self-profiling, which collects way more data. r? `@wesleywiser`
2023-11-13Remove `-Zperf-stats`.Nicholas Nethercote-1/+0
The included measurements have varied over the years. At one point there were quite a few more, but #49558 deleted a lot that were no longer used. Today there's just four, and it's a motley collection that doesn't seem particularly valuable. I think it has been well and truly subsumed by self-profiling, which collects way more data.
2023-11-11Add -Z llvm_module_flagPaul Menage-0/+1
Allow adding values to the `!llvm.module.flags` metadata for a generated module. The syntax is `-Z llvm_module_flag=<name>:<type>:<value>:<behavior>` Currently only u32 values are supported but the type is required to be specified for forward compatibility. The `behavior` element must match one of the named LLVM metadata behaviors.viors. This flag is expected to be perma-unstable.