[Lldb-commits] [lldb] [lldb][DataFormatter] VectorType: fix format for arrays with size not a power-of-2 (PR #68907)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 12 22:08:06 PDT 2023


================
@@ -169,19 +169,42 @@ static lldb::Format GetItemFormatForFormat(lldb::Format format,
   }
 }
 
+/// \brief Returns the number of elements of 'container_type'
+/// as if its elements had type 'element_type'.
+///
+/// For example, a container of type
+/// `uint8_t __attribute__((vector_size(16)))` has 16 elements.
+/// But calling `CalculateNumChildren` with an 'element_type'
+/// of `float` (4-bytes) will return `4` because we are interpreting
+/// the byte-array as a `float32[]`.
+///
+/// \param[in] container_type The type of the container We
+/// are calculating the children of.
+///
+/// \param[in] element_type The type of elements we interpret
+/// container_type to contain for the purposes of calculating
+/// the number of children.
+///
+/// If size of the container is not a multiple of 'element_type'
----------------
medismailben wrote:

nit: You could use `\return` block here

https://github.com/llvm/llvm-project/pull/68907


More information about the lldb-commits mailing list