about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2024-11-04Simplify FFI calls for `-Ztime-llvm-passes` and `-Zprint-codegen-stats`Zalathar-23/+4
2024-09-26Use `&raw` in the compilerJosh Stone-2/+2
Like #130865 did for the standard library, we can use `&raw` in the compiler now that stage0 supports it. Also like the other issue, I did not make any doc or test changes at this time.
2024-09-24Dogfood `feature(file_buffered)`Josh Stone-0/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-05update cfgsBoxy-1/+0
2024-08-27Rollup merge of #129635 - compiler-errors:unsafe-blocks, r=spastorinoMatthias Krüger-0/+1
Use unsafe extern blocks throughout the compiler Making this change in preparation for edition 2024. r? spastorino
2024-08-26Use unsafe extern blocks throughout the compilerMichael Goulet-0/+1
2024-08-16Add `warn(unreachable_pub)` to `rustc_codegen_llvm`.Nicholas Nethercote-4/+5
2024-08-11Use assert_matches around the compilerMichael Goulet-0/+1
2024-08-07Don't use LLVM to compute -Ctarget-featureCaleb Zulawski-2/+2
2024-08-07Don't use LLVM's target featuresCaleb Zulawski-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-9/+8
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-16Fix unsafe_op_in_unsafe_fn in compilerMichael Goulet-3/+3
2024-06-21Remove PrintBackendInfo traitbjorn3-11/+13
It is only implemented for a single type. Directly passing this type is simpler and avoids overhead from indirect calls.
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-6/+7
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-3/+5
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-05-24Auto merge of #125463 - GuillaumeGomez:rollup-287wx4y, r=GuillaumeGomezbors-2/+5
Rollup of 6 pull requests Successful merges: - #125263 (rust-lld: fallback to rustc's sysroot if there's no path to the linker in the target sysroot) - #125345 (rustc_codegen_llvm: add support for writing summary bitcode) - #125362 (Actually use TAIT instead of emulating it) - #125412 (Don't suggest adding the unexpected cfgs to the build-script it-self) - #125445 (Migrate `run-make/rustdoc-with-short-out-dir-option` to `rmake.rs`) - #125452 (Cleanup check-cfg handling in core and std) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-23cleanup: run rustfmtAugie Fackler-1/+4
2024-05-23thinlto: only build summary file if neededAugie Fackler-2/+2
If we don't do this, some versions of LLVM (at least 17, experimentally) will double-emit some error messages, which is how I noticed this. Given that it seems to be costing some extra work, let's only request the summary bitcode production if we'll actually bother writing it down, otherwise skip it.
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_codegen_llvm`.Nicholas Nethercote-3/+0
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-2/+0
2024-02-24compiler: use `addr_of!`Pavel Grigorenko-2/+2
2024-02-17Make `CodegenBackend::join_codegen` infallible.Nicholas Nethercote-2/+2
Because they all are, in practice.
2024-02-10Remove unnecessary `#![feature(min_specialization)]`Zalathar-1/+0
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
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
2023-12-22update cfg(bootstrap)sPietro Albini-1/+0
2023-12-18Rename many `DiagCtxt` and `EarlyDiagCtxt` locals.Nicholas Nethercote-2/+2
2023-12-18Rename many `DiagCtxt` arguments.Nicholas Nethercote-9/+9
2023-12-18Rename `CodegenContext::create_diag_handler` as `CodegenContext::create_dcx`.Nicholas Nethercote-1/+1
2023-12-18Rename `Handler` as `DiagCtxt`.Nicholas Nethercote-5/+5
2023-12-14Auto merge of #118566 - klensy:cstr-new, r=WaffleLapkinbors-0/+1
use c literals in compiler and library Relands refreshed https://github.com/rust-lang/rust/pull/111647
2023-12-12rustc_codegen_llvm: Enforce `rustc::potential_query_instability` lintMartin Nordholts-1/+0
Stop allowing `rustc::potential_query_instability` on all of `rustc_codegen_llvm` and instead allow it on a case-by-case basis. In this case, both instances are safe to allow.
2023-12-07Add emulated TLS supportquininer-1/+3
Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls.
2023-12-03compiler: replace cstr macro with c str literals in compiler and few other c ↵klensy-0/+1
str replacements
2023-11-29Update compiler/rustc_codegen_llvm/src/lib.rsWesley Wiser-1/+1
Co-authored-by: Josh Stone <cuviper@gmail.com>
2023-11-29Dispose llvm::TargetMachines prior to llvm::Context being disposedWesley Wiser-5/+16
If the TargetMachine is disposed after the Context is disposed, it can lead to use after frees in some cases. I've observed this happening occasionally on code compiled for aarch64-pc-windows-msvc using `-Zstack-protector=strong` but other users have reported AVs from host aarch64-pc-windows-msvc compilers as well.
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/+1
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-21Tighten up linkage settings for LLVM bindingsBen Kimock-2/+2
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-10-22coverage: Encode function mappings without re-sorting themZalathar-1/+1
The main change here is that `VirtualFileMapping` now uses an internal hashmap to de-duplicate incoming global file IDs. That removes the need for `encode_mappings_for_function` to re-sort its mappings by filename in order to de-duplicate them. (We still de-duplicate runs of identical filenames to save work, but this is not load-bearing for correctness, so a sort is not necessary.)
2023-10-22coverage: Encapsulate local-to-global file mappingsZalathar-0/+1
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+3
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-09-24Add OwnedTargetMachine to manage llvm:TargetMachine. Uses pointersFlorian Schmiderer-3/+6
instead of &'static mut and provides safe interface to create/dispose it.
2023-09-22Have a single struct for queries and hookOli Scherer-3/+2
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-1/+2
2023-09-11coverage: Simplify grouping of mappings by fileZalathar-0/+1
This removes an ad-hoc implementation of `group_by`.
2023-07-31Use standard Rust capitalization rules for names containing "LTO".Nicholas Nethercote-2/+2
2023-07-31Remove `ExtraBackendMethods::spawn_thread`.Nicholas Nethercote-12/+0
It's no longer used, and `spawn_named_thread` is preferable, because naming threads is helpful when profiling.