From 1d7f728901090e3343e9c284886f9983a052edef Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Sat, 29 Jul 2023 16:12:27 -0400 Subject: [PATCH] cg_llvm: stop identifying ADTs in LLVM IR Now that we use opaque pointers, ADTs can no longer be recursive, so we do not need to name them. Previously, this would be necessary if you had a struct like ```rs struct Foo(Box, u64, u64); ``` which would be represented with something like ```ll %Foo = type { %Foo*, i64, i64 } ``` which is now just ```ll { ptr, i64, i64 } ``` --- compiler/rustc_codegen_llvm/src/type_of.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/type_of.rs b/compiler/rustc_codegen_llvm/src/type_of.rs index ac18fdfe07fb0..b6cf22b4cca0b 100644 --- a/compiler/rustc_codegen_llvm/src/type_of.rs +++ b/compiler/rustc_codegen_llvm/src/type_of.rs @@ -61,9 +61,6 @@ fn uncached_llvm_type<'a, 'tcx>( } Some(name) } - // 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()), _ => None, };