diff options
| author | Matthew Maurer <mmaurer@google.com> | 2024-03-15 19:45:46 +0000 |
|---|---|---|
| committer | Matthew Maurer <mmaurer@google.com> | 2024-03-23 18:30:39 +0000 |
| commit | 7967915c7b456d59fd963260822d3cf583969948 (patch) | |
| tree | 7302ce9b204ea9a7f9803f31779ee4f75cc42ada /compiler/rustc_codegen_ssa/src/traits | |
| parent | 020bbe46bdf613c0b8211984eaa8e5fe97d6c92d (diff) | |
| download | rust-7967915c7b456d59fd963260822d3cf583969948.tar.gz rust-7967915c7b456d59fd963260822d3cf583969948.zip | |
CFI: Use Instance at callsites
We already use `Instance` at declaration sites when available to glean additional information about possible abstractions of the type in use. This does the same when possible at callsites as well. The primary purpose of this change is to allow CFI to alter how it generates type information for indirect calls through `Virtual` instances.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/traits')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/builder.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/builder.rs b/compiler/rustc_codegen_ssa/src/traits/builder.rs index 7bc9dee3a89..6c8dcc5b690 100644 --- a/compiler/rustc_codegen_ssa/src/traits/builder.rs +++ b/compiler/rustc_codegen_ssa/src/traits/builder.rs @@ -17,7 +17,7 @@ use crate::MemFlags; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; use rustc_middle::ty::layout::{HasParamEnv, TyAndLayout}; -use rustc_middle::ty::Ty; +use rustc_middle::ty::{Instance, Ty}; use rustc_session::config::OptLevel; use rustc_span::Span; use rustc_target::abi::call::FnAbi; @@ -82,6 +82,7 @@ pub trait BuilderMethods<'a, 'tcx>: then: Self::BasicBlock, catch: Self::BasicBlock, funclet: Option<&Self::Funclet>, + instance: Option<Instance<'tcx>>, ) -> Self::Value; fn unreachable(&mut self); @@ -389,6 +390,7 @@ pub trait BuilderMethods<'a, 'tcx>: llfn: Self::Value, args: &[Self::Value], funclet: Option<&Self::Funclet>, + instance: Option<Instance<'tcx>>, ) -> Self::Value; fn zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value; |
