Skip to content

Commit

Permalink
cg_llvm: stop identifying ADTs when fewer_names (issue 96242)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Dec 7, 2022
1 parent 5d2b7ba commit 0fcc9be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_codegen_llvm/src/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit 0fcc9be

Please sign in to comment.