From 0fcc9beb41f606c72a42e30b864ad52da5bc3304 Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Tue, 6 Dec 2022 00:22:34 -0500 Subject: [PATCH] cg_llvm: stop identifying ADTs when `fewer_names` (issue 96242) --- compiler/rustc_codegen_llvm/src/type_of.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/type_of.rs b/compiler/rustc_codegen_llvm/src/type_of.rs index 4248063312191..1cb83068d5805 100644 --- a/compiler/rustc_codegen_llvm/src/type_of.rs +++ b/compiler/rustc_codegen_llvm/src/type_of.rs @@ -63,9 +63,10 @@ fn uncached_llvm_type<'a, 'tcx>( } Some(name) } - // Use identified structure types for ADT. Due to pointee types in LLVM IR their definition + // In LLVM < 15, use identified structure types for ADT. Due to pointee types in LLVM IR their definition // might be recursive. Other cases are non-recursive and we can use literal structure types. - ty::Adt(..) => Some(String::new()), + // In LLVM 15, we use opaque pointers, so there are no pointee types and no potential recursion. + ty::Adt(..) if get_version() < (15, 0, 0) => Some(String::new()), _ => None, };