[PATCH] D44048: [DebugInfo] Add DW_AT_byte_size to vectors

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 17:12:03 PST 2018

echristo added inline comments.

Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1428
+  const auto Subrange = cast<DISubrange>(Elements[0]);
+  const auto CI = Subrange->getCount().dyn_cast<ConstantInt *>();
+  const int32_t NumVecElements = CI->getSExtValue();
probinson wrote:
> I think `get<ConstantInt *>` instead of `dyn_cast` so this will assert if it isn't the right type.
Yes, because otherwise you could be grabbing a null pointer as well.


More information about the llvm-commits mailing list