Skip to content

Commit 0fcc9be

Browse files
cg_llvm: stop identifying ADTs when fewer_names (issue 96242)
1 parent 5d2b7ba commit 0fcc9be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_codegen_llvm/src/type_of.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ fn uncached_llvm_type<'a, 'tcx>(
6363
}
6464
Some(name)
6565
}
66-
// Use identified structure types for ADT. Due to pointee types in LLVM IR their definition
66+
// In LLVM < 15, use identified structure types for ADT. Due to pointee types in LLVM IR their definition
6767
// might be recursive. Other cases are non-recursive and we can use literal structure types.
68-
ty::Adt(..) => Some(String::new()),
68+
// In LLVM 15, we use opaque pointers, so there are no pointee types and no potential recursion.
69+
ty::Adt(..) if get_version() < (15, 0, 0) => Some(String::new()),
6970
_ => None,
7071
};
7172

0 commit comments

Comments
 (0)