about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
AgeCommit message (Collapse)AuthorLines
2023-10-06Rollup merge of #116277 - RalfJung:post-mono, r=oli-obkJubilee-11/+6
dont call mir.post_mono_checks in codegen It seems like all tests are still passing when I remove this... let's see what CI says.
2023-10-06add some comments explaining how the required_consts stuff fits togetherRalf Jung-0/+6
2023-10-06Fix sdkname for tvos simulatorSebastian Imlay-0/+1
2023-10-06rustc_codegen_ssa: use try_canonicalize in rpathTamir Duberstein-8/+6
This is simpler and avoids unnecessary calls to `env::current_dir`.
2023-10-05Move DefLocation from rustc_codegen_ssa to rustc_middleTomasz Miąsko-16/+1
2023-10-05Rollup merge of #116223 - catandcoder:master, r=cjgillotJubilee-1/+1
Fix misuses of a vs an Fixes the misuse of "a" vs "an", according to English grammatical expectations and using https://www.a-or-an.com/
2023-10-04Fix misuses of a vs ancui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-03Auto merge of #115025 - ouz-a:ouz_testing, r=lcnrbors-0/+1
Make subtyping explicit in MIR This adds new mir-opt that pushes new `ProjectionElem` called `ProjectionElem::Subtype(T)` to `Rvalue` of a subtyped assignment so we can unsoundness issues like https://github.com/rust-lang/rust/issues/107205 Addresses https://github.com/rust-lang/rust/issues/112651 r? `@lcnr`
2023-10-02Add docs, remove code, change subtyper codeouz-a-1/+1
2023-10-02subtyping_projectionsouz-a-0/+1
2023-10-02Reapply: Mark drop calls in landing pads cold instead of noinlineErik Desjardins-8/+4
Co-authored-by: Max Fan <git@max.fan> Co-authored-by: Nikita Popov <npopov@redhat.com>
2023-09-30dont call mir.post_mono_checks in codegenRalf Jung-11/+0
2023-09-29Auto merge of #113301 - Be-ing:stabilize_bundle_whole-archive, r=petrochenkovbors-13/+1
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-28Strip `OpaqueCast` during `RevealAll`.Oli Scherer-1/+3
2023-09-27fix clippy::{redundant_guards, useless_format}Matthias Krüger-1/+1
2023-09-26Auto merge of #116144 - lcnr:subst-less, r=oli-obkbors-1/+1
subst -> instantiate continues #110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2023-09-26Auto merge of #116102 - cjgillot:indirect-scalar, r=oli-obkbors-12/+11
Correct codegen of `ConstValue::Indirect` scalar and scalar pair This concerns 3 tricky cases with `ConstValue::Indirect`: - if we want a non-pointer scalar; - if we have non-zero offset; - if offset points to uninit memory => generate `poison` instead of an ICE. This case could happen in unreachable code, trying to extract a field from the wrong variant. Those cases are not currently emitted by the compiler, but are exercised by https://github.com/rust-lang/rust/pull/116012.
2023-09-26subst -> instantiatelcnr-1/+1
2023-09-25Pass name of object file to LLVM so it can correctly emit S_OBJNAMEFlorian Schmiderer-1/+8
2023-09-24Auto merge of #105861 - Ayush1325:uefi-std-minimial, r=workingjubileebors-6/+22
Add Minimal Std implementation for UEFI # Implemented modules: 1. alloc 2. os_str 3. env 4. math # Related Links Tracking Issue: https://github.com/rust-lang/rust/issues/100499 API Change Proposal: https://github.com/rust-lang/libs-team/issues/87 # Additional Information This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from `@dvdhrm,` I have extracted a minimal std implementation to this PR. The example in `src/doc/rustc/src/platform-support/unknown-uefi.md` has been tested for `x86_64-unknown-uefi` and `i686-unknown-uefi` in OVMF. It would be great if someone more familiar with AARCH64 can help with testing for that target. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-24Rollup merge of #116104 - cjgillot:calculate_debuginfo_offset, r=b-naberMatthias Krüger-33/+10
Reuse calculate_debuginfo_offset for fragments. This removes a little code duplication.
2023-09-23Use correct offset when codegening mir::Const::Indirect.Camille GILLOT-12/+11
2023-09-23Tolerate non-ptr indirect scalars in codegen.Camille GILLOT-1/+1
2023-09-23Reuse calculate_debuginfo_offset for fragments.Camille GILLOT-33/+10
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-1/+0
2023-09-22Merge `ExternProviders` into the general `Providers` structOli Scherer-13/+5
2023-09-22Have a single struct for queries and hookOli Scherer-3/+3
2023-09-22Rebase to masterAyush Singh-9/+4
- Update Example - Add thread_parking to sys::uefi - Fix unsafe in unsafe errors - Improve docs - Improve os/exit - Some asserts - Switch back to atomics Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-22Add Minimal Std implementation for UEFIAyush Singh-7/+28
Implemented modules: 1. alloc 2. os_str 3. env 4. math Tracking Issue: https://github.com/rust-lang/rust/issues/100499 API Change Proposal: https://github.com/rust-lang/libs-team/issues/87 This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from @dvdhrm, I have extracted a minimal std implementation to this PR. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-1/+2
2023-09-21Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obkGuillaume Gomez-14/+14
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`. Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all. However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish... ``@oli-obk`` any ideas?
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-12/+12
2023-09-20the Const::eval_bits methods don't need to be given the TyRalf Jung-2/+2
2023-09-19adjust constValue::Slice to work for arbitrary slice typesRalf Jung-6/+3
2023-09-19move ConstValue into mirRalf Jung-8/+8
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-81/+21
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-15clarify PassMode::Indirect as wellRalf Jung-1/+1
2023-09-15explain PassMode::CastRalf Jung-8/+8
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-30/+8
also share the code that emits the actual error
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-65/+27
2023-09-14Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obkbors-15/+27
treat host effect params as erased in codegen This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`. r? `@oli-obk`
2023-09-14treat host effect params as erased generics in codegenDeadbeef-15/+27
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-2/+6
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-1/+1
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-1/+3
2023-09-14Auto merge of #114656 - bossmc:rework-no-coverage-attr, r=oli-obkbors-2/+26
Rework `no_coverage` to `coverage(off)` As discussed at the tail of https://github.com/rust-lang/rust/issues/84605 this replaces the `no_coverage` attribute with a `coverage` attribute that takes sub-parameters (currently `off` and `on`) to control the coverage instrumentation. Allows future-proofing for things like `coverage(off, reason="Tested live", issue="#12345")` or similar.
2023-09-13Rollup merge of #115798 - RalfJung:non_1zst_field, r=wesleywiserMatthias Krüger-31/+10
add helper method for finding the one non-1-ZST field
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-36/+22
2023-09-12add helper method for finding the one non-1-ZST fieldRalf Jung-31/+10
2023-09-11Remove assert that checks type equalityouz-a-4/+4