about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/meth.rs
AgeCommit message (Collapse)AuthorLines
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