about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/meth.rs
AgeCommit message (Collapse)AuthorLines
2024-11-03compiler: Directly use rustc_abi in codegenJubilee Young-1/+1
2024-09-23fix ices on vfe about principal traitLuv-Ray-28/+39
2024-09-17Minimize visibilities.Nicholas Nethercote-6/+6
This makes it much clearer which things are used outside the crate.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-21Move vcall_visibility_metadata optimization hint out of a debuginfo ↵bjorn3-0/+1
generation method
2024-05-27Omit non-needs_drop drop_in_place in vtablesMark Rousskov-2/+25
This replaces the drop_in_place reference with null in vtables. On librustc_driver.so, this drops about ~17k dynamic relocations from the output, since many vtables can now be placed in read-only memory, rather than having a relocated pointer included. This makes a tradeoff by adding a null check at vtable call sites. That's hard to avoid without changing the vtable format (e.g., to use a pc-relative relocation instead of an absolute address, and avoid the dynamic relocation that way). But it seems likely that the check is cheap at runtime.
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_codegen_ssa`.Nicholas Nethercote-0/+1
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2024-03-10use ptradd for vtable indexingErik Desjardins-7/+12
Like field offsets, these are always constant.
2023-07-29cg_ssa: remove pointee types and pointercast/bitcast-of-ptrErik Desjardins-3/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1/+1
2023-05-03Add cross-language LLVM CFI support to the Rust compilerRamon de C Valle-2/+3
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-04-19Add `GenericArgKind::as_{type,const,region}`Maybe Waffle-4/+4
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-03Directly return loaded value from type_checked_loadbjorn3-2/+1
2022-09-12Call destructors when dyn* object goes out of scopeEric Holk-2/+1
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-08-29Simplify get_trait_ref a bitMichael Goulet-11/+7
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-2/+2
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-06-14Add llvm.type.checked.load intrinsicflip1995-10/+42
Add the intrinsic declare {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 %offset, metadata %type) This is used in the VFE optimization when lowering loading functions from vtables to LLVM IR. The `metadata` is used to map the function to all vtables this function could belong to. This ensures that functions from vtables that might be used somewhere won't get removed.
2022-03-14debuginfo: Refactor debuginfo generation for types -- Rename ↵Michael Woerister-1/+1
DebugInfoMethods::create_vtable_metadata() to DebugInfoMethods::create_vtable_debuginfo()
2021-10-11Auto merge of #89597 - michaelwoerister:improve-vtable-debuginfo, r=wesleywiserbors-1/+1
Create more accurate debuginfo for vtables. Before this PR all vtables would have the same name (`"vtable"`) in debuginfo. Now they get an unambiguous name that identifies the implementing type and the trait that is being implemented. This is only one of several possible improvements: - This PR describes vtables as arrays of `*const u8` pointers. It would nice to describe them as structs where function pointer is represented by a field with a name indicative of the method it maps to. However, this requires coming up with a naming scheme that avoids clashes between methods with the same name (which is possible if the vtable contains multiple traits). - The PR does not update the debuginfo we generate for the vtable-pointer field in a fat `dyn` pointer. Right now there does not seem to be an easy way of getting ahold of a vtable-layout without also knowing the concrete self-type of a trait object. r? `@wesleywiser`
2021-10-08Create more accurate debuginfo for vtables.Michael Woerister-1/+1
Before this commit all vtables would have the same name "vtable" in debuginfo. Now they get a name that identifies the implementing type and the trait that is being implemented.
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+1
2021-08-04Prepare inbounds_gep for opaque pointersTomasz Miąsko-2/+2
Implement inbounds_gep using LLVMBuildInBoundsGEP2 which takes an explicit type argument instead of deriving it from a pointer type.
2021-07-09Pass type when creating loadNikita Popov-4/+6
This makes load generation compatible with opaque pointers. The generation of nontemporal copies still accesses the pointer element type, as fixing this requires more movement.
2021-06-28Update other codegens to use tcx managed vtable allocations.Charles Lew-39/+4
2021-06-15Refactor to make interpreter and codegen backend neutral to vtable internal ↵Charles Lew-32/+23
representation.
2020-08-30mv compiler to compiler/mark-0/+126