about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/builder.rs
AgeCommit message (Collapse)AuthorLines
2023-06-19Merge commit '1bbee3e217d75e7bc3bfe5d8c1b35e776fce96e6' into ↵Antoni Boucher-21/+51
sync-cg_gcc-2023-06-19
2023-05-31Add a distinct `OperandValue::ZeroSized` variant for ZSTsScott McMurray-1/+1
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than non-Scalar Aggregates sometimes being `Immediates` (like I got wrong and caused 109992). As a minor bonus, it means we don't need to generate poison LLVM values for them to pass around in `OperandValue::Immediate`s.
2023-05-07Add todo for filter landing padGary Guo-0/+1
2023-05-07Use `landingpad filter` to encode aborting landing padGary Guo-0/+4
2023-05-03Add cross-language LLVM CFI support to the Rust compilerRamon de C Valle-4/+6
This commit adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395). It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653. Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto).
2023-03-05Merge commit '08a6d6e16b5efe217123e780398969946266268f' into ↵Antoni Boucher-81/+332
sync-cg_gcc-2023-03-04
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-1/+1
...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string, which will be done in a followup.
2023-01-04Simplify some iterator combinatorsMichael Goulet-1/+1
2022-12-03Destruct landing_pad return value before passing it to cg_ssabjorn3-7/+7
2022-11-16Use `&mut Bx` more.Nicholas Nethercote-5/+4
For the next commit, `FunctionCx::codegen_*_terminator` need to take a `&mut Bx` instead of consuming a `Bx`. This triggers a cascade of similar changes across multiple functions. The resulting code is more concise and replaces many `&mut bx` expressions with `bx`.
2022-10-02Remove type argument of array_alloca and rename to byte_array_allocabjorn3-1/+1
2022-10-02Remove dynamic_alloca from BuilderMethodsbjorn3-4/+0
2022-10-01Merge apply_attrs_callsite into call and invokebjorn3-4/+27
Some codegen backends are not able to apply callsite attrs after the fact.
2022-08-16Move the cast_float_to_int fallback code to GCCJosh Stone-5/+169
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.
2022-07-24Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisabors-10/+0
Add fine-grained LLVM CFI support to the Rust compiler This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
2022-07-23Add fine-grained LLVM CFI support to the Rust compilerRamon de C Valle-10/+0
This commit improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-1/+1
2022-06-06Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gccAntoni Boucher-29/+222
2022-05-25rustc_codegen_ssa: derive copy and clone for various enumsTomasz Miąsko-19/+2
2022-05-25rustc_codegen_ssa: cleanup `AtomicOrdering`Tomasz Miąsko-4/+2
* Remove unused `NotAtomic` ordering. * Rename `Monotonic` to `Relaxed` - a Rust specific name.
2022-04-05Mark scalar layout unions so that backends that do not support partially ↵Oli Scherer-4/+4
initialized scalars can special case them.
2022-03-30Spellchecking some commentsYuri Astrakhan-2/+2
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-26Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into ↵bjorn3-252/+100
sync_cg_gcc-2022-03-26
2022-03-03all: fix some typoscuishuang-1/+1
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-02-27Revert "Auto merge of #92419 - erikdesjardins:coldland, r=nagisa"Erik Desjardins-1/+1
This reverts commit 4f49627c6fe2a32d1fed6310466bb0e1c535c0c0, reversing changes made to 028c6f1454787c068ff5117e9000a1de4fd98374.
2022-02-24Introduce Bx::switch_to_blockbjorn3-9/+15
2022-02-20Remove build_sibling_blockbjorn3-12/+9
2022-01-24Merge landing_pad and set_cleanup into cleanup_landing_padbjorn3-5/+1
2022-01-24Merge add_handler into catch_switchbjorn3-5/+6
Some codegen backends may require all handlers to be immediately known
2022-01-24Remove unused return values from resume and cleanup_retbjorn3-2/+2
Given that these instructions are diverging, not every codegen backend may be able to produce a return value for them.
2022-01-24Reorder unwinding related builder methods to differentiate between dwarf and ↵bjorn3-4/+4
msvc instructions
2022-01-01Auto merge of #92419 - erikdesjardins:coldland, r=nagisabors-1/+1
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
2021-12-31Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into ↵bjorn3-25/+24
sync_cg_clif-2021-12-31
2021-12-30keep noinline for system llvm < 14Erik Desjardins-1/+1
2021-12-29Mark drop calls in landing pads cold instead of noinlineErik Desjardins-1/+1
Now that deferred inlining has been disabled in LLVM, this shouldn't cause catastrophic size blowup.
2021-10-25Add LLVM CFI support to the Rust compilerRamon de C Valle-0/+10
This commit adds LLVM Control Flow Integrity (CFI) support to the Rust compiler. It initially provides forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their number of arguments. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by defining and using compatible type identifiers (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).
2021-09-28Merge commit '9809f5d21990d9e24b3e9876ea7da756fd4e9def' into libgccjit-codegenAntoni Boucher-7/+39
2021-09-17Merge commit '48d60ab7c505c6c1ebb042eacaafd8dc9f7a9267' into libgccjit-codegenAntoni Boucher-14/+13
2021-08-15Merge commit 'e228f0c16ea8c34794a6285bf57aab627c26b147' into libgccjit-codegenAntoni Boucher-392/+79
2021-08-14Merge commit '0c89065b934397b62838fe3e4ef6f6352fc52daf' into libgccjit-codegenAntoni Boucher-12/+22
2021-08-12Add 'compiler/rustc_codegen_gcc/' from commit ↵Antoni Boucher-0/+1812
'afae271d5d3719eeb92c18bc004bb6d1965a5f3f' git-subtree-dir: compiler/rustc_codegen_gcc git-subtree-mainline: ae90dcf0207c57c3034f00b07048d63f8b2363c8 git-subtree-split: afae271d5d3719eeb92c18bc004bb6d1965a5f3f