summaryrefslogtreecommitdiff
path: root/compiler/rustc_interface
Commit message (Collapse)AuthorAgeFilesLines
* Rollup merge of #109677 - dpaoliello:rawdylib, r=michaelwoerister,wesleywiserYuki Okushi2023-05-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stabilize raw-dylib, link_ordinal, import_name_type and -Cdlltool This stabilizes the `raw-dylib` feature (#58713) for all architectures (i.e., `x86` as it is already stable for all other architectures). Changes: * Permit the use of the `raw-dylib` link kind for x86, the `link_ordinal` attribute and the `import_name_type` key for the `link` attribute. * Mark the `raw_dylib` feature as stable. * Stabilized the `-Zdlltool` argument as `-Cdlltool`. * Note the path to `dlltool` if invoking it failed (we don't need to do this if `dlltool` returns an error since it prints its path in the error message). * Adds tests for `-Cdlltool`. * Adds tests for being unable to find the dlltool executable, and dlltool failing. * Fixes a bug where we were checking the exit code of dlltool to see if it failed, but dlltool always returns 0 (indicating success), so instead we need to check if anything was written to `stderr`. NOTE: As previously noted (https://github.com/rust-lang/rust/pull/104218#issuecomment-1315895618) using dlltool within rustc is temporary, but this is not the first time that Rust has added a temporary tool use and argument: https://github.com/rust-lang/rust/pull/104218#issuecomment-1318720482 Big thanks to ``````@tbu-`````` for the first version of this PR (#104218)
| * Stablize raw-dylib, link_ordinal and -CdlltoolDaniel Paoliello2023-04-181-1/+1
| |
* | Rollup merge of #111068 - Urgau:check-cfg-improvements, r=petrochenkovDylan DPC2023-05-051-28/+48
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve check-cfg implementation This PR makes multiple improvements into the implementation of check-cfg, it is a prerequisite to a follow-up PR that will introduce a simpler and more explicit syntax. The 2 main area of improvements are: 1. Internal representation of expected values: - now uses `FxHashSet<Option<Symbol>>` instead of `FxHashSet<Symbol>`, it made the no value expected case only possible when no values where in the `HashSet` which is now represented as `None` (same as cfg represent-it). - a enum with `Some` and `Any` makes it now clear if some values are expected or not, necessary for `feature` and `target_feature`. 2. Diagnostics: Improve the diagnostics in multiple case and fix case where a missing value could have had a new name suggestion instead of the value diagnostic; and some drive by improvements I highly recommend reviewing commit by commit. r? `@petrochenkov`
| * | Improve internal representation of check-cfgUrgau2023-05-051-11/+14
| | | | | | | | | | | | | | | | | | | | | This is done to simplify to relationship between names() and values() but also make thing clearer (having an Any to represent that any values are allowed) but also to allow the (none) + values expected cases that wasn't possible before.
| * | Use explicit instead of implicit control-flow for check-cfg parsingUrgau2023-05-051-23/+40
| | |
* | | Rollup merge of #105452 - rcvalle:rust-cfi-3, r=bjorn3Manish Goregaokar2023-05-031-0/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add cross-language LLVM CFI support to the Rust compiler This PR adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395). It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653. Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto). Thank you again, ``@bjorn3,`` ``@nikic,`` ``@samitolvanen,`` and the Rust community for all the help!
| * | | Add cross-language LLVM CFI support to the Rust compilerRamon de C Valle2023-05-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395). It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653. Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto).
* | | | Change rlink serialization from `MemEncoder` to `FileEncoder`.Nicholas Nethercote2023-05-011-2/+1
| |/ / |/| | | | | | | | | | | Because we're writing to a file, so `FileEncoder` is better because we don't have to write all the data to memory first.
* | | Auto merge of #109611 - Zoxc:query-engine-rem, r=cjgillotbors2023-04-295-15/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove `QueryEngine` trait This removes the `QueryEngine` trait and `Queries` from `rustc_query_impl` and replaced them with function pointers and fields in `QuerySystem`. As a side effect `OnDiskCache` is moved back into `rustc_middle` and the `OnDiskCache` trait is also removed. This has a couple of benefits. - `TyCtxt` is used in the query system instead of the removed `QueryCtxt` which is larger. - Function pointers are more flexible to work with. A variant of https://github.com/rust-lang/rust/pull/107802 is included which avoids the double indirection. For https://github.com/rust-lang/rust/pull/108938 we can name entry point `__rust_end_short_backtrace` to avoid some overhead. For https://github.com/rust-lang/rust/pull/108062 it avoids the duplicate `QueryEngine` structs. - `QueryContext` now implements `DepContext` which avoids many `dep_context()` calls in `rustc_query_system`. - The `rustc_driver` size is reduced by 0.33%, hopefully that means some bootstrap improvements. - This avoids the unsafe code around the `QueryEngine` trait. r? `@cjgillot`
| * | | Remove QueryEngine traitJohn Kåre Alsaker2023-04-265-15/+8
| | | |
* | | | Auto merge of #107782 - Zoxc:worker-local, r=cjgillotbors2023-04-271-0/+6
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structures This PR moves the definition of the `WorkerLocal` type from `rustc-rayon` into `rustc_data_structures`. This is enabled by the introduction of the `Registry` type which allows you to group up threads to be used by `WorkerLocal` which is basically just an array with an per thread index. The `Registry` type mirrors the one in Rayon and each Rayon worker thread is also registered with the new `Registry`. Safety for `WorkerLocal` is ensured by having it keep a reference to the registry and checking on each access that we're still on the group of threads associated with the registry used to construct it. Accessing a `WorkerLocal` is micro-optimized due to it being hot since it's used for most arena allocations. Performance is slightly improved for the parallel compiler: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.9992s</td><td align="right">1.9949s</td><td align="right"> -0.21%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2977s</td><td align="right">0.2970s</td><td align="right"> -0.22%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.1335s</td><td align="right">1.1315s</td><td align="right"> -0.18%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.8235s</td><td align="right">1.8171s</td><td align="right"> -0.35%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.9047s</td><td align="right">6.8930s</td><td align="right"> -0.17%</td></tr><tr><td>Total</td><td align="right">12.1586s</td><td align="right">12.1336s</td><td align="right"> -0.21%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9977s</td><td align="right"> -0.23%</td></tr></table> cc `@SparrowLii`
| * | | Remove WorkerLocal from AttrIdGeneratorJohn Kåre Alsaker2023-04-161-19/+0
| | | |
| * | | Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structuresJohn Kåre Alsaker2023-04-162-0/+25
| | |/ | |/|
* | | Revert "Rename -Zoom=panic to -Zoom=unwind"Matthias Krüger2023-04-251-1/+1
| | | | | | | | | | | | This reverts commit 4b981c26487ebe56de6b3000fcd98713804beefc.
* | | Rollup merge of #110681 - klensy:cut-dep, r=lcnrYuki Okushi2023-04-251-1/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | drop few unused crates, gate libc under unix for rustc_codegen_ssa Small cleanup.
| * | | drop unused deps, gate libc under unix for one crateklensy2023-04-221-1/+0
| | |/ | |/|
* | | Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillotbors2023-04-231-21/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
| * | | Run `check_match` and `check_liveness` when MIR is built instead of having ↵Oli Scherer2023-04-211-21/+0
| | | | | | | | | | | | | | | | an explicit phase for them
| * | | Make `check_match` and `check_liveness` take a `LocalDefId`Oli Scherer2023-04-211-1/+1
| | | |
* | | | Auto merge of #109507 - Amanieu:panic-oom-payload, r=davidtwcobors2023-04-221-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report allocation errors as panics OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`. This should be review one commit at a time: - The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics. - The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API. ACP: https://github.com/rust-lang/libs-team/issues/192 Closes #51540 Closes #51245
| * | | | Rename -Zoom=panic to -Zoom=unwindAmanieu d'Antras2023-04-161-1/+1
| | |_|/ | |/| |
* | | | Auto merge of #104844 - cjgillot:mention-eval-place, r=jackh726,RalfJungbors2023-04-221-0/+1
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Evaluate place expression in `PlaceMention` https://github.com/rust-lang/rust/pull/102256 introduces a `PlaceMention(place)` MIR statement which keep trace of `let _ = place` statements from surface rust, but without semantics. This PR proposes to change the behaviour of `let _ =` patterns with respect to the borrow-checker to verify that the bound place is live. Specifically, consider this code: ```rust let _ = { let a = 5; &a }; ``` This passes borrowck without error on stable. Meanwhile, replacing `_` by `_: _` or `_p` errors with "error[E0597]: `a` does not live long enough", [see playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c448d25a7c205dc95a0967fe96bccce8). This PR *does not* change how `_` patterns behave with respect to initializedness: it remains ok to bind a moved-from place to `_`. The relevant test is `tests/ui/borrowck/let_underscore_temporary.rs`. Crater check found no regression. For consistency, this PR changes miri to evaluate the place found in `PlaceMention`, and report eventual dangling pointers found within it. r? `@RalfJung`
| * | | Actually keep `PlaceMention` if requested.Camille GILLOT2023-04-211-0/+1
| | |/ | |/|
* | | Ensure mir_drops_elaborated_and_const_checked when requiring codegen.Camille GILLOT2023-04-211-1/+7
|/ /
* | Auto merge of #96840 - cjgillot:query-feed, r=oli-obkbors2023-04-211-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to feed a value in another query's cache and remove `WithOptConstParam` I used it to remove `WithOptConstParam` queries, as an example. The idea is that a query (here `typeck(function)`) can write into another query's cache (here `type_of(anon const)`). The dependency node for `type_of` would depend on all the current dependencies of `typeck`. There is still an issue with cycles: if `type_of(anon const)` is accessed before `typeck(function)`, we will still have the usual cycle. The way around this issue is to `ensure` that `typeck(function)` is called before accessing `type_of(anon const)`. When replayed, we may the following cases: - `typeck` is green, in that case `type_of` is green too, and all is right; - `type_of` is green, `typeck` may still be marked as red (it depends on strictly more things than `type_of`) -> we verify that the saved value and the re-computed value of `type_of` have the same hash; - `type_of` is red, then `typeck` is red -> it's the caller responsibility to ensure `typeck` is recomputed *before* `type_of`. As `anon consts` have their own `DefPathData`, it's not possible to have the def-id of the anon-const point to something outside the original function, but the general case may have to be resolved before using this device more broadly. There is an open question about loading from the on-disk cache. If `typeck` is loaded from the on-disk cache, the side-effect does not happen. The regular `type_of` implementation can go and fetch the correct value from the decoded `typeck` results, and the dep-graph will check that the hashes match, but I'm not sure we want to rely on this behaviour. I specifically allowed to feed the value to `type_of` from inside a call to `type_of`. In that case, the dep-graph will check that the fingerprints of both values match. This implementation is still very sensitive to cycles, and requires that we call `typeck(function)` before `typeck(anon const)`. The reason is that `typeck(anon const)` calls `type_of(anon const)`, which calls `typeck(function)`, which feeds `type_of(anon const)`, and needs to build the MIR so needs `typeck(anon const)`. The latter call would not cycle, since `type_of(anon const)` has been set, but I'd rather not remove the cycle check.
| * | Remove WithOptconstParam.Camille GILLOT2023-04-201-2/+1
| | |
* | | Auto merge of #109999 - m-ou-se:flatten-format-args, r=oli-obkbors2023-04-201-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable flatten-format-args by default. Part of https://github.com/rust-lang/rust/issues/99012. This enables the `flatten-format-args` feature that was added by https://github.com/rust-lang/rust/pull/106824: > This change inlines string literals, integer literals and nested format_args!() into format_args!() during ast lowering, making all of the following pairs result in equivalent hir: > > ```rust > println!("Hello, {}!", "World"); > println!("Hello, World!"); > ``` > > ```rust > println!("[info] {}", format_args!("error")); > println!("[info] error"); > ``` > > ```rust > println!("[{}] {}", status, format_args!("error: {}", msg)); > println!("[{}] error: {}", status, msg); > ``` > > ```rust > println!("{} + {} = {}", 1, 2, 1 + 2); > println!("1 + 2 = {}", 1 + 2); > ``` > > And so on. > > This is useful for macros. E.g. a `log::info!()` macro could just pass the tokens from the user directly into a `format_args!()` that gets efficiently flattened/inlined into a `format_args!("info: {}")`. > > It also means that `dbg!(x)` will have its file, line, and expression name inlined: > > ```rust > eprintln!("[{}:{}] {} = {:#?}", file!(), line!(), stringify!(x), x); // before > eprintln!("[example.rs:1] x = {:#?}", x); // after > ``` > > Which can be nice in some cases, but also means a lot more unique static strings than before if dbg!() is used a lot. This is mostly an optimization, except that it will be visible through [`fmt::Arguments::as_str()`](https://doc.rust-lang.org/nightly/std/fmt/struct.Arguments.html#method.as_str). In https://github.com/rust-lang/rust/pull/106823, there was already a libs-api FCP about the documentation of `fmt::Arguments::as_str()` to allow it to give `Some` rather than `None` depending on optimizations like this. That was just a documentation update though. This PR is the one that actually makes the user visible change: ```rust assert_eq!(format_args!("abc").as_str(), Some("abc")); // Unchanged. assert_eq!(format_args!("ab{}", "c").as_str(), Some("abc")); // Was `None` before! ```
| * | Update test.Mara Bos2023-04-171-1/+1
| |/
* | Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb2023-04-182-1/+2
|/ | | | | | | | | | Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
* Migrate `sess.opts.tests` uses to `sess.is_test_crate()`blyxyas2023-04-091-2/+2
|
* Auto merge of #108504 - cjgillot:thir-pattern, r=compiler-errors,Nilstriebbors2023-04-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Check pattern refutability on THIR The current `check_match` query is based on HIR, but partially re-lowers HIR into THIR. This PR proposed to use the results of the `thir_body` query to check matches, instead of re-building THIR. Most of the diagnostic changes are spans getting shorter, or commas/semicolons not getting removed. This PR degrades the diagnostic for confusing constants in patterns (`let A = foo()` where `A` resolves to a `const A` somewhere): it does not point ot the definition of `const A` any more.
| * Make check_match take a LocalDefId.Camille GILLOT2023-04-031-1/+1
| |
* | Auto merge of #109117 - oli-obk:locks, r=michaelwoeristerbors2023-04-051-2/+2
|\ \ | | | | | | | | | | | | | | | Avoid a few locks We can use atomics or datastructures tuned for specific access patterns instead of locks. This may be an improvement for parallel rustc, but it's mostly a cleanup making various datastructures only usable in the way they are used right now (append data, never mutate), instead of having a general purpose lock.
| * | Add a usize-indexed append-only-vecOli Scherer2023-04-041-2/+2
| |/
* | Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoeristerbors2023-04-041-1/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend -Cdebuginfo with new options and named aliases This is a rebase of https://github.com/rust-lang/rust/pull/83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below. Note that the changes in this PR have already been through FCP: https://github.com/rust-lang/rust/pull/83947#issuecomment-878384979 Closes https://github.com/rust-lang/rust/pull/109311. Helps with https://github.com/rust-lang/rust/pull/104968. r? `@michaelwoerister` cc `@cuviper` --- The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options. Fix https://github.com/rust-lang/rust/issues/60020 Fix https://github.com/rust-lang/rust/issues/64405
| * Preserve, clarify, and extend debug informationJulia Tatz2023-03-311-1/+2
| | | | | | | | | | | | | | | | | | | | `-Cdebuginfo=1` was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for line tables only was added. Additionally an option for line info directives only was added, which is well needed for some targets. The debug info options should now behave the same as clang's debug info options.
* | Improve `with_source_map`.Nicholas Nethercote2023-03-311-1/+1
|/ | | | | | | | | | | | | | | | | | Rename `with_source_map` as `set_source_map`. Because `with` functions (e.g. `with_session_globals`, `scoped_tls::ScopedKey::with`) are for *getting* a value for the duration of a closure, and `set` functions (e.g. `set_session_globals_then` `scoped_tls::ScopedKey::with`) are for *setting* a value for the duration of a closure. Also fix up the comment, which is wrong: - The bit about `TyCtxt` is wrong. - `span_debug1` doesn't exist any more. - There's only one level of fallback, not two. (This is effectively a follow-up to the changes in #93936.) Also add a comment explaining that `SessionGlobals::source_map` should only be used when absolutely necessary.
* Stabilize a portion of 'once_cell'Trevor Gross2023-03-291-1/+1
| | | | Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
* Rollup merge of #108480 - Zoxc:rayon-tlv, r=cuvipernils2023-03-282-4/+4
|\ | | | | | | | | | | | | | | Use Rayon's TLV directly This accesses Rayon's `TLV` thread local directly avoiding wrapper functions. This makes rustc work with https://github.com/rust-lang/rustc-rayon/pull/10. r? `@cuviper`
| * Update indexmap and rayon cratesJohn Kåre Alsaker2023-03-252-4/+4
| |
* | Rollup merge of #109685 - est31:not_llvm_but_backend, r=jyn514Matthias Krüger2023-03-281-1/+1
|\ \ | |/ |/| | | | | | | | | | | Make doc comment a little bit more accurate It queries not LLVM in particular but the codegen backend *in general*. While cranelift does not provide target features, other codegen backends do. Found while looking for [this answer](https://github.com/rust-lang/rust/issues/108680#issuecomment-1484324690).
| * Make doc comment a little bit more accurateest312023-03-281-1/+1
| | | | | | | | | | It queries not LLVM in particular but the codegen backend *in general*. While cranelift does not provide target features, other codegen backends do.
* | Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholkMatthias Krüger2023-03-232-2/+4
|\ \ | | | | | | | | | | | | | | | Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize` This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.
| * | Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`John Kåre Alsaker2023-03-162-2/+4
| | |
* | | Rollup merge of #107718 - Zoxc:z-time, r=nnethercoteMatthias Krüger2023-03-231-0/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes` This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb), reverting https://github.com/rust-lang/rust/pull/102725. It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
| * | | Add `-Z time-passes-format` to allow specifying a JSON output for `-Z ↵John Kåre Alsaker2023-03-211-0/+2
| | |/ | |/| | | | | | | time-passes`
* | | rustc_interface: Add a new query `pre_configure`Vadim Petrochenkov2023-03-232-34/+58
| | | | | | | | | | | | | | | | | | It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early. Crate-level cfg attributes are then expanded normally during the main expansion pass, like attributes on any other nodes.
* | | expand: Pass `ast::Crate` by reference to AST transforming passesVadim Petrochenkov2023-03-232-15/+15
| | | | | | | | | | | | Also some more attributes are passed by reference.
* | | rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov2023-03-222-2/+3
|/ /
* | Gate fmt args flattening behind -Zflatten-format-args.Mara Bos2023-03-161-0/+1
|/