Commit Graph

877 Commits

Author SHA1 Message Date
bjorn3
b909493151 Remove dynamic_alloca from BuilderMethods 2023-02-28 19:18:41 -05:00
bjorn3
d9933199cd Merge apply_attrs_callsite into call and invoke
Some codegen backends are not able to apply callsite attrs after the fact.
2023-02-28 19:18:40 -05:00
bjorn3
15b0747049 Remove unused target_cpu and tune_cpu methods from ExtraBackendMethods 2023-02-28 19:13:19 -05:00
bjorn3
5d5c5f92fb Remove several unused methods from MiscMethods 2023-02-28 19:13:19 -05:00
bjorn3
5943166b29 Remove unused Context assoc type from WriteBackendMethods 2023-02-28 19:13:19 -05:00
Ellis Hoag
5c30c25f07 print <signal> when ranlib failed without an exit code 2023-02-28 19:13:19 -05:00
Ellis Hoag
9c67dcfe42 lint and remove unused diagnostic 2023-02-28 19:13:19 -05:00
Ellis Hoag
70aeb9e2b3 remove comment 2023-02-28 19:13:19 -05:00
Ellis Hoag
925b11ece0 fix lifetime error 2023-02-28 19:13:19 -05:00
Ellis Hoag
9bbb49150a rebase and update trait names 2023-02-28 19:13:19 -05:00
Ellis Hoag
2e46dc2cff impl SessionDiagnostic for LayoutError and Spanned<T> 2023-02-28 19:13:19 -05:00
Ellis Hoag
ef3aaa1f21 Add monomorphization errors 2023-02-28 19:13:18 -05:00
Ellis Hoag
f21041d7c3 lint type 2023-02-28 19:07:24 -05:00
Ellis Hoag
4718beead6 Add wrapper type for ExitCode for use in RanlibFailure 2023-02-28 19:07:24 -05:00
Ellis Hoag
c4149da9fd remove IntoDiagnosticArg impl for Option 2023-02-28 19:07:24 -05:00
Ellis Hoag
b4a051e3b3 Lint against untranslatable diagnostics in rustc_codegen_gcc 2023-02-28 19:07:24 -05:00
Ellis Hoag
1b5dd4bf5e Add LayoutSizeOverflow 2023-02-28 19:07:24 -05:00
Ellis Hoag
4a861c140a Add LTONotSupported 2023-02-28 19:07:24 -05:00
Ellis Hoag
2592befa7c Add UnwindingInlineAsm 2023-02-28 19:07:24 -05:00
Ellis Hoag
5a9ec83a17 Add LinkageConstOrMutType 2023-02-28 19:07:24 -05:00
Ellis Hoag
c503d978dc Add RanlibFailure 2023-02-28 19:07:24 -05:00
Urgau
a900ba9163 Stabilize bench_black_box 2023-02-28 19:07:23 -05:00
Oli Scherer
a50c15275f Remove dead broken code from const zst handling in backends 2023-02-28 18:57:14 -05:00
Josh Stone
91cf28428e Move the cast_float_to_int fallback code to GCC
Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
2023-02-28 18:57:14 -05:00
Ralf Jung
80b1c8dab5 interpret: rename relocation → provenance 2023-02-28 18:57:14 -05:00
Maybe Waffle
5eedd541a9 Fix ptr_mask impl in cg gcc 2023-02-28 18:57:14 -05:00
Maybe Waffle
a7f6e7ebaf Implement ptr_mask intrinsic in cg gcc 2023-02-28 18:57:14 -05:00
Nicholas Nethercote
b3f2942156 Move ArgAbi::pad_i32 into PassMode::Cast.
Because it's only needed for that variant. This shrinks the types and
clarifies the logic.
2023-02-28 18:57:14 -05:00
Nicholas Nethercote
8ebade29d6 Turn ArgAbi::pad into a bool.
Because it's only ever set to `None` or `Some(Reg::i32())`.
2023-02-28 18:57:14 -05:00
Nicholas Nethercote
3c2d43265c Simplify arg capacity calculations.
Currently they try to be very precise. But they are wrong, i.e. they
don't match what's happening in the loop below. This code isn't hot
enough for it to matter that much.
2023-02-28 18:57:14 -05:00
Nicholas Nethercote
a283dedd44 Change FnAbi::args to a boxed slice. 2023-02-28 18:57:14 -05:00
Nicholas Nethercote
d01d0d1f76 Box CastTarget within PassMode.
Because `PassMode::Cast` is by far the largest variant, but is
relatively rare.

This requires making `PassMode` not impl `Copy`, and `Clone` is no
longer necessary. This causes lots of sigil adjusting, but nothing very
notable.
2023-02-28 18:57:14 -05:00
Antoni Boucher
32a2e378f4 Fix instructions for installing git-subtree 2023-02-28 18:25:09 -05:00
Antoni Boucher
1fcf437306 Add instructions for a working git-subtree 2023-02-28 17:39:01 -05:00
antoyo
7a22c47c6a
Merge pull request #254 from rust-lang/feature/simd_scatter_gather
Feature/simd scatter gather
2023-02-25 22:22:21 -05:00
Antoni Boucher
16b377efbd Remove comment 2023-02-25 21:48:44 -05:00
Antoni Boucher
edee0973b2 Update failures for libgccjit12 2023-02-25 21:03:58 -05:00
Antoni Boucher
3e61492dc5 Add feature gate 2023-02-25 20:37:20 -05:00
Antoni Boucher
830a821b9b Update failures 2023-02-25 20:36:24 -05:00
Antoni Boucher
df72765646 Implement simd_scatter 2023-02-25 19:37:51 -05:00
Antoni Boucher
0898eab220 Implement simd_gather 2023-02-25 17:41:08 -05:00
Nicholas Nethercote
ea83d6f4d8 Use List::empty() instead of mk_substs(&[]). 2023-02-24 07:33:02 +11:00
Nicholas Nethercote
5b0dbc47d7 Rename many interner functions.
(This is a large commit. The changes to
`compiler/rustc_middle/src/ty/context.rs` are the most important ones.)

The current naming scheme is a mess, with a mix of `_intern_`, `intern_`
and `mk_` prefixes, with little consistency. In particular, in many
cases it's easy to use an iterator interner when a (preferable) slice
interner is available.

The guiding principles of the new naming system:
- No `_intern_` prefixes.
- The `intern_` prefix is for internal operations.
- The `mk_` prefix is for external operations.
- For cases where there is a slice interner and an iterator interner,
  the former is `mk_foo` and the latter is `mk_foo_from_iter`.

Also, `slice_interners!` and `direct_interners!` can now be `pub` or
non-`pub`, which helps enforce the internal/external operations
division.

It's not perfect, but I think it's a clear improvement.

The following lists show everything that was renamed.

slice_interners
- const_list
  - mk_const_list -> mk_const_list_from_iter
  - intern_const_list -> mk_const_list
- substs
  - mk_substs -> mk_substs_from_iter
  - intern_substs -> mk_substs
  - check_substs -> check_and_mk_substs (this is a weird one)
- canonical_var_infos
  - intern_canonical_var_infos -> mk_canonical_var_infos
- poly_existential_predicates
  - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter
  - intern_poly_existential_predicates -> mk_poly_existential_predicates
  - _intern_poly_existential_predicates -> intern_poly_existential_predicates
- predicates
  - mk_predicates -> mk_predicates_from_iter
  - intern_predicates -> mk_predicates
  - _intern_predicates -> intern_predicates
- projs
  - intern_projs -> mk_projs
- place_elems
  - mk_place_elems -> mk_place_elems_from_iter
  - intern_place_elems -> mk_place_elems
- bound_variable_kinds
  - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter
  - intern_bound_variable_kinds -> mk_bound_variable_kinds

direct_interners
- region
  - intern_region (unchanged)
- const
  - mk_const_internal -> intern_const
- const_allocation
  - intern_const_alloc -> mk_const_alloc
- layout
  - intern_layout -> mk_layout
- adt_def
  - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid)
  - alloc_adt_def(!) -> mk_adt_def
- external_constraints
  - intern_external_constraints -> mk_external_constraints

Other
- type_list
  - mk_type_list -> mk_type_list_from_iter
  - intern_type_list -> mk_type_list
- tup
  - mk_tup -> mk_tup_from_iter
  - intern_tup -> mk_tup
2023-02-24 07:32:24 +11:00
bors
bfa228b48c Auto merge of #108340 - eggyal:remove_traversal_trait_aliases, r=oli-obk
Remove type-traversal trait aliases

#107924 moved the type traversal (folding and visiting) traits into the type library, but created trait aliases in `rustc_middle` to minimise both the API churn for trait consumers and the arising boilerplate.  As mentioned in that PR, an alternative approach of defining subtraits with blanket implementations of the respective supertraits was also considered at that time but was ruled out as not adding much value.

Unfortunately, it has since emerged that rust-analyzer has difficulty with these trait aliases at present, resulting in a degraded contributor experience (see the recent [r-a has become useless](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/r-a.20has.20become.20useless) topic on the #t-compiler/help Zulip stream).

This PR removes the trait aliases, and accordingly the underlying type library traits are now used directly; they are parameterised by `TyCtxt<'tcx>` rather than just the `'tcx` lifetime, and imports have been updated to reflect the fact that the trait aliases' explicitly named traits are no longer automatically brought into scope.  These changes also roll-back the (no-longer required) workarounds to #107747 that were made in b409329c62.

Since this PR is just a find+replace together with the changes necessary for compilation & tidy to pass, it's currently just one mega-commit.  Let me know if you'd like it broken up.

r? `@oli-obk`
2023-02-22 18:26:51 +00:00
Alan Egerton
aefda5786e Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
David Wood
984945a117 various: translation resources from cg backend
Extend `CodegenBackend` trait with a function returning the translation
resources from the codegen backend, which can be added to the complete
list of resources provided to the emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:54 +00:00
David Wood
3e14bba40c errors: generate typed identifiers in each crate
Instead of loading the Fluent resources for every crate in
`rustc_error_messages`, each crate generates typed identifiers for its
own diagnostics and creates a static which are pulled together in the
`rustc_driver` crate and provided to the diagnostic emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:53 +00:00
Oli Scherer
4238ce2195 s/eval_usize/eval_target_usize/ for clarity 2023-02-14 08:51:19 +00:00
David Wood
9c6f7cb3c7 session: diagnostic migration lint on more fns
Apply the diagnostic migration lint to more functions on `Session`.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30 17:11:35 +00:00
antoyo
8d0ff6bf07
Merge pull request #249 from rust-lang/fix/signed-integer-overflow
Fix/signed integer overflow
2023-01-26 18:26:52 -05:00