This is to fix CodeView build failure https://bugs.llvm.org/show_bug.cgi?id=47287 after DIsSubrange upgrade D80197 Assert condition is now removed and Count is calculated in case LowerBound is absent or zero and Count or UpperBound is constant. If Count is unknown it is later handled as VLA (currently Count is set to zero).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | ||
---|---|---|
1588–1589 | I think we should handle the presence of anything we don't understand (non-zero lower bound, stride, and upper bound) as a VLA. As in, translate it to an array count of -1. That's how we can eliminate the assertion. If the user tries to emit codeview when compiling fortran with these types of arrays, they would probably prefer to have an array bound of zero in their debug info than for the compiler to crash. I should've provided that guidance during the original review when this code landed. The author was trying to be cautious. |
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | ||
---|---|---|
1588–1589 | Thanks for your comment. I shall update the patch and request you to have a look at updated patch and share your feedback. |
I would ask you to add a test, but I can't recommend the existing test, llvm/test/DebugInfo/COFF/types-array.ll, as a good basis for a test. I'll look into rewriting it and adding coverage after you land.
I think we should handle the presence of anything we don't understand (non-zero lower bound, stride, and upper bound) as a VLA. As in, translate it to an array count of -1. That's how we can eliminate the assertion. If the user tries to emit codeview when compiling fortran with these types of arrays, they would probably prefer to have an array bound of zero in their debug info than for the compiler to crash.
I should've provided that guidance during the original review when this code landed. The author was trying to be cautious.