[llvm] Fixes for compile rust code (PR #192134)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 15:53:57 PDT 2026
================
@@ -794,6 +794,12 @@ void BTFDebug::visitArrayType(const DICompositeType *CTy, uint32_t &TypeId) {
// Visit array dimensions.
DINodeArray Elements = CTy->getElements();
+ if (Elements.size() == 0) {
+ // Rust and other languages may emit array types with no dimensions.
+ // Treat as a zero-length array so the type is still registered.
+ auto TypeEntry = std::make_unique<BTFTypeArray>(ElemTypeId, 0);
----------------
4ast wrote:
Not sure whether it makes it easier to read. Will consider for followup.
https://github.com/llvm/llvm-project/pull/192134
More information about the llvm-commits
mailing list