Commit Graph

177 Commits

Author SHA1 Message Date
Mikael Urankar
f92779512d Add set -v as we can't pass command line argument with /usr/bin/env 2022-04-15 09:58:25 +02:00
MikaelUrankar
330127599a Don't assume /bin/bash is available on every system. 2022-04-14 14:12:06 +02:00
antoyo
d69ada6bf3
Merge pull request #156 from yvt/fix-int-ops
Implement `saturating_{add, sub}` for non-native integer types
2022-04-06 10:14:19 -04:00
yvt
a7a09d556a Wrap numbers with black_box in-line, remove one 2022-04-06 22:11:52 +09:00
yvt
5061e3ad16 Remove redundant assertions 2022-04-06 21:49:54 +09:00
yvt
00677e5159 Implement saturating_{add, sub} for non-native integer types
Updates their unsigned code paths to use the `Builder::gcc_` methods
that automatically lower non-native integer operations to native ones.

Also updates the signed code path of `saturating_add` to support non-
native integer types. That of `saturating_sub` already supports this,
so no major changes have been made.
2022-04-06 01:48:37 +09:00
yvt
837a4467bc test: Test more integer types and checked arithmetic in tests/run/int.rs 2022-04-06 01:25:13 +09:00
yvt
56983cf3c6 test: Remove redundant code from tests/run/int.rs 2022-04-01 12:55:00 +09:00
antoyo
341b9f274b
Merge pull request #153 from GuillaumeGomez/general-intrinsics
Sort archs and make the generate predictable
2022-03-31 10:16:51 -04:00
Guillaume Gomez
035ac03521 Add intrinsics not bound to a specific arch 2022-03-31 14:58:31 +02:00
antoyo
403e198f4a
Merge pull request #154 from rust-lang/fix/error-var-tracking
Fix error related to var tracking assignments
2022-03-31 08:40:18 -04:00
Antoni Boucher
ef1a6d7c23 Fix error related to var tracking assignments 2022-03-31 08:40:05 -04:00
antoyo
dac359504c
Merge pull request #152 from GuillaumeGomez/more-intrinsics
Generate all listed architectures from llvmint
2022-03-30 14:26:27 -04:00
Guillaume Gomez
68ac3a4b3b Generate all listed architectures from llvmint 2022-03-30 18:41:57 +02:00
antoyo
0237d9562d
Merge pull request #151 from GuillaumeGomez/x86-intrinsics
Add intrinsic translation for x86 arch
2022-03-30 12:22:19 -04:00
Guillaume Gomez
3970825b92 Add intrinsic translation for x86 arch 2022-03-30 17:37:33 +02:00
antoyo
f537564454
Merge pull request #148 from rust-lang/feature/packed-struct
Feature/packed struct
2022-03-30 09:55:30 -04:00
antoyo
76cf7c2058
Merge pull request #150 from bjorn3/bootstrap_missing_vendor_intrinsics
Add missing vendor intrinsics
2022-03-30 09:47:12 -04:00
bjorn3
9bb797c2ae Add missing vendor intrinsics 2022-03-30 14:16:02 +02:00
Antoni Boucher
927eea3860 Add support for packed struct 2022-03-29 22:52:25 -04:00
antoyo
a445bcb53d
Merge pull request #149 from rust-lang/missing-comments
Add support for target builtins
2022-03-29 22:51:00 -04:00
Antoni Boucher
267e5e1ea7 Add support for target builtins 2022-03-29 22:50:20 -04:00
antoyo
13ab1ab9de
Merge pull request #129 from rust-lang/feature/simd
Feature/simd
2022-03-29 22:47:16 -04:00
Antoni Boucher
02970a6ca8 Add support for target builtins 2022-03-29 21:41:17 -04:00
antoyo
14c33f592a
Merge pull request #147 from bjorn3/misc_improvements
Don't pass --target in cargo.sh
2022-03-26 13:44:47 -04:00
bjorn3
590bfc670a Don't pass --target in cargo.sh
This was a workaround for compiling proc macros resulting in an abi
incompatibility. By passing --target proc macros will be built by the
llvm backend. This is no longer necessary as the abi incompatibility has
since been fixed.
2022-03-26 18:03:32 +01:00
antoyo
39683d8eb7
Merge pull request #146 from bjorn3/rustup
Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)
2022-03-26 13:00:39 -04:00
bjorn3
fb9658d312 Review comments 2022-03-26 17:27:06 +01:00
bjorn3
724473b330 Fix compiletest compilation 2022-03-26 16:29:27 +01:00
bjorn3
edf33fe0a2 Add Destruct and Drop traits to static.rs 2022-03-26 14:41:55 +01:00
bjorn3
6faa6a28ba Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25) 2022-03-26 14:12:44 +01:00
bjorn3
db591778ac Sync from rust bc881e83d1 2022-03-26 12:52:21 +01:00
antoyo
a22e15b954
Merge pull request #143 from yvt/sysroot-profile
Add `--release-sysroot` flag to `build.sh`
2022-03-23 12:11:28 -04:00
yvt
842a5fba1c Add --release-sysroot flag to build.sh
When this flag is present, `build.sh` will pass `--release` to
`build_sysroot.sh`.
2022-03-23 23:18:33 +09:00
yvt
72306608e0 Add a simple argument parser to build.sh 2022-03-23 23:16:45 +09:00
antoyo
44c0204af3
Merge pull request #141 from rust-lang/fix/unsigned-by-signed-shift
Fix shift of unsigned integer by signed integer
2022-03-19 12:47:46 -04:00
Antoni Boucher
0fb350f37c Fix shift of unsigned integer by signed integer 2022-03-19 12:15:26 -04:00
antoyo
d63ea3e037
Merge pull request #137 from rust-lang/fix/box-alloc-ice
Fix ice in box alloc
2022-03-19 00:11:45 -04:00
antoyo
b3e50bde9d
Merge pull request #139 from rust-lang/fix/compiler-builtin-version
Fix version of compiler_builtins to fix compilation failure
2022-03-19 00:01:41 -04:00
Antoni Boucher
be9789bf01 Fix ice in box alloc 2022-03-18 23:31:48 -04:00
Antoni Boucher
12f782edfa Fix version of compiler_builtins to fix compilation failure 2022-03-18 23:31:02 -04:00
bors
fadd1c536a 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.
2022-03-18 03:01:46 +00:00
Michael Woerister
1c389322d2 debuginfo: Refactor debuginfo generation for types -- Rename DebugInfoMethods::create_vtable_metadata() to DebugInfoMethods::create_vtable_debuginfo() 2022-03-14 17:25:24 +01:00
Nicholas Nethercote
64012a1c2e 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`.
2022-03-11 13:31:24 +11:00
antoyo
0cff1d0331
Merge pull request #136 from light4/clean_test
Stop removing the llvm-asm tests in test.sh since they don't exist anymore
2022-03-08 08:43:43 -05:00
lightning1141
7c1f863d74
Stop removing the llvm-asm tests in test.sh since they don't exist anymore 2022-03-08 11:40:28 +08:00
bors
3e7035fa86 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`
2022-03-07 15:25:42 +00:00
Nicholas Nethercote
d35fc85a44 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.
2022-03-07 13:41:47 +11:00
bors
0e36868bc7 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`
2022-03-07 02:07:36 +00:00
Nicholas Nethercote
92d1850f17 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.
2022-03-07 08:25:50 +11:00