about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
AgeCommit message (Collapse)AuthorLines
2023-02-10Auto merge of #102963 - ilammy:xray-basic, r=estebankbors-0/+2
Add `-Z instrument-xray` flag Implement MCP https://github.com/rust-lang/compiler-team/issues/561, adding `-Z instrument-xray` flag which enables XRay instrumentation in LLVM.
2023-02-09Remove `QueryContext`.Nicholas Nethercote-34/+19
There is a type `QueryCtxt`, which impls the trait `QueryContext`. Confusingly, there is another type `QueryContext`. The latter is (like `TyCtxt`) just a pointer to a `GlobalContext`. It's not used much, e.g. its `impl` block has a single method. This commit removes `QueryContext`, replacing its use with direct `GlobalCtxt` use.
2023-02-09Simplify `tls::enter_context`.Nicholas Nethercote-2/+2
2023-02-09Parse "-Z instrument-xray" codegen optionOleksii Lozovskyi-0/+2
Recognize all bells and whistles that LLVM's XRay pass is capable of. The always/never settings are a bit dumb without attributes but they're still there. The default instruction count is chosen by the compiler, not LLVM pass. We'll do it later.
2023-02-07Replace a command line flag with an env var to allow tools to initialize the ↵Oli Scherer-1/+0
tracing loggers at their own discretion
2023-02-05rustc_interface: remove huge error importsest31-18/+16
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-15/+33
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-29Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obkbors-0/+1
Use stable metric for const eval limit instead of current terminator-based logic This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only. The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made). Also see: #103877
2023-01-27Compute generator saved locals on MIR.Camille GILLOT-0/+9
2023-01-23Replace terminator-based const eval limitBryan Garza-0/+1
- Remove logic that limits const eval based on terminators, and use the stable metric instead (back edges + fn calls) - Add unstable flag `tiny-const-eval-limit` to add UI tests that do not have to go up to the regular 2M step limit
2023-01-23Store the gctxt instead of fetching it twice.Oli Scherer-1/+1
2023-01-23Make `output_filenames` a real queryOli Scherer-27/+13
2023-01-23Remove another unneeded use of the resolverOli Scherer-19/+23
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-4/+3
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-17Don't call closures immediately, use `try{}` blocksMaybe Waffle-4/+3
2023-01-16Avoid one more call site to `Compiler::expansion`Oli Scherer-1/+1
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-58/+42
2023-01-16Group some commonly passed together values into a structOli Scherer-52/+34
2023-01-16Remove redundant `input_path` field from `Config`Oli Scherer-5/+2
2023-01-16remove some arguments that can also be fed at the caller sideOli Scherer-34/+26
2023-01-16Remove `prepare_outputs`Oli Scherer-19/+9
2023-01-13Rollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholkMatthias Krüger-1/+11
Warn when using panic-strategy abort for proc-macro crates See https://github.com/rust-lang/rust/issues/82320, this simply warns for now as that seems like the best step that can be immediately taken (opposed to straight up rejecting or ignoring)
2023-01-13Rollup merge of #104645 - yukiomoto:log-backtrace-option, r=oli-obkMatthias Krüger-0/+1
Add log-backtrace option to show backtraces along with logging according to #90698, I added a compiler option, `-Zlog-backtrace=filter`, where `filter` is a module name, to show backtraces for logging without rebuilding. resolve #90698
2023-01-13Warn when using panic-strategy abort for proc-macro cratesLukas Wirth-1/+11
2023-01-12Feed the `features_query` instead of grabbing it from the session lazilyOli Scherer-0/+1
2023-01-12Remove `output_filenames` field from TyCtxt and feed the query insteadOli Scherer-1/+1
2023-01-12Remove `untracked_crate` field and instead pass it along with the resolver.Oli Scherer-2/+3
2023-01-12Feed `crate_name` queryOli Scherer-1/+2
2023-01-12Feed `resolutions` query instead of it being a thin wrapper around an ↵Oli Scherer-3/+3
untracked field
2023-01-12Harden the pre-tyctxt query system against accidental recomputationOli Scherer-48/+60
2023-01-12Add log-backtrace option to show backtraces along with loggingYuki Omoto-0/+1
2023-01-10Change type of box_noalias to boolTomasz Miąsko-1/+1
2023-01-10Change type of mutable_noalias to boolTomasz Miąsko-1/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-14/+11
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04Split `-Zchalk` flag into `-Ztrait-solver=(stock|chalk|next)` flagMichael Goulet-1/+2
2023-01-04Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqdMatthias Krüger-5/+7
Add JSON output to -Zdump-mono-stats Follow-up to https://github.com/rust-lang/rust/pull/105481 r? `@lqd` cc `@wesleywiser`
2023-01-02Add json output to `-Zdump-mono-stats`Joshua Nelson-5/+7
This allows analyzing the output programatically; for example, finding the item with the highest `total_estimate`. I also took the liberty of adding `untracked` tests to `rustc_session` and documentation to the unstable book for `dump-mono-items`.
2022-12-25Ignore span references from diagnostics.Camille GILLOT-2/+11
The diagnostics are replayed at the correct place anyway.
2022-12-25Mark incremental-ignore-spans as TRACKED.Camille GILLOT-1/+1
Using that options basically changes all stable hashes we may compute. Adding/removing as UNTRACKED it makes everything ICE (unstable fingerprint everywhere). As TRACKED, it can still do its job without ICEing.
2022-12-21Auto merge of #105812 - ojeda:no-jump-tables, r=nikicbors-0/+1
Add `-Zno-jump-tables` This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83
2022-12-20Add `-Zno-jump-tables`Miguel Ojeda-0/+1
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-18don't clone Copy typesMatthias Krüger-1/+1
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-2/+0
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-0/+2
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-29/+32
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-29/+32
2022-12-06Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillotMatthias Krüger-0/+1
Add -Z maximal-hir-to-mir-coverage flag This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible. A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything. r? `@cjgillot` cc `@gavinleroy`
2022-12-06Auto merge of #105220 - oli-obk:feeding, r=cjgillotbors-12/+25
feed resolver_for_lowering instead of storing it in a field r? `@cjgillot` opening this as * a discussion for `no_hash` + `feedable` queries. I think we'll want those, but I don't quite understand why they are rejected beyond a double check of the stable hashes for situations where the query is fed but also read from incremental caches. * and a discussion on removing all untracked fields from TyCtxt and setting it up so that they are fed queries instead
2022-12-05feed resolver_for_lowering instead of storing it in a fieldOli Scherer-2/+15