Commit Graph

1451 Commits

Author SHA1 Message Date
bjorn3
18c34e41a4 Introduce Bx::switch_to_block 2022-02-24 12:18:21 +01:00
bjorn3
56b7080bdb Remove build_sibling_block 2022-02-20 13:38:15 +01:00
antoyo
164aa39fbe
Merge pull request #127 from JBBgameich/readme-compiler-rt
README: Add compiler-rt cloning step
2022-02-19 14:02:18 -05:00
Jonah Brüchert
4cdcf035a6
README: Add compiler-rt cloning step 2022-02-19 19:59:03 +01:00
Mark Rousskov
e855e2d15c Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
bjorn3
40d30ceb43 Unconditionally update symbols
All paths to an ArchiveBuilder::build call update_symbols first.
2022-02-10 18:27:18 +01:00
bors
22a30689ed 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.
2022-02-10 09:37:07 +00:00
Camille GILLOT
1b2337c19d Make FnAbiError Copy. 2022-02-09 20:11:29 +01:00
Camille GILLOT
96340e5668 Ensure that queries only return Copy types. 2022-02-09 20:07:38 +01:00
cynecx
20506e31ab #[used(linker)] attribute (https://github.com/dtolnay/linkme/issues/41) 2022-02-06 20:23:23 +01:00
antoyo
b4ad63c687
Merge pull request #122 from bjorn3/rustup
Rustup to rustc 1.60.0-nightly (a00e130da 2022-01-29)
2022-02-01 12:32:43 -05:00
bjorn3
477d102697 Move coretests to the 2021 edition 2022-02-01 17:58:06 +01:00
bjorn3
5067ad9edc Replace unimplemented with todo in apply_attrs_to_cleanup_callsite 2022-02-01 17:58:06 +01:00
bjorn3
9c3a1235c5 Fix type_kind implementation 2022-02-01 17:58:03 +01:00
bjorn3
7aaa87bcd2 Rustup to rustc 1.60.0-nightly (a00e130da 2022-01-29) 2022-02-01 17:50:17 +01:00
bjorn3
28ba4302cc Sync from rust a00e130dae 2022-02-01 17:49:41 +01:00
antoyo
72d89b0c85
Merge pull request #125 from rust-lang/fix/simd-slice
Implement simd_neg
2022-01-31 19:37:33 -05:00
Antoni Boucher
9c3cce661f Implement simd_neg 2022-01-31 18:39:14 -05:00
antoyo
41f20fa3a5
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
2022-01-30 21:45:14 -05:00
antoyo
b7bfb21242
Merge pull request #118 from bjorn3/function_sections
Support -Zfunction-sections
2022-01-26 10:22:06 -05:00
bjorn3
99941cd9d2 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.
2022-01-26 15:13:55 +01:00
antoyo
5dc660b106
Support upgrading the alignment of a global variable (#121)
* Renable failing test
* Update to newest gccjit.rs
2022-01-26 08:57:17 -05:00
antoyo
fc236785a2
Merge pull request #115 from bjorn3/foreign_statics
Correctly import foreign statics
2022-01-25 09:17:50 -05:00
bjorn3
6663f4e78e 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.
2022-01-25 13:28:42 +01:00
bjorn3
cd5d42aad7 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.
2022-01-25 13:16:44 +01:00
bjorn3
4bdc78436b Merge landing_pad and set_cleanup into cleanup_landing_pad 2022-01-24 14:10:05 +01:00
bjorn3
2eaf0bc20a Merge add_handler into catch_switch
Some codegen backends may require all handlers to be immediately known
2022-01-24 14:10:05 +01:00
bjorn3
81597f2721 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.
2022-01-24 13:48:09 +01:00
bjorn3
ba419539d5 Reorder unwinding related builder methods to differentiate between dwarf and msvc instructions 2022-01-24 13:45:34 +01:00
William D. Jones
94dc3753aa Add preliminary support for inline assembly for msp430. 2022-01-22 23:42:46 -05:00
bjorn3
47c311a705 Use Symbol for target features in asm handling
This saves a couple of Symbol::intern calls
2022-01-17 18:06:27 +01:00
Antoni Boucher
e690fb1273 Add comment 2022-01-15 08:57:34 -05:00
Tomasz Miąsko
68cbb46913 Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
Aaron Hill
09afd64969 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`.
2022-01-11 10:16:22 -05:00
Josh Triplett
37069f1a08 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`.
2022-01-01 15:53:11 -08:00
antoyo
0be9d1e887
Merge pull request #114 from bjorn3/sync_from_rust
Sync from rust 028c6f1454
2022-01-01 12:04:05 -05:00
bors
da4a39264b 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
2022-01-01 13:28:13 +00:00
bjorn3
e6e46055df Remove unused extern crate rustc_symbol_mangling 2021-12-31 16:57:33 +01:00
bjorn3
54d2ec1a82 Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31 2021-12-31 16:26:32 +01:00
bjorn3
1411a98352 Remove unnecessary report_symbol_names call (#113)
rustc_interface already calls it for you
2021-12-30 13:55:42 -05:00
bjorn3
92fbc8f591 Ignore new failing test_is_sorted test 2021-12-30 18:16:04 +01:00
bjorn3
0afd012837 Disable long running libcore tests
These only finish in reasonable time with optimizations enabled.

This patch file is copied from cg_clif.
2021-12-30 17:50:54 +01:00
bjorn3
d7fb7aa76d Disable portable-simd test
Support for portable-simd isn't implemented yet
2021-12-30 16:57:11 +01:00
bjorn3
a2c5d29fc9 Add missing feature gate 2021-12-30 16:41:11 +01:00
bjorn3
31482a94a0 Import std::arch::asm 2021-12-30 15:36:30 +01:00
bjorn3
049b6aeba4 Rustup to rustc 1.59.0-nightly (78fd0f633 2021-12-29) 2021-12-30 15:30:27 +01:00
bjorn3
ebc6ad4185 Sync from rust 65d8785f0a 2021-12-30 15:25:38 +01:00
Erik Desjardins
f3e1f33e3c keep noinline for system llvm < 14 2021-12-30 00:15:51 -05:00
Erik Desjardins
2fec53053e 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.
2021-12-29 15:47:49 -05:00
bors
c5d0023afb 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`
2021-12-19 09:31:37 +00:00