[Lldb-commits] [lldb] [lldb][DataFormatter] VectorType: fix format for arrays with size not a power-of-2 (PR #68907)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 13 09:12:36 PDT 2023
================
@@ -169,21 +169,49 @@ static lldb::Format GetItemFormatForFormat(lldb::Format format,
}
}
-static size_t CalculateNumChildren(
- CompilerType container_type, CompilerType element_type,
- lldb_private::ExecutionContextScope *exe_scope =
- nullptr // does not matter here because all we trade in are basic types
- ) {
- std::optional<uint64_t> container_size =
- container_type.GetByteSize(exe_scope);
- std::optional<uint64_t> element_size = element_type.GetByteSize(exe_scope);
-
- if (container_size && element_size && *element_size) {
- if (*container_size % *element_size)
- return 0;
- return *container_size / *element_size;
- }
- return 0;
+/// \brief Returns the number of elements stored in a container
----------------
adrian-prantl wrote:
We run Doxygen with autobrief, so this \brief should be redundant.
https://github.com/llvm/llvm-project/pull/68907
More information about the lldb-commits
mailing list