about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2024-05-21PR feedbackBen Kimock-1/+1
2024-05-21Add a footer in FileEncoder and check for it in MemDecoderBen Kimock-1/+4
2024-05-01Step bootstrap cfgsMark Rousskov-1/+0
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-2/+0
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-2/+1
2024-04-19Show files produced by --emit foo in json artifact notificationsMichael Baikov-0/+18
2024-04-06Save/restore more items in cache with incremental compilationMichael Baikov-1/+16
2024-03-08Stabilize associated type boundsMichael Goulet-1/+1
2024-02-14clean up potential_query_instability with FxIndexMap and UnordMapyukang-6/+8
2024-02-06Invert diagnostic lints.Nicholas Nethercote-0/+2
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-25Remove unused featuresclubby789-2/+0
2024-01-13Auto merge of #119409 - Kobzol:rustc-codegen-ssa-query-instability, r=Nilstriebbors-1/+0
rustc_codegen_ssa: Enforce `rustc::potential_query_instability` lint Part of https://github.com/rust-lang/rust/issues/84447.
2024-01-13rustc_codegen_ssa: Enforce `rustc::potential_query_instability` lintJakub Beránek-1/+0
2024-01-12Revert "Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelix"DianQK-1/+2
This reverts commit 8c2b57721728233e074db69d93517614de338055, reversing changes made to 9cf18e98f82d85fa41141391d54485b8747da46f.
2023-12-30Update to bitflags 2 in the compilerNilstrieb-0/+1
This involves lots of breaking changes. There are two big changes that force changes. The first is that the bitflag types now don't automatically implement normal derive traits, so we need to derive them manually. Additionally, bitflags now have a hidden inner type by default, which breaks our custom derives. The bitflags docs recommend using the impl form in these cases, which I did.
2023-12-12codegen: panic when trying to compute size/align of extern typeRalf Jung-1/+1
2023-12-01Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelixbors-2/+1
Restore `#![no_builtins]` crates participation in LTO. After #113716, we can make `#![no_builtins]` crates participate in LTO again. `#![no_builtins]` with LTO does not result in undefined references to the error. I believe this type of issue won't happen again. Fixes #72140. Fixes #112245. Fixes #110606. Fixes #105734. Fixes #96486. Fixes #108853. Fixes #108893. Fixes #78744. Fixes #91158. Fixes https://github.com/rust-lang/cargo/issues/10118. Fixes https://github.com/rust-lang/compiler-builtins/issues/347. The `nightly-2023-07-20` version does not always reproduce problems due to changes in compiler-builtins, core, and user code. That's why this issue recurs and disappears. Some issues were not tested due to the difficulty of reproducing them. r? pnkfelix cc `@bjorn3` `@japaric` `@alexcrichton` `@Amanieu`
2023-11-26Serialize OutputFilenames into rmeta filebjorn3-2/+8
This ensures that linking will use the correct crate name even when `#![crate_name = "..."]` is used to specify the crate name.
2023-11-26Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkinbors-1/+1
Call FileEncoder::finish in rmeta encoding Fixes https://github.com/rust-lang/rust/issues/117254 The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out. I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths. I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing. r? `@WaffleLapkin`
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-2/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-22Call FileEncoder::finish in rmeta encodingBen Kimock-1/+1
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-10-21Removes fields from `CrateInfo` that are no longer used.DianQK-2/+1
2023-10-13Auto merge of #115964 - bjorn3:cgu_reuse_tracker_global_state, r=cjgillotbors-0/+1
Remove cgu_reuse_tracker from Session This removes a bit of global mutable state. It will now miss post-lto cgu reuse when ThinLTO determines that a cgu doesn't get changed, but there weren't any tests for this anyway and a test for it would be fragile to the exact implementation of ThinLTO in LLVM.
2023-10-09Remove cgu_reuse_tracker from Sessionbjorn3-0/+1
This removes a bit of global mutable state
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-09-29Auto merge of #113301 - Be-ing:stabilize_bundle_whole-archive, r=petrochenkovbors-1/+0
stabilize combining +bundle and +whole-archive link modifiers Per discussion on https://github.com/rust-lang/rust/issues/108081 combining +bundle and +whole-archive already works and can be stabilized independently of other aspects of the packed_bundled_libs feature. There is no risk of regression because this was not previously allowed. r? `@petrochenkov`
2023-09-22Merge `ExternProviders` into the general `Providers` structOli Scherer-5/+1
2023-08-15stabilize combining +bundle and +whole-archive link modifiersBe Wilson-1/+0
Currently, combining +bundle and +whole-archive works only with #![feature(packed_bundled_libs)] This crate feature is independent of the -Zpacked-bundled-libs command line option. This commit stabilizes the #![feature(packed_bundled_libs)] crate feature and implicitly enables it only when the +bundle and +whole-archive link modifiers are combined. This allows rlib crates to use the +whole-archive link modifier with native libraries and have all symbols included in the linked library to be included in downstream staticlib crates that use the rlib as a dependency. Other cases requiring the packed_bundled_libs behavior still require the -Zpacked-bundled-libs command line option, which can be stabilized independently in the future. Per discussion on https://github.com/rust-lang/rust/issues/108081 there is no risk of regression stabilizing the crate feature in this way because the combination of +bundle,+whole-archive link modifiers was previously not allowed.
2023-08-12Remove unnecessary feature gatesJacob Pratt-1/+0
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-0/+1
Removes a piece of mutable state. Follow up to #114578.
2023-07-05Move `coverageinfo::ffi` and `coverageinfo::map` out of SSAZalathar-1/+0
2023-06-19codegen: fix `OperandRef` subtype handlinglcnr-0/+1
2023-05-19Auto merge of #111641 - michaelwoerister:debugger-visualizer-fixes, r=cjgillotbors-1/+1
Fix dependency tracking for debugger visualizers This PR fixes dependency tracking for debugger visualizer files by changing the `debugger_visualizers` query to an `eval_always` query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an `eval_always` query, dependency tracking will now reliably detect changes to the visualizer script files themselves. TODO: - [x] perf.rlo - [x] Needs a bit more documentation in some places - [x] Needs regression test for the incr. comp. case Fixes https://github.com/rust-lang/rust/issues/111226 Fixes https://github.com/rust-lang/rust/issues/111227 Fixes https://github.com/rust-lang/rust/issues/111295 r? `@wesleywiser` cc `@gibbyfree`
2023-05-18Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31bors-9/+7
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-9/+7
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-16Move DebuggerVisualizerFile types from rustc_span to rustc_middleMichael Woerister-1/+1
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-05-01Change rlink serialization from `MemEncoder` to `FileEncoder`.Nicholas Nethercote-3/+7
Because we're writing to a file, so `FileEncoder` is better because we don't have to write all the data to memory first.
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
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`).
2023-03-29Stabilize a portion of 'once_cell'Trevor Gross-1/+0
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-19The name of NativeLib will be presentedyukang-1/+1
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-02-22errors: generate typed identifiers in each crateDavid Wood-0/+4
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-17typoTshepang Mbambo-1/+1
2023-02-10[link] enable packed bundled lib in non stable casesDaniil Belov-0/+1
2022-12-13Move some codegen-y methods from rustc_hir_analysis::collect -> ↵Michael Goulet-0/+2
rustc_codegen_ssa
2022-11-27Stabilize native library modifier `verbatim`Vadim Petrochenkov-2/+2
2022-11-16Merge basic blocks where possible when generating LLVM IR.Nicholas Nethercote-5/+6
In `codegen_assert_terminator` we decide if a BB's successor is a candidate for merging, which requires that it be the only successor, and that it only have one predecessor. That result then gets passed down, and if it reaches `funclet_br` with the appropriate BB characteristics, then no `br` instruction is issued, a `MergingSucc::True` result is passed back, and the merging proceeds in `codegen_block`. The commit also adds `CachedLlbb`, a new type to help keep track of each BB that has been merged into its predecessor.