Skip to content

Commit 1d7f728

Browse files
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<Foo>, u64, u64); ``` which would be represented with something like ```ll %Foo = type { %Foo*, i64, i64 } ``` which is now just ```ll { ptr, i64, i64 } ```
1 parent 04303cf commit 1d7f728

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

compiler/rustc_codegen_llvm/src/type_of.rs

-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ fn uncached_llvm_type<'a, 'tcx>(
6161
}
6262
Some(name)
6363
}
64-
// Use identified structure types for ADT. Due to pointee types in LLVM IR their definition
65-
// might be recursive. Other cases are non-recursive and we can use literal structure types.
66-
ty::Adt(..) => Some(String::new()),
6764
_ => None,
6865
};
6966

0 commit comments

Comments
 (0)