| Age | Commit message (Collapse) | Author | Lines |
|
Never return uninhabited values at all
Functions with uninhabited return values are already marked `noreturn`,
but we were still generating return instructions for this. When running
with `-C passes=lint`, LLVM prints:
Unusual: Return statement in function with noreturn attribute
The LLVM manual makes a stronger statement about `noreturn` though:
> This produces undefined behavior at runtime if the function ever does
dynamically return.
We now emit an `abort` anywhere that would have tried to return an
uninhabited value.
Fixes #48227
cc #7463 #48229
r? @eddyb
|
|
Functions with uninhabited return values are already marked `noreturn`,
but we were still generating return instructions for this. When running
with `-C passes=lint`, LLVM prints:
Unusual: Return statement in function with noreturn attribute
The LLVM manual makes a stronger statement about `noreturn` though:
> This produces undefined behavior at runtime if the function ever does
dynamically return.
We now emit an `abort` anywhere that would have tried to return an
uninhabited value.
|
|
- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos
|
|
Shrink `mir::Statement`.
The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
|
|
Remove adt_def from projections and downcasts in MIR
As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler.
This refactor hopes to allow that, without regressing perf.
r? @eddyb
|
|
The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
|
|
|
|
r=oli-obk
Renames `EvalErrorKind` to `InterpError`
This PR renames `EvalErrorKind` to `InterpError`.
This is related to #54395.
|
|
|
|
Add a -Z time option which prints only passes which runs once
This ensures `-Z time-passes` fits on my screen =P
r? @michaelwoerister
|
|
Fix LLVM IR generated for C-variadic arguments
It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.
Fixes: #58881
|
|
It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.
|
|
Allow closure to unsafe fn coercion
Closes #57883
|
|
rustc_target: factor out common fields of non-Single Variants.
@tmandry and I were discussing ways to generalize the current variants/discriminant layout to allow more fields in the "`enum`" (or another multi-variant types, such as potentially generator state, in the future), shared by all variants, than just the tag/niche discriminant.
This refactor should make it easier to extend multi-variant layouts, as nothing is duplicating anymore between "tagged enums" and "niche-filling enums".
r? @oli-obk
|
|
|
|
|
|
|
|
|
|
|
|
`count_insn` is no longer called for inline asm, because it is private to builder.rs
|
|
|
|
|
|
|
|
|
|
|
|
declare_local still takes &FunctionDebugContext, because of borrowck errors
|
|
|
|
|
|
from cg_ssa
This introduces the static_panic_msg trait method to StaticBuilderMethods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use informational target machine for metadata
Since there is nothing to optimise there...
Should fix #58323 but haven’t tested locally.
r? @michaelwoerister
|
|
rustc: Allow using `clang` for wasm32 targets
This commit adds support code for using `clang` directly to link the
wasm32-unknown-unknown target. Currently the target is only really
configured to link with LLD directly, but this ensures that `clang` can
be configured as well.
While not immediately useful in the near term it's likely that more
wasm32 targets will pop up over time with Clang's new native support for
WebAssembly in the 8.0.0 release. Getting support into rustc early
should make it easier to experiment with these targets and try out
various changes here and there.
|
|
rustc: Update linker flavor inference from filename
This commit fixes what is believed to be a preexisting bug in the linker
flavor inference and additionally adds a new features. Previously if the
linker didn't end in `exe` the entire file name was compared to infer
the linker's flavor. This commit fixes the code to instead
unconditionally inspect `file_stem()` which is the relevant part we're
looking at to figure out what the linker flavor is.
Additionally this commit now also adds recognition of `clang` and clang
wrappers that end in `-clang` (which look like gcc wrappers). This
should allow clang-specific wrappers to get correctly inferred to the
`Gcc` linker flavor rather than the default linker flavor configured for
a target.
|
|
Remove the block on natvis for lld-link.
Since #56642 bumped minimum LLVM version to 6.0.0, Rust should be able to honor or ignore Windows natvis support with lld-link.
It looks like https://github.com/llvm-mirror/lld/commit/9133ca57b was in LLVM 7.0, while https://github.com/llvm-mirror/lld/commit/27b9c4285 made it into 6.0, at least if the release branches are anything to go by.
Fixes #59383.
|
|
Since there is nothing to optimise there...
|
|
|
|
|
|
|
|
This commit adds support code for using `clang` directly to link the
wasm32-unknown-unknown target. Currently the target is only really
configured to link with LLD directly, but this ensures that `clang` can
be configured as well.
While not immediately useful in the near term it's likely that more
wasm32 targets will pop up over time with Clang's new native support for
WebAssembly in the 8.0.0 release. Getting support into rustc early
should make it easier to experiment with these targets and try out
various changes here and there.
|
|
|
|
This commit fixes what is believed to be a preexisting bug in the linker
flavor inference and additionally adds a new features. Previously if the
linker didn't end in `exe` the entire file name was compared to infer
the linker's flavor. This commit fixes the code to instead
unconditionally inspect `file_stem()` which is the relevant part we're
looking at to figure out what the linker flavor is.
Additionally this commit now also adds recognition of `clang` and clang
wrappers that end in `-clang` (which look like gcc wrappers). This
should allow clang-specific wrappers to get correctly inferred to the
`Gcc` linker flavor rather than the default linker flavor configured for
a target.
|
|
|
|
|
|
Use try blocks in rustc_codegen_ssa
r? @scottmcm
|
|
|