]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoReview comments
bjorn3 [Sat, 26 Mar 2022 16:27:06 +0000 (17:27 +0100)]
Review comments

2 years agoFix compiletest compilation
bjorn3 [Sat, 26 Mar 2022 15:14:39 +0000 (16:14 +0100)]
Fix compiletest compilation

2 years agoAdd Destruct and Drop traits to static.rs
bjorn3 [Sat, 26 Mar 2022 13:25:37 +0000 (14:25 +0100)]
Add Destruct and Drop traits to static.rs

2 years agoRustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)
bjorn3 [Sat, 26 Mar 2022 13:12:44 +0000 (14:12 +0100)]
Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)

2 years agoSync from rust bc881e83d1cced71046e844fa55c0b0e9f9af382
bjorn3 [Sat, 26 Mar 2022 11:52:21 +0000 (12:52 +0100)]
Sync from rust bc881e83d1cced71046e844fa55c0b0e9f9af382

2 years agoMerge pull request #143 from yvt/sysroot-profile
antoyo [Wed, 23 Mar 2022 16:11:28 +0000 (12:11 -0400)]
Merge pull request #143 from yvt/sysroot-profile

Add `--release-sysroot` flag to `build.sh`

2 years agoAdd `--release-sysroot` flag to `build.sh`
yvt [Wed, 23 Mar 2022 14:18:33 +0000 (23:18 +0900)]
Add `--release-sysroot` flag to `build.sh`

When this flag is present, `build.sh` will pass `--release` to
`build_sysroot.sh`.

2 years agoAdd a simple argument parser to `build.sh`
yvt [Wed, 23 Mar 2022 14:16:45 +0000 (23:16 +0900)]
Add a simple argument parser to `build.sh`

2 years agoMerge pull request #141 from rust-lang/fix/unsigned-by-signed-shift
antoyo [Sat, 19 Mar 2022 16:47:46 +0000 (12:47 -0400)]
Merge pull request #141 from rust-lang/fix/unsigned-by-signed-shift

Fix shift of unsigned integer by signed integer

2 years agoFix shift of unsigned integer by signed integer
Antoni Boucher [Sat, 19 Mar 2022 16:15:26 +0000 (12:15 -0400)]
Fix shift of unsigned integer by signed integer

2 years agoMerge pull request #137 from rust-lang/fix/box-alloc-ice
antoyo [Sat, 19 Mar 2022 04:11:45 +0000 (00:11 -0400)]
Merge pull request #137 from rust-lang/fix/box-alloc-ice

Fix ice in box alloc

2 years agoMerge pull request #139 from rust-lang/fix/compiler-builtin-version
antoyo [Sat, 19 Mar 2022 04:01:41 +0000 (00:01 -0400)]
Merge pull request #139 from rust-lang/fix/compiler-builtin-version

Fix version of compiler_builtins to fix compilation failure

2 years agoFix ice in box alloc
Antoni Boucher [Tue, 8 Mar 2022 22:05:32 +0000 (17:05 -0500)]
Fix ice in box alloc

2 years agoFix version of compiler_builtins to fix compilation failure
Antoni Boucher [Sat, 19 Mar 2022 03:31:02 +0000 (23:31 -0400)]
Fix version of compiler_builtins to fix compilation failure

2 years agoAuto merge of #88098 - Amanieu:oom_panic, r=nagisa
bors [Fri, 18 Mar 2022 03:01:46 +0000 (03:01 +0000)]
Auto merge of #88098 - Amanieu:oom_panic, r=nagisa

Implement -Z oom=panic

This PR removes the `#[rustc_allocator_nounwind]` attribute on `alloc_error_handler` which allows it to unwind with a panic instead of always aborting. This is then used to implement `-Z oom=panic` as per RFC 2116 (tracking issue #43596).

Perf and binary size tests show negligible impact.

2 years agodebuginfo: Refactor debuginfo generation for types -- Rename DebugInfoMethods::create...
Michael Woerister [Mon, 14 Mar 2022 16:18:30 +0000 (17:18 +0100)]
debuginfo: Refactor debuginfo generation for types -- Rename DebugInfoMethods::create_vtable_metadata() to DebugInfoMethods::create_vtable_debuginfo()

2 years agoImprove `AdtDef` interning.
Nicholas Nethercote [Fri, 4 Mar 2022 20:28:41 +0000 (07:28 +1100)]
Improve `AdtDef` interning.

This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.

2 years agoMerge pull request #136 from light4/clean_test
antoyo [Tue, 8 Mar 2022 13:43:43 +0000 (08:43 -0500)]
Merge pull request #136 from light4/clean_test

Stop removing the llvm-asm tests in test.sh since they don't exist anymore

2 years agoStop removing the llvm-asm tests in test.sh since they don't exist anymore
lightning1141 [Tue, 8 Mar 2022 03:40:28 +0000 (11:40 +0800)]
Stop removing the llvm-asm tests in test.sh since they don't exist anymore

2 years agoAuto merge of #94690 - nnethercote:clarify-Layout-interning, r=fee1-dead
bors [Mon, 7 Mar 2022 15:25:42 +0000 (15:25 +0000)]
Auto merge of #94690 - nnethercote:clarify-Layout-interning, r=fee1-dead

Clarify `Layout` interning.

`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.

r? `@fee1-dead`

2 years agoClarify `Layout` interning.
Nicholas Nethercote [Fri, 4 Mar 2022 02:46:56 +0000 (13:46 +1100)]
Clarify `Layout` interning.

`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.

2 years agoAuto merge of #94638 - erikdesjardins:noextranull, r=nagisa
bors [Mon, 7 Mar 2022 02:07:36 +0000 (02:07 +0000)]
Auto merge of #94638 - erikdesjardins:noextranull, r=nagisa

cleanup: remove unused ability to have LLVM null-terminate const strings

(and the copied function in rustc_codegen_gcc)

Noticed this while writing https://github.com/rust-lang/rust/pull/94450#issuecomment-1059687348.

r? `@nagisa`

2 years agoIntroduce `ConstAllocation`.
Nicholas Nethercote [Tue, 1 Mar 2022 20:15:04 +0000 (07:15 +1100)]
Introduce `ConstAllocation`.

Currently some `Allocation`s are interned, some are not, and it's very
hard to tell at a use point which is which.

This commit introduces `ConstAllocation` for the known-interned ones,
which makes the division much clearer. `ConstAllocation::inner()` is
used to get the underlying `Allocation`.

In some places it's natural to use an `Allocation`, in some it's natural
to use a `ConstAllocation`, and in some places there's no clear choice.
I've tried to make things look as nice as possible, while generally
favouring `ConstAllocation`, which is the type that embodies more
information. This does require quite a few calls to `inner()`.

The commit also tweaks how `PartialOrd` works for `Interned`. The
previous code was too clever by half, building on `T: Ord` to make the
code shorter. That caused problems with deriving `PartialOrd` and `Ord`
for `ConstAllocation`, so I changed it to build on `T: PartialOrd`,
which is slightly more verbose but much more standard and avoided the
problems.

2 years agocleanup: remove unused ability to have LLVM null-terminate const strings
Erik Desjardins [Sat, 5 Mar 2022 04:14:38 +0000 (23:14 -0500)]
cleanup: remove unused ability to have LLVM null-terminate const strings

2 years agoAdd -Z oom={panic,abort} command-line option
Amanieu d'Antras [Wed, 6 Oct 2021 14:52:54 +0000 (15:52 +0100)]
Add -Z oom={panic,abort} command-line option

2 years agoall: fix some typos
cuishuang [Thu, 3 Mar 2022 11:47:23 +0000 (19:47 +0800)]
all: fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
2 years agorename ErrorReported -> ErrorGuaranteed
mark [Sun, 23 Jan 2022 18:34:26 +0000 (12:34 -0600)]
rename ErrorReported -> ErrorGuaranteed

2 years agoAuto merge of #87402 - nagisa:nagisa/request-feature-requests-for-features, r=estebank
bors [Wed, 2 Mar 2022 03:03:22 +0000 (03:03 +0000)]
Auto merge of #87402 - nagisa:nagisa/request-feature-requests-for-features, r=estebank

Direct users towards using Rust target feature names in CLI

This PR consists of a couple of changes on how we handle target features.

In particular there is a bug-fix wherein we avoid passing through features that aren't prefixed by `+` or `-` to LLVM. These appear to be causing LLVM to assert, which is pretty poor a behaviour (and also makes it pretty clear we expect feature names to be prefixed).

The other commit, I anticipate to be somewhat more controversial is outputting a warning when users specify a LLVM-specific, or otherwise unknown, feature name on the CLI. In those situations we request users to either replace it with a known Rust feature name (e.g. `bmi` -> `bmi1`) or file a feature request. I've a couple motivations for this: first of all, if users are specifying these features on the command line, I'm pretty confident there is also a need for these features to be usable via `#[cfg(target_feature)]` machinery.  And second, we're growing a fair number of backends recently and having ability to provide some sort of unified-ish interface in this place seems pretty useful to me.

Sponsored by: standard.ai

2 years agoQuerify `global_backend_features`
Simonas Kazlauskas [Fri, 24 Sep 2021 15:02:02 +0000 (18:02 +0300)]
Querify `global_backend_features`

At the very least this serves to deduplicate the diagnostics that are
output about unknown target features provided via CLI.

2 years agoRevert "Auto merge of #92419 - erikdesjardins:coldland, r=nagisa"
Erik Desjardins [Sat, 26 Feb 2022 17:52:07 +0000 (12:52 -0500)]
Revert "Auto merge of #92419 - erikdesjardins:coldland, r=nagisa"

This reverts commit 4f49627c6fe2a32d1fed6310466bb0e1c535c0c0, reversing
changes made to 028c6f1454787c068ff5117e9000a1de4fd98374.

2 years agoMerge pull request #135 from rust-lang/feature/byval-params
antoyo [Mon, 28 Feb 2022 03:56:46 +0000 (22:56 -0500)]
Merge pull request #135 from rust-lang/feature/byval-params

Add support for on_stack parameters

2 years agoAdd support for on_stack parameters
Antoni Boucher [Sun, 27 Feb 2022 18:46:57 +0000 (13:46 -0500)]
Add support for on_stack parameters

2 years agoMerge pull request #133 from bjorn3/less_exports
antoyo [Sun, 27 Feb 2022 15:28:28 +0000 (10:28 -0500)]
Merge pull request #133 from bjorn3/less_exports

Don't export global allocs which are not statics

2 years agoDon't export global allocs which are not statics
bjorn3 [Sat, 26 Feb 2022 08:59:37 +0000 (09:59 +0100)]
Don't export global allocs which are not statics

They aren't be referenced outside of the current cgu anyway. This should make
optimizations a bit more effective.

2 years agoMerge pull request #132 from bjorn3/panic_unwind
antoyo [Sun, 27 Feb 2022 05:14:57 +0000 (00:14 -0500)]
Merge pull request #132 from bjorn3/panic_unwind

Support -Cpanic=unwind without unwinding

2 years agoAllow unreachable blocks for now
bjorn3 [Sat, 26 Feb 2022 18:11:58 +0000 (19:11 +0100)]
Allow unreachable blocks for now

The cleanup blocks normally executed when unwinding are unreachable for
now as unwinding is not yet implemented.

2 years agoSupport -Cpanic=unwind without unwinding
bjorn3 [Sat, 26 Feb 2022 09:13:56 +0000 (10:13 +0100)]
Support -Cpanic=unwind without unwinding

2 years agoMerge pull request #131 from bjorn3/fix_non_singleton_builder
antoyo [Sat, 26 Feb 2022 18:02:18 +0000 (13:02 -0500)]
Merge pull request #131 from bjorn3/fix_non_singleton_builder

Fix miscompilation when cg_ssa is using multiple builders at the same time

2 years agoAdd and change a TODO
bjorn3 [Sat, 26 Feb 2022 17:29:23 +0000 (18:29 +0100)]
Add and change a TODO

2 years agoFix inttoptr
bjorn3 [Sat, 26 Feb 2022 08:41:37 +0000 (09:41 +0100)]
Fix inttoptr

2 years agoFix review comments
bjorn3 [Fri, 25 Feb 2022 16:25:32 +0000 (17:25 +0100)]
Fix review comments

2 years agoRemove current_block field of CodegenCx
bjorn3 [Fri, 25 Feb 2022 14:38:23 +0000 (15:38 +0100)]
Remove current_block field of CodegenCx

This field often had the wrong value when using multiple builders at the
same time.

2 years agoUse bitcast for ptrtoint and inttoptr
bjorn3 [Fri, 25 Feb 2022 14:36:08 +0000 (15:36 +0100)]
Use bitcast for ptrtoint and inttoptr

This works now

2 years agoMake bx.block non-optional
bjorn3 [Fri, 25 Feb 2022 14:27:19 +0000 (15:27 +0100)]
Make bx.block non-optional

2 years agoUse bx.switch_to_block where possible
bjorn3 [Fri, 25 Feb 2022 14:19:52 +0000 (15:19 +0100)]
Use bx.switch_to_block where possible

2 years agoMerge pull request #130 from bjorn3/rustup
antoyo [Fri, 25 Feb 2022 14:12:31 +0000 (09:12 -0500)]
Merge pull request #130 from bjorn3/rustup

Rustup to rustc 1.61.0-nightly (4b043faba 2022-02-24)

2 years agoRustup to rustc 1.61.0-nightly (4b043faba 2022-02-24)
bjorn3 [Fri, 25 Feb 2022 10:29:57 +0000 (11:29 +0100)]
Rustup to rustc 1.61.0-nightly (4b043faba 2022-02-24)

2 years agoSync from rust 3d127e2040b57157936f5f24e114a8b4c9a505ef
bjorn3 [Thu, 24 Feb 2022 18:25:07 +0000 (19:25 +0100)]
Sync from rust 3d127e2040b57157936f5f24e114a8b4c9a505ef

2 years agoAuto merge of #94123 - bjorn3:cg_ssa_singleton_builder, r=tmiasko
bors [Thu, 24 Feb 2022 12:28:19 +0000 (12:28 +0000)]
Auto merge of #94123 - bjorn3:cg_ssa_singleton_builder, r=tmiasko

Partially move cg_ssa towards using a single builder

Not all codegen backends can handle hopping between blocks well. For example Cranelift requires blocks to be terminated before switching to building a new block. Rust-gpu requires a `RefCell` to allow hopping between blocks and cg_gcc currently has a buggy implementation of hopping between blocks. This PR reduces the amount of cases where cg_ssa switches between blocks before they are finished and mostly fixes the block hopping in cg_gcc. (~~only `scalar_to_backend` doesn't handle it correctly yet in cg_gcc~~ fixed that one.)

`@antoyo` please review the cg_gcc changes.

2 years agoIntroduce Bx::switch_to_block
bjorn3 [Fri, 18 Feb 2022 14:37:31 +0000 (15:37 +0100)]
Introduce Bx::switch_to_block

2 years agoRemove build_sibling_block
bjorn3 [Fri, 18 Feb 2022 14:10:56 +0000 (15:10 +0100)]
Remove build_sibling_block

2 years agoMerge pull request #127 from JBBgameich/readme-compiler-rt
antoyo [Sat, 19 Feb 2022 19:02:18 +0000 (14:02 -0500)]
Merge pull request #127 from JBBgameich/readme-compiler-rt

README: Add compiler-rt cloning step

2 years agoREADME: Add compiler-rt cloning step
Jonah Brüchert [Fri, 4 Feb 2022 01:06:46 +0000 (02:06 +0100)]
README: Add compiler-rt cloning step

2 years agoMove ty::print methods to Drop-based scope guards
Mark Rousskov [Wed, 16 Feb 2022 18:04:48 +0000 (13:04 -0500)]
Move ty::print methods to Drop-based scope guards

2 years agoUnconditionally update symbols
bjorn3 [Thu, 10 Feb 2022 17:27:18 +0000 (18:27 +0100)]
Unconditionally update symbols

All paths to an ArchiveBuilder::build call update_symbols first.

2 years agoAuto merge of #93511 - cjgillot:query-copy, r=oli-obk
bors [Thu, 10 Feb 2022 09:37:07 +0000 (09:37 +0000)]
Auto merge of #93511 - cjgillot:query-copy, r=oli-obk

Ensure that queries only return Copy types.

This should pervent the perf footgun of returning a result with an expensive `Clone` impl (like a `Vec` of a hash map).

I went for the stupid solution of allocating on an arena everything that was not `Copy`. Some query results could be made Copy easily, but I did not really investigate.

2 years agoMake FnAbiError Copy.
Camille GILLOT [Tue, 1 Feb 2022 17:44:45 +0000 (18:44 +0100)]
Make FnAbiError Copy.

2 years agoEnsure that queries only return Copy types.
Camille GILLOT [Mon, 31 Jan 2022 18:55:34 +0000 (19:55 +0100)]
Ensure that queries only return Copy types.

2 years ago`#[used(linker)]` attribute (https://github.com/dtolnay/linkme/issues/41)
cynecx [Mon, 22 Nov 2021 12:14:54 +0000 (13:14 +0100)]
`#[used(linker)]` attribute (https://github.com/dtolnay/linkme/issues/41)

2 years agoMerge pull request #122 from bjorn3/rustup
antoyo [Tue, 1 Feb 2022 17:32:43 +0000 (12:32 -0500)]
Merge pull request #122 from bjorn3/rustup

Rustup to rustc 1.60.0-nightly (a00e130da 2022-01-29)

2 years agoMove coretests to the 2021 edition
bjorn3 [Tue, 1 Feb 2022 15:46:48 +0000 (16:46 +0100)]
Move coretests to the 2021 edition

2 years agoReplace unimplemented with todo in apply_attrs_to_cleanup_callsite
bjorn3 [Sun, 30 Jan 2022 12:39:41 +0000 (13:39 +0100)]
Replace unimplemented with todo in apply_attrs_to_cleanup_callsite

2 years agoFix type_kind implementation
bjorn3 [Sun, 30 Jan 2022 12:38:27 +0000 (13:38 +0100)]
Fix type_kind implementation

2 years agoRustup to rustc 1.60.0-nightly (a00e130da 2022-01-29)
bjorn3 [Sun, 30 Jan 2022 12:21:12 +0000 (13:21 +0100)]
Rustup to rustc 1.60.0-nightly (a00e130da 2022-01-29)

2 years agoSync from rust a00e130dae74a213338e2b095ec855156d8f3d8a
bjorn3 [Tue, 1 Feb 2022 16:49:41 +0000 (17:49 +0100)]
Sync from rust a00e130dae74a213338e2b095ec855156d8f3d8a

2 years agoMerge pull request #125 from rust-lang/fix/simd-slice
antoyo [Tue, 1 Feb 2022 00:37:33 +0000 (19:37 -0500)]
Merge pull request #125 from rust-lang/fix/simd-slice

Implement simd_neg

2 years agoImplement simd_neg
Antoni Boucher [Sat, 15 Jan 2022 16:13:35 +0000 (11:13 -0500)]
Implement simd_neg

2 years agoSupport 128-bit integers on platforms without native support (#103)
antoyo [Mon, 31 Jan 2022 02:45:14 +0000 (21:45 -0500)]
Support 128-bit integers on platforms without native support (#103)

* Use sized integer types

* Add support for integer types not supported on some platforms

* Add feature to test non-native integers in CI

2 years agoMerge pull request #118 from bjorn3/function_sections
antoyo [Wed, 26 Jan 2022 15:22:06 +0000 (10:22 -0500)]
Merge pull request #118 from bjorn3/function_sections

Support -Zfunction-sections

2 years agoSupport -Zfunction-sections
bjorn3 [Tue, 25 Jan 2022 17:16:17 +0000 (18:16 +0100)]
Support -Zfunction-sections

This puts every function and data object in their own section. This
allows the linker to omit unused functions and data objects with
--gc-sections.

On linux this shrinks a hello world binary without optimizations
(neither sysroot nor binary) from 17MB to 13MB. It shrinks a hello world
binary with only sysroot optimizations from 14MB to 13MB. For comparison
cg_llvm produces a 3.5MB debug mode hello world binary with an optimized
sysroot. Cg_clif produces a 10MB debug mode hello world binary without
an optimized sysroot.

2 years agoSupport upgrading the alignment of a global variable (#121)
antoyo [Wed, 26 Jan 2022 13:57:17 +0000 (08:57 -0500)]
Support upgrading the alignment of a global variable (#121)

* Renable failing test
* Update to newest gccjit.rs

2 years agoMerge pull request #115 from bjorn3/foreign_statics
antoyo [Tue, 25 Jan 2022 14:17:50 +0000 (09:17 -0500)]
Merge pull request #115 from bjorn3/foreign_statics

Correctly import foreign statics

2 years agoMove rustup component installation to rust-toolchain
bjorn3 [Mon, 24 Jan 2022 18:45:38 +0000 (19:45 +0100)]
Move rustup component installation to rust-toolchain

This allows cargo check to function correctly without having to first
run prepare_build.sh. cg_clif has been using rust-toolchain too for a
while now.

2 years agoCorrectly import foreign statics
bjorn3 [Sun, 23 Jan 2022 18:39:55 +0000 (19:39 +0100)]
Correctly import foreign statics

Previously foreign statics would actually cause a local static to be
defined and exported. This issue was found because std::env::vars() was
found to return no env vars despite many being defined. This was caused
by libstd importing environ as foreign static. The accidental definition
of environ caused libstd to read a null pointer which was interpreted as
there being no environment variables at all.

Also fix tests. STDOUT is not defined by libc. The correct name is stdout.
This previously worked as STDOUT was incorrectly defined as null pointer
during codegen.

2 years agoMerge landing_pad and set_cleanup into cleanup_landing_pad
bjorn3 [Mon, 24 Jan 2022 12:57:32 +0000 (13:57 +0100)]
Merge landing_pad and set_cleanup into cleanup_landing_pad

2 years agoMerge add_handler into catch_switch
bjorn3 [Mon, 24 Jan 2022 12:50:12 +0000 (13:50 +0100)]
Merge add_handler into catch_switch

Some codegen backends may require all handlers to be immediately known

2 years agoRemove unused return values from resume and cleanup_ret
bjorn3 [Mon, 24 Jan 2022 12:48:09 +0000 (13:48 +0100)]
Remove unused return values from resume and cleanup_ret

Given that these instructions are diverging, not every codegen backend
may be able to produce a return value for them.

2 years agoReorder unwinding related builder methods to differentiate between dwarf and msvc...
bjorn3 [Mon, 24 Jan 2022 12:45:34 +0000 (13:45 +0100)]
Reorder unwinding related builder methods to differentiate between dwarf and msvc instructions

2 years agoAdd preliminary support for inline assembly for msp430.
William D. Jones [Thu, 20 Jan 2022 22:44:50 +0000 (17:44 -0500)]
Add preliminary support for inline assembly for msp430.

2 years agoUse Symbol for target features in asm handling
bjorn3 [Mon, 10 Jan 2022 14:32:45 +0000 (15:32 +0100)]
Use Symbol for target features in asm handling

This saves a couple of Symbol::intern calls

2 years agoAdd comment
Antoni Boucher [Sat, 15 Jan 2022 13:57:34 +0000 (08:57 -0500)]
Add comment

2 years agoRemove deprecated LLVM-style inline assembly
Tomasz Miąsko [Wed, 12 Jan 2022 00:00:00 +0000 (00:00 +0000)]
Remove deprecated LLVM-style inline assembly

2 years agoStore a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`
Aaron Hill [Mon, 3 Jan 2022 03:37:05 +0000 (22:37 -0500)]
Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`

The field is also renamed from `ident` to `name. In most cases,
we don't actually need the `Span`. A new `ident` method is added
to `VariantDef` and `FieldDef`, which constructs the full `Ident`
using `tcx.def_ident_span()`. This method is used in the cases
where we actually need an `Ident`.

This makes incremental compilation properly track changes
to the `Span`, without all of the invalidations caused by storing
a `Span` directly via an `Ident`.

2 years agoUpdate references to `-Z symbol-mangling-version` to use `-C`
Josh Triplett [Thu, 21 Oct 2021 12:57:14 +0000 (14:57 +0200)]
Update references to `-Z symbol-mangling-version` to use `-C`

Replace `-Z symbol-mangling-version=v0` with `-C symbol-mangling-version=v0`.

Replace `-Z symbol-mangling-version=legacy` with
`-Z unstable-options -C symbol-mangling-version=legacy`.

2 years agoMerge pull request #114 from bjorn3/sync_from_rust
antoyo [Sat, 1 Jan 2022 17:04:05 +0000 (12:04 -0500)]
Merge pull request #114 from bjorn3/sync_from_rust

Sync from rust 028c6f1454787c068ff5117e9000a1de4fd98374

2 years agoAuto merge of #92419 - erikdesjardins:coldland, r=nagisa
bors [Sat, 1 Jan 2022 13:28:13 +0000 (13:28 +0000)]
Auto merge of #92419 - erikdesjardins:coldland, r=nagisa

Mark drop calls in landing pads `cold` instead of `noinline`

Now that deferred inlining has been disabled in LLVM (#92110), this shouldn't cause catastrophic size blowup.

I confirmed that the test cases from https://github.com/rust-lang/rust/issues/41696#issuecomment-298696944 still compile quickly (<1s) after this change. ~Although note that I wasn't able to reproduce the original issue using a recent rustc/llvm with deferred inlining enabled, so those tests may no longer be representative. I was also unable to create a modified test case that reproduced the original issue.~ (edit: I reproduced it on CI by accident--the first commit timed out on the LLVM 12 builder, because I forgot to make it conditional on LLVM version)

r? `@nagisa`
cc `@arielb1` (this effectively reverts #42771 "mark calls in the unwind path as !noinline")
cc `@RalfJung` (fixes #46515)

edit: also fixes #87055

2 years agoRemove unused extern crate rustc_symbol_mangling
bjorn3 [Fri, 31 Dec 2021 15:57:33 +0000 (16:57 +0100)]
Remove unused extern crate rustc_symbol_mangling

2 years agoMerge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31
bjorn3 [Fri, 31 Dec 2021 15:26:32 +0000 (16:26 +0100)]
Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31

2 years agoRemove unnecessary report_symbol_names call (#113)
bjorn3 [Thu, 30 Dec 2021 18:27:11 +0000 (19:27 +0100)]
Remove unnecessary report_symbol_names call (#113)

rustc_interface already calls it for you

2 years agoIgnore new failing test_is_sorted test
bjorn3 [Thu, 30 Dec 2021 17:16:04 +0000 (18:16 +0100)]
Ignore new failing test_is_sorted test

2 years agoDisable long running libcore tests
bjorn3 [Thu, 30 Dec 2021 16:50:52 +0000 (17:50 +0100)]
Disable long running libcore tests

These only finish in reasonable time with optimizations enabled.

This patch file is copied from cg_clif.

2 years agoDisable portable-simd test
bjorn3 [Thu, 30 Dec 2021 15:57:11 +0000 (16:57 +0100)]
Disable portable-simd test

Support for portable-simd isn't implemented yet

2 years agoAdd missing feature gate
bjorn3 [Thu, 30 Dec 2021 15:28:53 +0000 (16:28 +0100)]
Add missing feature gate

2 years agoImport std::arch::asm
bjorn3 [Thu, 30 Dec 2021 14:36:30 +0000 (15:36 +0100)]
Import std::arch::asm

2 years agoRustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29)
bjorn3 [Thu, 30 Dec 2021 14:26:08 +0000 (15:26 +0100)]
Rustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29)

2 years agoSync from rust 65d8785f0a85d233e00fc84445f1aab451ec9f4f
bjorn3 [Thu, 30 Dec 2021 14:23:33 +0000 (15:23 +0100)]
Sync from rust 65d8785f0a85d233e00fc84445f1aab451ec9f4f

2 years agokeep noinline for system llvm < 14
Erik Desjardins [Thu, 30 Dec 2021 04:19:55 +0000 (23:19 -0500)]
keep noinline for system llvm < 14

2 years agoMark drop calls in landing pads cold instead of noinline
Erik Desjardins [Wed, 29 Dec 2021 20:28:31 +0000 (15:28 -0500)]
Mark drop calls in landing pads cold instead of noinline

Now that deferred inlining has been disabled in LLVM,
this shouldn't cause catastrophic size blowup.

2 years agoAuto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk
bors [Sun, 19 Dec 2021 09:31:37 +0000 (09:31 +0000)]
Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk

Remove `SymbolStr`

This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences.

Best reviewed one commit at a time.

r? `@oli-obk`

2 years agoFeature/global rvalue initialization petter tomner (#111)
antoyo [Thu, 16 Dec 2021 04:48:10 +0000 (23:48 -0500)]
Feature/global rvalue initialization petter tomner (#111)

* Use new initialization functions

* Fix for new reflection patch

* Fix for new TLS patch